Skip to content

Commit cd9da89

Browse files
committed
Linux: upgrade almost every dependency to latest
Build containers now support meson cross-compilation UK Mirrorservice is better than 'official' Sourceforge mirrors Pin librsvg to 2.46.x due to older rustc version on Alpine
1 parent bbf599e commit cd9da89

File tree

1 file changed

+55
-58
lines changed

1 file changed

+55
-58
lines changed

build/lin.sh

Lines changed: 55 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,38 @@ mkdir ${TARGET}
1111
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${TARGET}/lib/pkgconfig"
1212
export PATH="${PATH}:${TARGET}/bin"
1313
export CPPFLAGS="-I${TARGET}/include"
14-
export LDFLAGS="-L${TARGET}/lib -Wl,-rpath,'\$\$ORIGIN'"
14+
export LDFLAGS="-L${TARGET}/lib -Wl,-rpath='\$\$ORIGIN'"
15+
export LD_LIBRARY_PATH="${TARGET}/lib"
1516
export CFLAGS="${FLAGS}"
1617
export CXXFLAGS="${FLAGS}"
1718

1819
# Dependency version numbers
1920
VERSION_ZLIB=1.2.11
20-
VERSION_FFI=3.2.1
21-
VERSION_GLIB=2.56.4
22-
VERSION_XML2=2.9.9
21+
VERSION_FFI=3.3
22+
VERSION_GLIB=2.63.2
23+
VERSION_XML2=2.9.10
2324
VERSION_GSF=1.14.46
2425
VERSION_EXIF=0.6.21
2526
VERSION_LCMS2=2.9
2627
VERSION_JPEG=2.0.3
2728
VERSION_PNG16=1.6.37
2829
VERSION_WEBP=1.0.3
29-
VERSION_TIFF=4.0.10
30-
VERSION_ORC=0.4.29
30+
VERSION_TIFF=4.1.0
31+
VERSION_ORC=0.4.31
3132
VERSION_GETTEXT=0.20.1
32-
VERSION_GDKPIXBUF=2.36.12
33+
VERSION_GDKPIXBUF=2.40.0
3334
VERSION_FREETYPE=2.10.1
34-
VERSION_EXPAT=2.2.8
35+
VERSION_EXPAT=2.2.9
3536
VERSION_FONTCONFIG=2.13.92
36-
VERSION_HARFBUZZ=2.6.1
37+
VERSION_HARFBUZZ=2.6.4
3738
VERSION_PIXMAN=0.38.4
38-
VERSION_CAIRO=1.17.2
39-
VERSION_FRIBIDI=1.0.5
40-
VERSION_PANGO=1.42.4
39+
VERSION_CAIRO=1.16.0
40+
VERSION_FRIBIDI=1.0.7
41+
VERSION_PANGO=1.44.7
4142
VERSION_CROCO=0.6.13
42-
VERSION_SVG=2.45.5
43+
VERSION_SVG=2.46.4
4344
VERSION_GIF=5.1.4
4445

45-
# Least out-of-sync Sourceforge mirror
46-
SOURCEFORGE_BASE_URL=https://netix.dl.sourceforge.net/project/
47-
4846
# Remove patch version component
4947
without_patch() {
5048
echo "$1" | sed "s/\.[0-9]*$//"
@@ -61,7 +59,7 @@ version_latest() {
6159
}
6260
version_latest "zlib" "$VERSION_ZLIB" "5303"
6361
version_latest "ffi" "$VERSION_FFI" "1611"
64-
#version_latest "glib" "$VERSION_GLIB" "10024" # latest version requires meson instead of autotools
62+
version_latest "glib" "$VERSION_GLIB" "10024"
6563
version_latest "xml2" "$VERSION_XML2" "1783"
6664
version_latest "gsf" "$VERSION_GSF" "1980"
6765
version_latest "exif" "$VERSION_EXIF" "1607"
@@ -70,19 +68,19 @@ version_latest "jpeg" "$VERSION_JPEG" "1648"
7068
version_latest "png" "$VERSION_PNG16" "1705"
7169
version_latest "webp" "$VERSION_WEBP" "1761"
7270
version_latest "tiff" "$VERSION_TIFF" "13521"
73-
#version_latest "orc" "$VERSION_ORC" "2573" # pin to 0.4.29 until 0.4.31 is available
71+
version_latest "orc" "$VERSION_ORC" "2573"
7472
version_latest "gettext" "$VERSION_GETTEXT" "898"
75-
#version_latest "gdkpixbuf" "$VERSION_GDKPIXBUF" "9533" # latest version requires meson instead of autotools
73+
version_latest "gdkpixbuf" "$VERSION_GDKPIXBUF" "9533"
7674
version_latest "freetype" "$VERSION_FREETYPE" "854"
7775
version_latest "expat" "$VERSION_EXPAT" "770"
7876
version_latest "fontconfig" "$VERSION_FONTCONFIG" "827"
7977
version_latest "harfbuzz" "$VERSION_HARFBUZZ" "1299"
8078
version_latest "pixman" "$VERSION_PIXMAN" "3648"
8179
#version_latest "cairo" "$VERSION_CAIRO" "247" # latest version in release monitoring does not exist
8280
version_latest "fribidi" "$VERSION_FRIBIDI" "857"
83-
#version_latest "pango" "$VERSION_PANGO" "11783" # latest version requires meson instead of autotools
81+
version_latest "pango" "$VERSION_PANGO" "11783"
8482
version_latest "croco" "$VERSION_CROCO" "11787"
85-
#version_latest "svg" "$VERSION_SVG" "5420" latest version fails to link against latest cairo
83+
#version_latest "svg" "$VERSION_SVG" "5420" # v2.47.0+ requires rust>=1.36 but rustup does not support musl
8684
#version_latest "gif" "$VERSION_GIF" "1158" # v5.1.5+ provides a Makefile only so will require custom cross-compilation setup
8785
if [ "$ALL_AT_VERSION_LATEST" = "false" ]; then exit 1; fi
8886

@@ -96,17 +94,18 @@ case ${PLATFORM} in *musl*)
9694
make install-strip
9795
rm ${TARGET}/include/gettext-po.h
9896
rm -rf ${TARGET}/lib/*gettext*
97+
export LDFLAGS="-L${TARGET}/lib -lintl -Wl,-rpath='\$ORIGIN'"
9998
esac
10099

101100
mkdir ${DEPS}/zlib
102-
curl -Ls http://zlib.net/zlib-${VERSION_ZLIB}.tar.xz | tar xJC ${DEPS}/zlib --strip-components=1
101+
curl -Ls https://zlib.net/zlib-${VERSION_ZLIB}.tar.xz | tar xJC ${DEPS}/zlib --strip-components=1
103102
cd ${DEPS}/zlib
104103
./configure --prefix=${TARGET} --uname=linux
105104
make install
106105
rm ${TARGET}/lib/libz.a
107106

108107
mkdir ${DEPS}/ffi
109-
curl -Ls ftp://sourceware.org/pub/libffi/libffi-${VERSION_FFI}.tar.gz | tar xzC ${DEPS}/ffi --strip-components=1
108+
curl -Ls https://sourceware.org/pub/libffi/libffi-${VERSION_FFI}.tar.gz | tar xzC ${DEPS}/ffi --strip-components=1
110109
cd ${DEPS}/ffi
111110
sed -i 's/@toolexeclibdir@/$(libdir)/g' Makefile.in
112111
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking --disable-builddir
@@ -115,18 +114,17 @@ make install-strip
115114
mkdir ${DEPS}/glib
116115
curl -Lks https://download.gnome.org/sources/glib/$(without_patch $VERSION_GLIB)/glib-${VERSION_GLIB}.tar.xz | tar xJC ${DEPS}/glib --strip-components=1
117116
cd ${DEPS}/glib
118-
echo glib_cv_stack_grows=no >>glib.cache
119-
echo glib_cv_uscore=no >>glib.cache
120-
./configure --cache-file=glib.cache --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking \
121-
--with-pcre=internal --disable-libmount
122-
make install-strip
117+
CFLAGS= CXXFLAGS= meson setup _build --buildtype=release --strip --libdir=lib --prefix=${TARGET} ${MESON} \
118+
-Dinternal_pcre=true -Dlibmount=false
119+
ninja -C _build
120+
ninja -C _build install
123121

124122
mkdir ${DEPS}/xml2
125123
curl -Ls http://xmlsoft.org/sources/libxml2-${VERSION_XML2}.tar.gz | tar xzC ${DEPS}/xml2 --strip-components=1
126124
cd ${DEPS}/xml2
127125
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking \
128126
--without-python --without-debug --without-docbook --without-ftp --without-html --without-legacy \
129-
--without-pattern --without-push --without-regexps --without-schemas --without-schematron --with-zlib=${TARGET}
127+
--without-push --without-schematron --with-zlib=${TARGET}
130128
make install-strip
131129

132130
mkdir ${DEPS}/gsf
@@ -137,14 +135,14 @@ cd ${DEPS}/gsf
137135
make install-strip
138136

139137
mkdir ${DEPS}/exif
140-
curl -Ls ${SOURCEFORGE_BASE_URL}libexif/libexif/${VERSION_EXIF}/libexif-${VERSION_EXIF}.tar.bz2 | tar xjC ${DEPS}/exif --strip-components=1
138+
curl -Ls https://sourceforge.mirrorservice.org/l/li/libexif/libexif/${VERSION_EXIF}/libexif-${VERSION_EXIF}.tar.bz2 | tar xjC ${DEPS}/exif --strip-components=1
141139
cd ${DEPS}/exif
142140
autoreconf -fiv
143141
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking
144142
make install-strip
145143

146144
mkdir ${DEPS}/lcms2
147-
curl -Ls ${SOURCEFORGE_BASE_URL}lcms/lcms/${VERSION_LCMS2}/lcms2-${VERSION_LCMS2}.tar.gz | tar xzC ${DEPS}/lcms2 --strip-components=1
145+
curl -Ls https://sourceforge.mirrorservice.org/l/lc/lcms/lcms/${VERSION_LCMS2}/lcms2-${VERSION_LCMS2}.tar.gz | tar xzC ${DEPS}/lcms2 --strip-components=1
148146
cd ${DEPS}/lcms2
149147
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking
150148
make install-strip
@@ -157,56 +155,53 @@ cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=/root/Toolchain.cmake -DCMAKE_IN
157155
make install/strip
158156

159157
mkdir ${DEPS}/png16
160-
curl -Ls ${SOURCEFORGE_BASE_URL}libpng/libpng16/${VERSION_PNG16}/libpng-${VERSION_PNG16}.tar.xz | tar xJC ${DEPS}/png16 --strip-components=1
158+
curl -Ls https://sourceforge.mirrorservice.org/l/li/libpng/libpng16/${VERSION_PNG16}/libpng-${VERSION_PNG16}.tar.xz | tar xJC ${DEPS}/png16 --strip-components=1
161159
cd ${DEPS}/png16
162160
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking
163161
make install-strip
164162

165163
mkdir ${DEPS}/webp
166-
curl -Ls http://downloads.webmproject.org/releases/webp/libwebp-${VERSION_WEBP}.tar.gz | tar xzC ${DEPS}/webp --strip-components=1
164+
curl -Ls https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${VERSION_WEBP}.tar.gz | tar xzC ${DEPS}/webp --strip-components=1
167165
cd ${DEPS}/webp
168166
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking \
169167
--disable-neon --enable-libwebpmux
170168
make install-strip
171169

172170
mkdir ${DEPS}/tiff
173-
curl -Ls http://download.osgeo.org/libtiff/tiff-${VERSION_TIFF}.tar.gz | tar xzC ${DEPS}/tiff --strip-components=1
171+
curl -Ls https://download.osgeo.org/libtiff/tiff-${VERSION_TIFF}.tar.gz | tar xzC ${DEPS}/tiff --strip-components=1
174172
cd ${DEPS}/tiff
175173
if [ -n "${CHOST}" ]; then autoreconf -fiv; fi
176174
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking --disable-mdi --disable-pixarlog --disable-cxx
177175
make install-strip
178176

179177
mkdir ${DEPS}/orc
180-
curl -Ls http://gstreamer.freedesktop.org/data/src/orc/orc-${VERSION_ORC}.tar.xz | tar xJC ${DEPS}/orc --strip-components=1
178+
curl -Ls https://gstreamer.freedesktop.org/data/src/orc/orc-${VERSION_ORC}.tar.xz | tar xJC ${DEPS}/orc --strip-components=1
181179
cd ${DEPS}/orc
182-
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking
183-
make install-strip
184-
cd ${TARGET}/lib
185-
rm -rf liborc-test-*
180+
CFLAGS= CXXFLAGS= meson setup _build --buildtype=release --strip --libdir=lib --prefix=${TARGET} ${MESON} \
181+
-Dorc-test=disabled -Dbenchmarks=disabled -Dexamples=disabled -Dgtk_doc=disabled -Dtests=disabled -Dtools=disabled
182+
ninja -C _build
183+
ninja -C _build install
186184

187185
mkdir ${DEPS}/gdkpixbuf
188186
curl -Lks https://download.gnome.org/sources/gdk-pixbuf/$(without_patch $VERSION_GDKPIXBUF)/gdk-pixbuf-${VERSION_GDKPIXBUF}.tar.xz | tar xJC ${DEPS}/gdkpixbuf --strip-components=1
189187
cd ${DEPS}/gdkpixbuf
190-
touch gdk-pixbuf/loaders.cache
191-
LD_LIBRARY_PATH=${TARGET}/lib \
192-
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking \
193-
--disable-introspection --disable-modules \
194-
--without-libtiff --without-gdiplus --with-included-loaders=png,jpeg
195-
make install-strip
188+
CFLAGS= CXXFLAGS= meson setup _build --buildtype=release --strip --libdir=lib --prefix=${TARGET} ${MESON} \
189+
-Dtiff=false -Dx11=false -Dgir=false -Dinstalled_tests=false -Dgio_sniffing=false -Dman=false -Dbuiltin_loaders=png,jpeg
190+
ninja -C _build
191+
ninja -C _build install
196192

197193
mkdir ${DEPS}/freetype
198-
curl -Ls ${SOURCEFORGE_BASE_URL}freetype/freetype2/${VERSION_FREETYPE}/freetype-${VERSION_FREETYPE}.tar.gz | tar xzC ${DEPS}/freetype --strip-components=1
194+
curl -Ls https://download.savannah.gnu.org/releases/freetype/freetype-${VERSION_FREETYPE}.tar.xz | tar xJC ${DEPS}/freetype --strip-components=1
199195
cd ${DEPS}/freetype
200196
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking \
201197
--without-bzip2
202198
make install
203199

204200
mkdir ${DEPS}/expat
205-
curl -Ls ${SOURCEFORGE_BASE_URL}expat/expat/${VERSION_EXPAT}/expat-${VERSION_EXPAT}.tar.bz2 | tar xjC ${DEPS}/expat --strip-components=1
201+
curl -Ls https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-${VERSION_EXPAT}.tar.xz | tar xJC ${DEPS}/expat --strip-components=1
206202
cd ${DEPS}/expat
207-
sed -i "s/getrandom/ignore_getrandom/g" configure # https://github.com/libexpat/libexpat/issues/239
208203
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static \
209-
--disable-dependency-tracking --without-xmlwf --without-docbook
204+
--disable-dependency-tracking --without-xmlwf --without-docbook --without-getrandom --without-sys-getrandom
210205
make install
211206

212207
mkdir ${DEPS}/fontconfig
@@ -225,17 +220,18 @@ make install-strip
225220
rm ${TARGET}/lib/libharfbuzz-subset*
226221

227222
mkdir ${DEPS}/pixman
228-
curl -Ls http://cairographics.org/releases/pixman-${VERSION_PIXMAN}.tar.gz | tar xzC ${DEPS}/pixman --strip-components=1
223+
curl -Ls https://cairographics.org/releases/pixman-${VERSION_PIXMAN}.tar.gz | tar xzC ${DEPS}/pixman --strip-components=1
229224
cd ${DEPS}/pixman
230-
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking --disable-libpng --disable-arm-iwmmxt
225+
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking \
226+
--disable-libpng --disable-arm-iwmmxt
231227
make install-strip
232228

233229
mkdir ${DEPS}/cairo
234-
curl -Ls http://cairographics.org/snapshots/cairo-${VERSION_CAIRO}.tar.xz | tar xJC ${DEPS}/cairo --strip-components=1
230+
curl -Ls https://cairographics.org/releases/cairo-${VERSION_CAIRO}.tar.xz | tar xJC ${DEPS}/cairo --strip-components=1
235231
cd ${DEPS}/cairo
236232
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking \
237233
--disable-xlib --disable-xcb --disable-quartz --disable-win32 --disable-egl --disable-glx --disable-wgl \
238-
--disable-script --disable-ps --disable-trace --disable-interpreter
234+
--disable-ps --disable-trace --disable-interpreter
239235
make install-strip
240236

241237
mkdir ${DEPS}/fribidi
@@ -248,9 +244,10 @@ make install-strip
248244
mkdir ${DEPS}/pango
249245
curl -Lks https://download.gnome.org/sources/pango/$(without_patch $VERSION_PANGO)/pango-${VERSION_PANGO}.tar.xz | tar xJC ${DEPS}/pango --strip-components=1
250246
cd ${DEPS}/pango
251-
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking \
252-
--without-gtk-doc
253-
make install-strip
247+
CFLAGS= CXXFLAGS= meson setup _build --buildtype=release --strip --libdir=lib --prefix=${TARGET} ${MESON} \
248+
-Dgtk_doc=false -Dintrospection=false
249+
ninja -C _build
250+
ninja -C _build install
254251

255252
mkdir ${DEPS}/croco
256253
curl -Lks https://download.gnome.org/sources/libcroco/$(without_patch $VERSION_CROCO)/libcroco-${VERSION_CROCO}.tar.xz | tar xJC ${DEPS}/croco --strip-components=1
@@ -262,15 +259,15 @@ mkdir ${DEPS}/svg
262259
curl -Lks https://download.gnome.org/sources/librsvg/$(without_patch $VERSION_SVG)/librsvg-${VERSION_SVG}.tar.xz | tar xJC ${DEPS}/svg --strip-components=1
263260
cd ${DEPS}/svg
264261
# Optimise Rust code for binary size
265-
sed -i "s/debug = true/debug = false\ncodegen-units = 1\nincremental = false\npanic = \"abort\"\nopt-level = ${RUST_OPT_LEVEL:-\"s\"}/" Cargo.toml
262+
sed -i "s/debug = true/debug = false\ncodegen-units = 1\nincremental = false\npanic = \"abort\"\nopt-level = \"s\"/" Cargo.toml
266263
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking \
267264
--disable-introspection --disable-tools --disable-pixbuf-loader
268265
make install-strip
269266
# Clear executable bit from librsvg shared library for WSL support
270267
execstack -c ${TARGET}/lib/librsvg-2.so || true
271268

272269
mkdir ${DEPS}/gif
273-
curl -Ls ${SOURCEFORGE_BASE_URL}giflib/giflib-${VERSION_GIF}.tar.gz | tar xzC ${DEPS}/gif --strip-components=1
270+
curl -Ls https://sourceforge.mirrorservice.org/g/gi/giflib/giflib-${VERSION_GIF}.tar.gz | tar xzC ${DEPS}/gif --strip-components=1
274271
cd ${DEPS}/gif
275272
./configure --host=${CHOST} --prefix=${TARGET} --enable-shared --disable-static --disable-dependency-tracking
276273
make install-strip

0 commit comments

Comments
 (0)