Skip to content

chore: libvips 8.17 note #305

chore: libvips 8.17 note

chore: libvips 8.17 note #305

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
jobs:
generate:
name: CI
runs-on: ubuntu-24.04
env:
CGO_CFLAGS_ALLOW: -Xpreprocessor
VIPS_VERSION: 8.17.0
V: 5
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ^1.24
- name: Check out code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
meson ninja-build \
libglib2.0-dev libexpat-dev librsvg2-dev libpng-dev \
libjpeg-turbo8-dev libimagequant-dev libfftw3-dev \
libpoppler-glib-dev libxml2-dev \
libopenslide-dev libcfitsio-dev liborc-0.4-dev libpango1.0-dev \
libtiff5-dev libgsf-1-dev giflib-tools libwebp-dev libheif-dev \
libopenjp2-7-dev libcgif-dev \
gobject-introspection libgirepository1.0-dev \
libmagickwand-dev libmatio-dev libnifti2-dev \
libjxl-dev libzip-dev libarchive-dev
# Create missing NIfTI pkg-config file to help libvips meson detect it
# Ubuntu's libnifti2-dev doesn't provide the pkg-config file that libvips expects
sudo mkdir -p /usr/local/lib/pkgconfig
sudo tee /usr/local/lib/pkgconfig/niftiio.pc > /dev/null <<EOF
prefix=/usr
exec_prefix=\${prefix}
libdir=\${prefix}/lib/x86_64-linux-gnu
includedir=\${prefix}/include/nifti
Name: libniftiio
Description: nifti library
Version: 3.0.1
Requires:
Cflags: -I\${includedir}
Libs: -L\${libdir} -lniftiio -lznz
EOF
- name: Cache libvips
uses: actions/cache@v3
with:
path: vips-${{ env.VIPS_VERSION }}
key: ${{ runner.os }}-24.04-vips-introspection-${{ env.V }}-${{ env.VIPS_VERSION }}
restore-keys: |
${{ runner.os }}-24.04-vips-introspection-${{ env.V }}-
- name: Build libvips from source
run: |
if [ ! -d "vips-${{ env.VIPS_VERSION }}" ]
then
wget https://github.com/libvips/libvips/releases/download/v${{ env.VIPS_VERSION }}/vips-${{ env.VIPS_VERSION }}.tar.xz
tar xf vips-${{ env.VIPS_VERSION }}.tar.xz
fi
cd vips-${{ env.VIPS_VERSION }}
# Detect all available features
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig meson setup _build \
--buildtype=release \
--strip \
--prefix=/usr/local \
--libdir=lib \
-Dmagick=enabled \
-Dopenslide=enabled \
-Dintrospection=enabled \
-Djpeg-xl=enabled
ninja -C _build
sudo ninja -C _build install
sudo ldconfig
- name: Verify vips and introspection
run: |
echo "Checking vips version and introspection files"
vips --version
ls -la /usr/local/share/gir-1.0/ || true
ls -la /usr/share/gir-1.0/ || true
pkg-config --modversion gobject-introspection-1.0 || true
# List all loaders and savers to verify formats
echo "All supported formats:"
vips --list | grep -E "load|save"
- name: Cache Go dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: go mod download
- name: Build vipsgen
run: |
mkdir -p bin
go build -o bin/vipsgen cmd/vipsgen/main.go
- name: Generate vips package
run: |
mkdir -p vips
./bin/vipsgen -out ./vips
- name: Run tests
run: |
$(CGO_CFLAGS_ALLOW="-Xpreprocessor") go test -v ./vips/...
- name: Commit generated files
if: github.event_name == 'pull_request'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "build: update generated vips package"
file_pattern: "vips"