Skip to content

Commit e95b9a9

Browse files
committed
Add libd265, libraw, openjpeg, poppler for Tropy
1 parent 029dbbb commit e95b9a9

8 files changed

Lines changed: 246 additions & 65 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,17 @@ on:
1616
- ready_for_review
1717
permissions: {}
1818
jobs:
19-
check-latest-versions:
20-
permissions:
21-
contents: read
22-
runs-on: 'ubuntu-24.04'
23-
steps:
24-
- name: Checkout
25-
uses: actions/checkout@v6
26-
- name: Check latest versions
27-
run: ./check-latest-versions.sh && git diff --quiet
2819
build:
2920
permissions:
3021
contents: read
3122
name: build-${{ matrix.platform }}
3223
runs-on: ${{ matrix.os }}
33-
needs: check-latest-versions
3424
strategy:
3525
fail-fast: false
3626
matrix:
3727
include:
3828
- os: 'ubuntu-24.04'
3929
platform: 'linux-x64'
40-
- os: 'ubuntu-24.04'
41-
platform: 'linux-armv6'
42-
- os: 'ubuntu-24.04'
43-
platform: 'linuxmusl-x64'
44-
- os: 'ubuntu-24.04'
45-
platform: 'linux-ppc64le'
46-
- os: 'ubuntu-24.04'
47-
platform: 'linux-riscv64'
48-
- os: 'ubuntu-24.04'
49-
platform: 'linux-s390x'
50-
- os: 'ubuntu-24.04'
51-
platform: 'dev-wasm32'
52-
- os: 'ubuntu-24.04'
53-
platform: 'win32-ia32'
5430
- os: 'ubuntu-24.04'
5531
platform: 'win32-x64'
5632
- os: 'ubuntu-24.04'
@@ -59,10 +35,6 @@ jobs:
5935
platform: 'darwin-x64'
6036
- os: 'macos-15'
6137
platform: 'darwin-arm64v8'
62-
- os: 'ubuntu-24.04-arm'
63-
platform: 'linux-arm64v8'
64-
- os: 'ubuntu-24.04-arm'
65-
platform: 'linuxmusl-arm64v8'
6638
steps:
6739
- name: Checkout
6840
uses: actions/checkout@v6
@@ -81,10 +53,8 @@ jobs:
8153
compression-level: 0
8254
retention-days: 1
8355
if-no-files-found: error
84-
populate-and-publish-npm-workspace:
85-
permissions:
86-
contents: write
87-
id-token: write
56+
release:
57+
if: startsWith(github.ref, 'refs/tags/v')
8858
needs: build
8959
runs-on: ubuntu-24.04
9060
steps:
@@ -98,21 +68,9 @@ jobs:
9868
uses: actions/download-artifact@v7
9969
with:
10070
merge-multiple: true
101-
- name: Populate npm workspace
102-
run: ./populate-npm-workspace.sh
103-
- name: Create npm workspace tarball
104-
run: tar -vcaf npm-workspace.tar.xz -C npm .
105-
- name: Generate release notes
106-
run: ./generate-release-notes.sh
10771
- name: Create GitHub release for tag
108-
if: startsWith(github.ref, 'refs/tags/v')
10972
uses: ncipollo/release-action@v1
11073
with:
111-
artifacts: npm-workspace.tar.xz
112-
artifactContentType: application/x-xz
113-
bodyFile: release-notes.md
114-
prerelease: ${{ contains(github.ref, '-rc') }}
115-
makeLatest: ${{ !contains(github.ref, '-rc') }}
116-
- name: Publish npm packages
117-
if: startsWith(github.ref, 'refs/tags/v')
118-
run: cd npm && npm publish --workspaces --tag=${{ contains(github.ref, '-rc') && 'next' || 'latest' }}
74+
artifacts: '*.tar.gz'
75+
artifactContentType: application/gzip
76+
prerelease: true

THIRD-PARTY-NOTICES.json

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
[
2+
{
3+
"name": "aom",
4+
"license": "BSD 2-Clause + Alliance for Open Media Patent License 1.0",
5+
"licenseURL": [
6+
"https://aomedia.googlesource.com/aom/+/refs/heads/master/LICENSE?format=TEXT",
7+
"https://aomedia.googlesource.com/aom/+/refs/heads/master/PATENTS?format=TEXT"
8+
]
9+
},
10+
{
11+
"name": "cairo",
12+
"license": "MPL-2.0",
13+
"licenseURL": "https://gitlab.freedesktop.org/cairo/cairo/-/raw/master/COPYING-MPL-1.1"
14+
},
15+
{
16+
"name": "cgif",
17+
"license": "MIT License",
18+
"licenseURL": "https://raw.githubusercontent.com/dloebl/cgif/refs/heads/main/LICENSE"
19+
},
20+
{
21+
"name": "expat",
22+
"license": "MIT",
23+
"licenseURL": "https://raw.githubusercontent.com/libexpat/libexpat/master/expat/COPYING"
24+
},
25+
{
26+
"name": "fontconfig",
27+
"license": "fontconfig Licence",
28+
"licenseURL": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/raw/main/COPYING"
29+
},
30+
{
31+
"name": "freetype",
32+
"license": "freetype Licence",
33+
"licenseURL": "https://gitlab.freedesktop.org/freetype/freetype/-/raw/master/LICENSE.TXT"
34+
},
35+
{
36+
"name": "fribidi",
37+
"license": "LGPL-2.1",
38+
"licenseURL": "https://raw.githubusercontent.com/fribidi/fribidi/master/COPYING"
39+
},
40+
{
41+
"name": "glib",
42+
"license": "LGPL-2.1",
43+
"licenseURL": "https://gitlab.gnome.org/GNOME/glib/-/raw/main/LICENSES/LGPL-2.1-or-later.txt"
44+
},
45+
{
46+
"name": "harfbuzz",
47+
"license": "MIT",
48+
"licenseURL": "https://raw.githubusercontent.com/harfbuzz/harfbuzz/master/COPYING"
49+
},
50+
{
51+
"name": "highway",
52+
"license": "BSD 3-Clause",
53+
"licenseURL": "https://raw.githubusercontent.com/google/highway/refs/heads/master/LICENSE"
54+
},
55+
{
56+
"name": "lcms",
57+
"license": "MIT",
58+
"licenseURL": "https://raw.githubusercontent.com/mm2/Little-CMS/refs/heads/master/LICENSE"
59+
},
60+
{
61+
"name": "libarchive",
62+
"license": "BSD 2-Clause",
63+
"licenseURL": "https://raw.githubusercontent.com/libarchive/libarchive/refs/heads/master/COPYING"
64+
},
65+
{
66+
"name": "libexif",
67+
"license": "LGPL-2.1",
68+
"licenseURL": "https://raw.githubusercontent.com/libexif/libexif/master/COPYING"
69+
},
70+
{
71+
"name": "libde265",
72+
"license": "LGPL-3.0",
73+
"licenseURL": "https://raw.githubusercontent.com/strukturag/libde265/master/COPYING"
74+
},
75+
{
76+
"name": "libffi",
77+
"license": "MIT",
78+
"licenseURL": "https://raw.githubusercontent.com/libffi/libffi/master/LICENSE"
79+
},
80+
{
81+
"name": "libheif",
82+
"license": "LGPL-3.0",
83+
"licenseURL": "https://raw.githubusercontent.com/strukturag/libheif/master/COPYING"
84+
},
85+
{
86+
"name": "libimagequant",
87+
"license": "BSD 2-Clause",
88+
"licenseURL": "https://raw.githubusercontent.com/lovell/libimagequant/main/COPYRIGHT"
89+
},
90+
{
91+
"name": "mozjpeg",
92+
"license": "zlib License, IJG License, BSD-3-Clause",
93+
"licenseURL": "https://raw.githubusercontent.com/mozilla/mozjpeg/master/LICENSE.md"
94+
},
95+
{
96+
"name": "LibRaw",
97+
"license": "LGPL-2.1",
98+
"licenseURL": "https://raw.githubusercontent.com/LibRaw/LibRaw/refs/heads/master/LICENSE.LGPL"
99+
},
100+
{
101+
"name": "librsvg",
102+
"license": "LGPL-2.1",
103+
"licenseURL": "https://gitlab.gnome.org/GNOME/librsvg/-/raw/main/COPYING.LIB"
104+
},
105+
{
106+
"name": "libspng",
107+
"license": "BSD 2-Clause, libpng License",
108+
"licenseURL": "https://raw.githubusercontent.com/randy408/libspng/master/LICENSE"
109+
},
110+
{
111+
"name": "libtiff",
112+
"license": "libtiff License",
113+
"licenseURL": "https://gitlab.com/libtiff/libtiff/-/raw/master/LICENSE.md"
114+
},
115+
{
116+
"name": "libvips",
117+
"license": "LGPL-2.1",
118+
"licenseURL": "https://raw.githubusercontent.com/libvips/libvips/refs/heads/master/LICENSE"
119+
},
120+
{
121+
"name": "libwebp",
122+
"license": "BSD-3-Clause",
123+
"licenseURL": [
124+
"https://chromium.googlesource.com/webm/libwebp/+/refs/heads/main/COPYING?format=TEXT",
125+
"https://chromium.googlesource.com/webm/libwebp/+/refs/heads/main/PATENTS?format=TEXT"
126+
]
127+
},
128+
{
129+
"name": "libxml2",
130+
"license": "MIT",
131+
"licenseURL": "https://gitlab.gnome.org/GNOME/libxml2/-/raw/master/Copyright"
132+
},
133+
{
134+
"name": "openjpeg",
135+
"license": "BDS 2-Clause",
136+
"licenseURL": "https://raw.githubusercontent.com/uclouvain/openjpeg/master/LICENSE"
137+
},
138+
{
139+
"name": "pango",
140+
"license": "GPL-2.0",
141+
"licenseURL": "https://gitlab.gnome.org/GNOME/pango/-/raw/main/COPYING"
142+
},
143+
{
144+
"name": "pixman",
145+
"license": "MIT",
146+
"licenseURL": "https://gitlab.freedesktop.org/pixman/pixman/-/raw/master/COPYING"
147+
},
148+
{
149+
"name": "poppler",
150+
"license": "GPL-2.0",
151+
"licenseURL": "https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/COPYING"
152+
},
153+
{
154+
"name": "proxy-libintl",
155+
"license": "LGPL-2.0",
156+
"licenseURL": "https://raw.githubusercontent.com/frida/proxy-libintl/master/COPYING"
157+
},
158+
{
159+
"name": "zlib-ng",
160+
"license": "zlib Licence",
161+
"licenseURL": "https://raw.githubusercontent.com/zlib-ng/zlib-ng/develop/LICENSE.md"
162+
}
163+
]

build.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ for flavour in darwin-x64 darwin-arm64v8; do
4848
export PKG_CONFIG="$(brew --prefix)/bin/pkg-config --static"
4949

5050
# Earliest supported version of macOS
51-
if [ $PLATFORM = "darwin-arm64v8" ]; then
52-
export MACOSX_DEPLOYMENT_TARGET="11.0"
53-
else
54-
export MACOSX_DEPLOYMENT_TARGET="10.15"
55-
fi
51+
export MACOSX_DEPLOYMENT_TARGET="12.0"
5652

5753
# Added -fno-stack-check to workaround a stack misalignment bug on macOS 10.15
5854
# See:

build/posix.sh

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,20 @@ AOM_AS_FLAGS="${FLAGS}" cmake -G"Unix Makefiles" \
186186
..
187187
make install/strip
188188

189+
mkdir ${DEPS}/de265
190+
$CURL https://github.com/strukturag/libde265/releases/download/v${VERSION_DE265}/libde265-${VERSION_DE265}.tar.gz | tar xzC ${DEPS}/de265 --strip-components=1
191+
cd ${DEPS}/de265
192+
CFLAGS="${CFLAGS} -O3" CXXFLAGS="${CXXFLAGS} -O3" cmake -G"Unix Makefiles" \
193+
-DCMAKE_TOOLCHAIN_FILE=${ROOT}/Toolchain.cmake -DCMAKE_INSTALL_PREFIX=${TARGET} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release \
194+
-DBUILD_SHARED_LIBS=FALSE -DENABLE_ENCODER=FALSE -DENABLE_DECODER=FALSE
195+
make install/strip
196+
189197
mkdir ${DEPS}/heif
190198
$CURL https://github.com/strukturag/libheif/releases/download/v${VERSION_HEIF}/libheif-${VERSION_HEIF}.tar.gz | tar xzC ${DEPS}/heif --strip-components=1
191199
cd ${DEPS}/heif
192200
CFLAGS="${CFLAGS} -O3" CXXFLAGS="${CXXFLAGS} -O3" cmake -G"Unix Makefiles" \
193201
-DCMAKE_TOOLCHAIN_FILE=${ROOT}/Toolchain.cmake -DCMAKE_INSTALL_PREFIX=${TARGET} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release \
194-
-DBUILD_SHARED_LIBS=FALSE -DBUILD_DOCUMENTATION=0 -DBUILD_TESTING=0 -DENABLE_PLUGIN_LOADING=0 -DWITH_EXAMPLES=0 -DWITH_LIBDE265=0 -DWITH_X265=0
202+
-DBUILD_SHARED_LIBS=FALSE -DBUILD_DOCUMENTATION=0 -DBUILD_TESTING=0 -DENABLE_PLUGIN_LOADING=0 -DWITH_EXAMPLES=0 -DWITH_LIBDE265=TRUE -DWITH_X265=0
195203
make install/strip
196204

197205
mkdir ${DEPS}/jpeg
@@ -233,7 +241,7 @@ cmake -G"Unix Makefiles" \
233241
-DCMAKE_TOOLCHAIN_FILE=${ROOT}/Toolchain.cmake -DCMAKE_INSTALL_PREFIX=${TARGET} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=MinSizeRel \
234242
-DBUILD_SHARED_LIBS=FALSE -DCMath_HAVE_LIBC_POW=1 \
235243
-Dtiff-contrib=OFF -Dtiff-cxx=OFF -Dtiff-docs=OFF -Dtiff-tests=OFF -Dtiff-tools=OFF -Dmdi=OFF \
236-
-Djbig=OFF -Dlerc=OFF -Dlibdeflate=OFF -Dlzma=OFF -Dold-jpeg=OFF -Dpixarlog=OFF -Dtiff-opengl=OFF -Dzstd=OFF
244+
-Djbig=OFF -Dlerc=OFF -Dlibdeflate=OFF -Dlzma=OFF -Dold-jpeg=OFF -Dpixarlog=OFF -Dtiff-opengl=OFF -Dzstd=OFF -Dwebp=OFF
237245
make install/strip
238246

239247
if [ -z "$WITHOUT_HIGHWAY" ]; then
@@ -365,6 +373,46 @@ CFLAGS="${CFLAGS} -O3" CXXFLAGS="${CXXFLAGS} -O3" cmake -G"Unix Makefiles" \
365373
-DBUILD_SHARED_LIBS=FALSE -DUHDR_BUILD_EXAMPLES=FALSE -DUHDR_MAX_DIMENSION=65500 ${WITHOUT_NEON:+-DUHDR_ENABLE_INTRINSICS=FALSE}
366374
make install/strip
367375

376+
mkdir -p ${DEPS}/openjpeg/build
377+
$CURL https://github.com/uclouvain/openjpeg/archive/v${VERSION_OPENJPEG}.tar.gz | tar xzC ${DEPS}/openjpeg --strip-components=1
378+
cd ${DEPS}/openjpeg/build
379+
CFLAGS="${CFLAGS} -O3" CXXFLAGS="${CXXFLAGS} -O3" cmake .. -G"Unix Makefiles" \
380+
-DCMAKE_TOOLCHAIN_FILE=${ROOT}/Toolchain.cmake -DCMAKE_INSTALL_PREFIX=${TARGET} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release \
381+
-DBUILD_SHARED_LIBS=FALSE -DBUILD_CODEC=OFF -DBUILD_TESTING=OFF
382+
make install/strip
383+
# Fix generated pkgconfig
384+
sed -i'.bak' "s/-l-lpthread/-lpthread/" ${TARGET}/lib/pkgconfig/libopenjp2.pc
385+
386+
mkdir -p ${DEPS}/poppler/build
387+
$CURL https://gitlab.freedesktop.org/poppler/poppler/-/archive/poppler-${VERSION_POPPLER}/poppler-poppler-${VERSION_POPPLER}.tar.bz2 | tar xjC ${DEPS}/poppler --strip-components=1
388+
cd ${DEPS}/poppler/build
389+
CFLAGS="${CFLAGS} -O3" CXXFLAGS="${CXXFLAGS} -O3" cmake .. -G"Unix Makefiles" \
390+
-DCMAKE_TOOLCHAIN_FILE=${ROOT}/Toolchain.cmake -DCMAKE_INSTALL_PREFIX=${TARGET} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release \
391+
-DBUILD_CPP_TESTS=OFF -DBUILD_GTK_TESTS=OFF -DBUILD_QT5_TESTS=OFF -DBUILD_QT6_TESTS=OFF -DBUILD_MANUAL_TESTS=OFF \
392+
-DBUILD_SHARED_LIBS=FALSE \
393+
-DENABLE_BOOST=OFF \
394+
-DENABLE_CPP=OFF \
395+
-DENABLE_DCTDECODER=libjpeg \
396+
-DENABLE_GLIB=ON \
397+
-DENABLE_GOBJECT_INTROSPECTION=OFF \
398+
-DENABLE_GPGME=OFF \
399+
-DENABLE_GTK_DOC=OFF \
400+
-DENABLE_LIBCURL=OFF \
401+
-DENABLE_LIBTIFF=ON \
402+
-DENABLE_NSS3=OFF \
403+
-DENABLE_QT5=OFF -DENABLE_QT6=OFF \
404+
-DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
405+
-DENABLE_UTILS=OFF \
406+
-DEXTRA_WARN=OFF
407+
make install/strip
408+
409+
mkdir ${DEPS}/libraw
410+
$CURL https://www.libraw.org/data/LibRaw-${VERSION_RAW}.tar.gz | tar xzC ${DEPS}/libraw --strip-components=1
411+
cd ${DEPS}/libraw
412+
CFLAGS="${CFLAGS} -O3" CXXFLAGS="${CXXFLAGS} -O3" ./configure --host=${CHOST} --prefix=${TARGET} --enable-static --disable-shared --disable-dependency-tracking \
413+
--disable-openmp --enable-jpeg --enable-zlib --enable-lcms --disable-examples
414+
make install-strip
415+
368416
mkdir ${DEPS}/vips
369417
$CURL https://github.com/libvips/libvips/releases/download/v${VERSION_VIPS}/vips-$(without_prerelease $VERSION_VIPS).tar.xz | tar xJC ${DEPS}/vips --strip-components=1
370418
cd ${DEPS}/vips
@@ -388,7 +436,8 @@ sed -i'.bak' "/subdir('man')/{N;N;N;N;d;}" meson.build
388436
CFLAGS="${CFLAGS} -O3" CXXFLAGS="${CXXFLAGS} -O3" meson setup _build --default-library=shared --buildtype=release --strip --prefix=${TARGET} ${MESON} \
389437
-Ddeprecated=false -Dexamples=false -Dauto_features=enabled -Dintrospection=disabled -Dmodules=disabled -Dcfitsio=disabled -Dfftw=disabled \
390438
-Djpeg-xl=disabled ${WITHOUT_HIGHWAY:+-Dhighway=disabled} -Dorc=disabled -Dmagick=disabled -Dmatio=disabled -Dnifti=disabled -Dopenexr=disabled \
391-
-Dopenjpeg=disabled -Dopenslide=disabled -Dpdfium=disabled -Dpoppler=disabled -Dquantizr=disabled -Draw=disabled -Dspng=disabled \
439+
-Dopenslide=disabled -Dpdfium=disabled -Dpoppler=enabled -Dquantizr=disabled -Draw=enabled -Dspng=disabled \
440+
-Dopenjpeg=enabled \
392441
-Dppm=false -Danalyze=false -Dradiance=false \
393442
${LINUX:+-Dcpp_link_args="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--version-script=$DEPS/vips/vips.map $EXCLUDE_LIBS"}
394443
meson install -C _build --tag runtime,devel
@@ -452,6 +501,7 @@ printf "{\n\
452501
\"cgif\": \"${VERSION_CGIF}\",\n\
453502
\"exif\": \"${VERSION_EXIF}\",\n\
454503
\"expat\": \"${VERSION_EXPAT}\",\n\
504+
\"de265\": \"${VERSION_DE265}\",\n\
455505
\"ffi\": \"${VERSION_FFI}\",\n\
456506
\"fontconfig\": \"${VERSION_FONTCONFIG}\",\n\
457507
\"freetype\": \"${VERSION_FREETYPE}\",\n\
@@ -463,10 +513,13 @@ printf "{\n\
463513
\"imagequant\": \"${VERSION_IMAGEQUANT}\",\n\
464514
\"lcms\": \"${VERSION_LCMS}\",\n\
465515
\"mozjpeg\": \"${VERSION_MOZJPEG}\",\n\
516+
\"openjpeg\": \"${VERSION_OPENJPEG}\",\n\
466517
\"pango\": \"${VERSION_PANGO}\",\n\
467518
\"pixman\": \"${VERSION_PIXMAN}\",\n\
468519
\"png\": \"${VERSION_PNG}\",\n\
520+
\"poppler\": \"${VERSION_POPPLER}\",\n\
469521
\"proxy-libintl\": \"${VERSION_PROXY_LIBINTL}\",\n\
522+
\"raw\": \"${VERSION_RAW}\",\n\
470523
\"rsvg\": \"${VERSION_RSVG}\",\n\
471524
\"tiff\": \"${VERSION_TIFF}\",\n\
472525
\"uhdr\": \"${VERSION_UHDR}\",\n\
@@ -477,7 +530,7 @@ printf "{\n\
477530
}" >versions.json
478531

479532
# Add third-party notices
480-
$CURL -O https://raw.githubusercontent.com/lovell/sharp-libvips/main/THIRD-PARTY-NOTICES.md
533+
$CURL -O https://raw.githubusercontent.com/tropy/sharp-libvips/main/THIRD-PARTY-NOTICES.json
481534

482535
# Create the tarball
483536
ls -al lib
@@ -486,8 +539,7 @@ mv lib-filtered lib
486539
tar chzf ${PACKAGE}/sharp-libvips-${PLATFORM}.tar.gz \
487540
include \
488541
lib \
489-
*.json \
490-
THIRD-PARTY-NOTICES.md
542+
*.json
491543

492544
# Allow tarballs to be read outside container
493545
chmod 644 ${PACKAGE}/sharp-libvips-${PLATFORM}.tar.*

0 commit comments

Comments
 (0)