Skip to content

Commit

Permalink
pyvips: add package (#31)
Browse files Browse the repository at this point in the history
* start of pyvips

* meson build

* install meson

* add glib2

* add expat

* cd

* set flags for wheel build

* set prefix

* add png jpeg

* add more deps

* remove unused, static build

* back to working deps

* split out libvips into common

* Revert "split out libvips into common"

This reverts commit 2ab8f41.

* Reapply "split out libvips into common"

This reverts commit c1674ca.

* use base

* add libtiff
  • Loading branch information
bjia56 authored Jun 1, 2024
1 parent 4834265 commit d4e4080
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/pyvips/Dockerfile.stage1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ghcr.io/bjia56/armv7l-wheel-builder:main
ARG PYTHON_VERSION

WORKDIR /
RUN select_python ${PYTHON_VERSION}
RUN pip3 install meson
RUN yum -y install glib2-devel expat-devel libjpeg-devel libpng-devel libtiff-devel
RUN mkdir -p /tmp/vendor
RUN wget -q https://github.com/libvips/libvips/releases/download/v8.15.2/vips-8.15.2.tar.xz && \
tar xf vips-*.tar.xz && \
cd vips-* && \
meson setup build --prefix=/tmp/vendor --default-library static && \
cd build && \
meson compile && \
meson install

15 changes: 15 additions & 0 deletions packages/pyvips/Dockerfile.stage2
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM base
ARG PYTHON_VERSION
ARG VERSION
ARG OUTPUT_DIR

ENV CFLAGS='-I/tmp/vendor/include'
ENV LDFLAGS='-L/tmp/vendor/lib'
ENV LD_LIBRARY_PATH=/tmp/vendor/lib:$LD_LIBRARY_PATH
ENV PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig

COPY . /repo
RUN /repo/armv7l_build_wheels.sh ${PYTHON_VERSION} ${VERSION}

RUN mkdir -p ${OUTPUT_DIR} && \
cp build${PYTHON_VERSION}/wheelhouse/pyvips*manylinux*armv7l.whl ${OUTPUT_DIR}
31 changes: 31 additions & 0 deletions packages/pyvips/armv7l_build_wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

PYTHON3_VERSION=$1
PACKAGE_VERSION=$2

set -e

build_wheel() (
PY_VER=$1
VER=$2
mkdir build$PY_VER
cd build$PY_VER
pip$PY_VER wheel --no-deps pyvips==$VER
)

test_wheel() (
PY_VER=$1
cd build$PY_VER
pip$PY_VER install wheelhouse/pyvips*manylinux*armv7l.whl --extra-index-url https://bjia56.github.io/armv7l-wheels/ --prefer-binary
python$PY_VER -c "import pyvips; print(pyvips)"
)

repair_wheel() (
PY_VER=$1
cd build$PY_VER
auditwheel repair pyvips*armv7l.whl
)

build_wheel $PYTHON3_VERSION $PACKAGE_VERSION
repair_wheel $PYTHON3_VERSION
test_wheel $PYTHON3_VERSION
18 changes: 18 additions & 0 deletions packages/pyvips/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
strategy: dockerfile
source:
- file: ./Dockerfile.stage1
common: true
- file: ./Dockerfile.stage2

python:
versions:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"

package:
versions:
- latest

0 comments on commit d4e4080

Please sign in to comment.