Skip to content

Commit 0a9c722

Browse files
committed
Add libde256 openjpeg poppler for Tropy
1 parent 20fff4a commit 0a9c722

File tree

7 files changed

+255
-23
lines changed

7 files changed

+255
-23
lines changed

.github/workflows/build-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
os: [ ubuntu-22.04 ]
2424
platform:
2525
- 'linux-x64'
26-
- 'linux-armv6'
27-
- 'linux-armv7'
28-
- 'linuxmusl-x64'
29-
- 'linuxmusl-arm64v8'
26+
#- 'linux-armv6'
27+
#- 'linux-armv7'
28+
#- 'linuxmusl-x64'
29+
#- 'linuxmusl-arm64v8'
3030
- 'win32-ia32'
3131
- 'win32-x64'
3232
- 'win32-arm64v8'

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": "archive",
12+
"license": "BDS 2-Clause",
13+
"licenseURL": "https://raw.githubusercontent.com/libarchive/libarchive/master/COPYING"
14+
},
15+
{
16+
"name": "cairo",
17+
"license": "MPL-2.0",
18+
"licenseURL": "https://gitlab.freedesktop.org/cairo/cairo/-/raw/master/COPYING"
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": "gdk-pixbuf",
42+
"license": "LGPL-2.1",
43+
"licenseURL": "https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/raw/master/COPYING"
44+
},
45+
{
46+
"name": "glib",
47+
"license": "LGPL-2.1",
48+
"licenseURL": "https://gitlab.gnome.org/GNOME/glib/-/raw/main/COPYING"
49+
},
50+
{
51+
"name": "harfbuzz",
52+
"license": "MIT",
53+
"licenseURL": "https://raw.githubusercontent.com/harfbuzz/harfbuzz/master/COPYING"
54+
},
55+
{
56+
"name": "lcms",
57+
"license": "MIT",
58+
"licenseURL": "https://raw.githubusercontent.com/mm2/Little-CMS/master/COPYING"
59+
},
60+
{
61+
"name": "libde265",
62+
"license": "LGPL-3.0",
63+
"licenseURL": "https://raw.githubusercontent.com/strukturag/libde265/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": "libffi",
72+
"license": "MIT",
73+
"licenseURL": "https://raw.githubusercontent.com/libffi/libffi/master/LICENSE"
74+
},
75+
{
76+
"name": "libheif",
77+
"license": "LGPL-3.0",
78+
"licenseURL": "https://raw.githubusercontent.com/strukturag/libheif/master/COPYING"
79+
},
80+
{
81+
"name": "libimagequant",
82+
"license": "BSD 2-Clause",
83+
"licenseURL": "https://raw.githubusercontent.com/lovell/libimagequant/main/COPYRIGHT"
84+
},
85+
{
86+
"name": "mozjpeg",
87+
"license": "zlib License, IJG License, BSD-3-Clause",
88+
"licenseURL": "https://raw.githubusercontent.com/mozilla/mozjpeg/master/LICENSE.md"
89+
},
90+
{
91+
"name": "libpng",
92+
"license": "libpng License",
93+
"licenseURL": "https://raw.githubusercontent.com/glennrp/libpng/libpng16/LICENSE"
94+
},
95+
{
96+
"name": "librsvg",
97+
"license": "LGPL-2.1",
98+
"licenseURL": "https://gitlab.gnome.org/GNOME/librsvg/-/raw/main/COPYING.LIB"
99+
},
100+
{
101+
"name": "libspng",
102+
"license": "BSD 2-Clause, libpng License",
103+
"licenseURL": "https://raw.githubusercontent.com/randy408/libspng/master/LICENSE"
104+
},
105+
{
106+
"name": "libtiff",
107+
"license": "libtiff License",
108+
"licenseURL": "https://gitlab.com/libtiff/libtiff/-/raw/master/LICENSE.md"
109+
},
110+
{
111+
"name": "libvips",
112+
"license": "LGPL-2.1",
113+
"licenseURL": "https://raw.githubusercontent.com/libvips/libvips/master/LICENSE"
114+
},
115+
{
116+
"name": "libwebp",
117+
"license": "BSD-3-Clause",
118+
"licenseURL": [
119+
"https://chromium.googlesource.com/webm/libwebp/+/refs/heads/main/COPYING?format=TEXT",
120+
"https://chromium.googlesource.com/webm/libwebp/+/refs/heads/main/PATENTS?format=TEXT"
121+
]
122+
},
123+
{
124+
"name": "libxml2",
125+
"license": "MIT",
126+
"licenseURL": "https://gitlab.gnome.org/GNOME/libxml2/-/raw/master/Copyright"
127+
},
128+
{
129+
"name": "orc",
130+
"license": "orc License",
131+
"licenseURL": "https://gitlab.freedesktop.org/gstreamer/orc/-/raw/master/COPYING"
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://cgit.freedesktop.org/pixman/plain/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: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ for flavour in darwin-x64 darwin-arm64v8; do
5757
export MESON="--cross-file=$PWD/$PLATFORM/meson.ini"
5858

5959
if [ $PLATFORM = "darwin-arm64v8" ]; then
60-
# ARM64 builds work via cross compilation from an x86_64 machine
61-
export CHOST="aarch64-apple-darwin"
62-
export FLAGS+=" -target arm64-apple-macos11"
60+
if [ "$(uname -m)" != "arm64" ]; then
61+
# ARM64 builds work via cross compilation from an x86_64 machine
62+
export CHOST="aarch64-apple-darwin"
63+
export FLAGS+=" -target arm64-apple-macos11"
64+
fi
65+
6366
# macOS 11 Big Sur is the first version to support ARM-based macs
6467
export MACOSX_DEPLOYMENT_TARGET="11.0"
6568
# Set SDKROOT to the latest SDK available

build/lin.sh

Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export RUSTFLAGS+=" --remap-path-prefix=$CARGO_HOME/registry/="
8888
# We don't want to use any native libraries, so unset PKG_CONFIG_PATH
8989
unset PKG_CONFIG_PATH
9090

91+
9192
# Common options for curl
9293
CURL="curl --silent --location --retry 3 --retry-max-time 30"
9394

@@ -121,6 +122,11 @@ VERSION_AOM=3.7.0
121122
VERSION_HEIF=1.16.2
122123
VERSION_CGIF=0.3.2
123124

125+
# Additional Tropy dependencies
126+
VERSION_DE265=1.0.12
127+
VERSION_OPENJPEG=2.5.0
128+
VERSION_POPPLER=23.10.0
129+
124130
# Remove patch version component
125131
without_patch() {
126132
echo "${1%.[[:digit:]]*}"
@@ -179,6 +185,9 @@ version_latest "rsvg" "$VERSION_RSVG" "5420"
179185
version_latest "aom" "$VERSION_AOM" "17628"
180186
version_latest "heif" "$VERSION_HEIF" "strukturag/libheif"
181187
version_latest "cgif" "$VERSION_CGIF" "dloebl/cgif"
188+
version_latest "de265" "$VERSION_DE265" "11239"
189+
version_latest "openjpeg" "$VERSION_OPENJPEG" "2550"
190+
version_latest "poppler" "$VERSION_POPPLER" "3686"
182191
if [ "$ALL_AT_VERSION_LATEST" = "false" ]; then exit 1; fi
183192

184193
# Download and build dependencies from source
@@ -265,12 +274,19 @@ AOM_AS_FLAGS="${FLAGS}" cmake -G"Unix Makefiles" \
265274
..
266275
make install/strip
267276

277+
mkdir ${DEPS}/de265
278+
$CURL https://github.com/strukturag/libde265/releases/download/v${VERSION_DE265}/libde265-${VERSION_DE265}.tar.gz | tar xzC ${DEPS}/de265 --strip-components=1
279+
cd ${DEPS}/de265
280+
./configure --host=${CHOST} --prefix=${TARGET} --enable-static --disable-shared --disable-dependency-tracking \
281+
--disable-dec265 --disable-sherlock265 ${DARWIN_ARM:+--disable-arm}
282+
make install-strip
283+
268284
mkdir ${DEPS}/heif
269285
$CURL https://github.com/strukturag/libheif/releases/download/v${VERSION_HEIF}/libheif-${VERSION_HEIF}.tar.gz | tar xzC ${DEPS}/heif --strip-components=1
270286
cd ${DEPS}/heif
271287
CFLAGS="${CFLAGS} -O3" CXXFLAGS="${CXXFLAGS} -O3" cmake -G"Unix Makefiles" \
272-
-DCMAKE_TOOLCHAIN_FILE=${ROOT}/Toolchain.cmake -DCMAKE_INSTALL_PREFIX=${TARGET} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release \
273-
-DBUILD_SHARED_LIBS=FALSE -DENABLE_PLUGIN_LOADING=0 -DWITH_EXAMPLES=0 -DWITH_LIBDE265=0 -DWITH_X265=0
288+
-DCMAKE_TOOLCHAIN_FILE=${ROOT}/Toolchain.cmake -DCMAKE_PREFIX_PATH=${TARGET} -DCMAKE_INSTALL_PREFIX=${TARGET} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release \
289+
-DBUILD_SHARED_LIBS=FALSE -DENABLE_PLUGIN_LOADING=0 -DWITH_EXAMPLES=0 -DWITH_LIBDE265=ON -DWITH_X265=0
274290
make install/strip
275291

276292
mkdir ${DEPS}/jpeg
@@ -439,6 +455,49 @@ CFLAGS="${CFLAGS} -O3" meson setup _build --default-library=static --buildtype=r
439455
-Dtests=false
440456
meson install -C _build --tag devel
441457

458+
mkdir -p ${DEPS}/openjpeg/build
459+
$CURL https://github.com/uclouvain/openjpeg/archive/v${VERSION_OPENJPEG}.tar.gz | tar xzC ${DEPS}/openjpeg --strip-components=1
460+
cd ${DEPS}/openjpeg/build
461+
LDFLAGS=${LDFLAGS/\$/} cmake .. -G"Unix Makefiles" \
462+
-DCMAKE_TOOLCHAIN_FILE=${ROOT}/Toolchain.cmake -DCMAKE_PREFIX_PATH=${TARGET} -DCMAKE_INSTALL_PREFIX=${TARGET} -DCMAKE_BUILD_TYPE=Release \
463+
-DBUILD_SHARED_LIBS=FALSE -DBUILD_CODEC=OFF
464+
make install/strip
465+
466+
mkdir -p ${DEPS}/poppler/build
467+
$CURL https://gitlab.freedesktop.org/poppler/poppler/-/archive/poppler-${VERSION_POPPLER}/poppler-poppler-${VERSION_POPPLER}.tar.bz2 | tar xjC ${DEPS}/poppler --strip-components=1
468+
cd ${DEPS}/poppler/build
469+
LDFLAGS=${LDFLAGS/\$/} cmake .. -G"Unix Makefiles" \
470+
-DCMAKE_TOOLCHAIN_FILE=${ROOT}/Toolchain.cmake\
471+
-DCMAKE_PREFIX_PATH=${TARGET} \
472+
-DCMAKE_INSTALL_PREFIX=${TARGET} \
473+
-DCMAKE_INSTALL_LIBDIR=lib \
474+
-DCMAKE_BUILD_TYPE=Release \
475+
-DBUILD_SHARED_LIBS=FALSE \
476+
-DBUILD_CPP_TESTS=OFF \
477+
-DBUILD_GTK_TESTS=OFF \
478+
-DBUILD_QT5_TESTS=OFF \
479+
-DBUILD_QT6_TESTS=OFF \
480+
-DBUILD_MANUAL_TESTS=OFF \
481+
-DENABLE_BOOST=OFF \
482+
-DENABLE_CMS=lcms2 \
483+
-DENABLE_CPP=OFF \
484+
-DENABLE_DCTDECODER=libjpeg \
485+
-DENABLE_GLIB=ON \
486+
-DENABLE_GOBJECT_INTROSPECTION=OFF \
487+
-DENABLE_GTK_DOC=OFF \
488+
-DENABLE_LIBCURL=OFF \
489+
-DENABLE_LIBOPENJPEG=openjpeg2 \
490+
-DENABLE_LIBPNG=ON \
491+
-DENABLE_LIBTIFF=ON \
492+
-DENABLE_QT5=OFF \
493+
-DENABLE_QT6=OFF \
494+
-DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
495+
-DENABLE_UTILS=OFF \
496+
-DENABLE_ZLIB=ON \
497+
-DENABLE_ZLIB_UNCOMPRESS=OFF \
498+
-DEXTRA_WARN=OFF
499+
make install/strip
500+
442501
mkdir ${DEPS}/vips
443502
$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
444503
cd ${DEPS}/vips
@@ -461,8 +520,8 @@ fi
461520
sed -i'.bak' "/subdir('man')/{N;N;N;N;d;}" meson.build
462521
CFLAGS="${CFLAGS} -O3" CXXFLAGS="${CXXFLAGS} -O3" meson setup _build --default-library=shared --buildtype=release --strip --prefix=${TARGET} ${MESON} \
463522
-Ddeprecated=false -Dintrospection=false -Dmodules=disabled -Dcfitsio=disabled -Dfftw=disabled -Djpeg-xl=disabled \
464-
-Dmagick=disabled -Dmatio=disabled -Dnifti=disabled -Dopenexr=disabled -Dopenjpeg=disabled -Dopenslide=disabled \
465-
-Dpdfium=disabled -Dpoppler=disabled -Dquantizr=disabled \
523+
-Dmagick=disabled -Dmatio=disabled -Dnifti=disabled -Dopenexr=disabled -Dopenslide=disabled \
524+
-Dpdfium=disabled -Dquantizr=disabled \
466525
-Dppm=false -Danalyze=false -Dradiance=false \
467526
${LINUX:+-Dcpp_link_args="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--version-script=$DEPS/vips/vips.map $EXCLUDE_LIBS"}
468527
meson install -C _build --tag runtime,devel
@@ -552,7 +611,7 @@ printf "{\n\
552611
printf "\"${PLATFORM}\"" >platform.json
553612

554613
# Add third-party notices
555-
$CURL -O https://raw.githubusercontent.com/lovell/sharp-libvips/main/THIRD-PARTY-NOTICES.md
614+
$CURL -O https://raw.githubusercontent.com/tropy/sharp-libvips/main/THIRD-PARTY-NOTICES.json
556615

557616
# Create the tarball
558617
ls -al lib
@@ -561,8 +620,7 @@ mv lib-filtered lib
561620
tar chzf ${PACKAGE}/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz \
562621
include \
563622
lib \
564-
*.json \
565-
THIRD-PARTY-NOTICES.md
623+
*.json
566624

567625
# Recompress using AdvanceCOMP, ~5% smaller
568626
advdef --recompress --shrink-insane ${PACKAGE}/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz

build/win.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@ case ${PLATFORM} in
2222
;;
2323
esac
2424

25-
FILENAME="vips-dev-${ARCH}-web-${VERSION_VIPS}-static.zip"
26-
URL="https://github.com/libvips/build-win64-mxe/releases/download/v${VERSION_VIPS}/${FILENAME}"
27-
echo "Downloading $URL"
28-
$CURL -O $URL
25+
FILENAME="vips-dev-${ARCH}-tropy-${VERSION_VIPS}.zip"
26+
27+
if [ -f /packaging/$FILENAME ]; then
28+
cp /packaging/$FILENAME $FILENAME
29+
else
30+
URL="https://github.com/tropy/build-win64-mxe/releases/download/v${VERSION_VIPS}/${FILENAME}"
31+
echo "Downloading $URL"
32+
$CURL -O $URL
33+
fi
2934
unzip $FILENAME
3035

3136
# Clean and zip
@@ -37,7 +42,7 @@ cp bin/*.dll lib/
3742
printf "\"${PLATFORM}\"" >platform.json
3843

3944
# Add third-party notices
40-
$CURL -O https://raw.githubusercontent.com/lovell/sharp-libvips/main/THIRD-PARTY-NOTICES.md
45+
$CURL -O https://raw.githubusercontent.com/tropy/sharp-libvips/main/THIRD-PARTY-NOTICES.json
4146

4247
echo "Creating tarball"
4348
tar czf /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz \
@@ -47,8 +52,7 @@ tar czf /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz \
4752
lib/libglib-2.0.lib \
4853
lib/libgobject-2.0.lib \
4954
lib/*.dll \
50-
*.json \
51-
THIRD-PARTY-NOTICES.md
55+
*.json
5256

5357
# Recompress using AdvanceCOMP, ~5% smaller
5458
advdef --recompress --shrink-insane /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz
@@ -60,4 +64,4 @@ gunzip -c /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.gz | brotli -o /pac
6064
chmod 644 /packaging/libvips-${VERSION_VIPS}-${PLATFORM}.tar.*
6165

6266
# Remove working directories
63-
rm -rf lib include *.json THIRD-PARTY-NOTICES.md
67+
rm -rf lib include *.json

linux-x64/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ENV \
1111

1212
# Build dependencies
1313
RUN \
14+
ulimit -n 1024 && \
1415
yum update -y && \
1516
yum install -y epel-release centos-release-scl && \
1617
yum group install -y "Development Tools" && \
@@ -34,7 +35,7 @@ RUN \
3435

3536
# Compiler settings
3637
ENV \
37-
PKG_CONFIG="pkg-config --static" \
38+
PKG_CONFIG="/usr/bin/pkg-config --static" \
3839
PLATFORM="linux-x64" \
3940
FLAGS="-march=x86-64-v2 -mtune=nehalem" \
4041
MESON="--cross-file=/root/meson.ini"

linux-x64/Toolchain.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
22
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
33
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
4+
5+
set(PKG_CONFIG_EXECUTABLE "/usr/bin/pkg-config" CACHE PATH "pkg-config-executable")
6+
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)

0 commit comments

Comments
 (0)