gdk-pixbuf: convert to toml, compile dynamically

This commit is contained in:
Jeremy Soller 2025-05-01 12:24:59 -06:00
parent 5d506d22e0
commit 2b12ab1fe5
No known key found for this signature in database
GPG Key ID: 670FDFB5428E05CA
3 changed files with 84 additions and 70 deletions

View File

@ -1,70 +0,0 @@
VERSION="2.38.1"
TAR="https://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/${VERSION%.*}/gdk-pixbuf-${VERSION}.tar.xz"
BUILD_DEPENDS=(gettext glib libffi libiconv libjpeg libpng pcre shared-mime-info zlib)
function recipe_version {
echo "$VERSION"
skip=1
}
function recipe_build {
sysroot="$(realpath ../sysroot)"
export LDFLAGS="-static"
# TODO: Fix this annoying shite
echo "[binaries]" > cross_file.txt
echo "c = '${CC}'" >> cross_file.txt
echo "cpp = '${CXX}'" >> cross_file.txt
echo "ar = '${AR}'" >> cross_file.txt
echo "strip = '${STRIP}'" >> cross_file.txt
echo "pkgconfig = '${PKG_CONFIG}'" >> cross_file.txt
echo "[host_machine]" >> cross_file.txt
echo "system = 'redox'" >> cross_file.txt
echo "cpu_family = '$(echo "${TARGET}" | cut -d - -f1)'" >> cross_file.txt
echo "cpu = '$(echo "${TARGET}" | cut -d - -f1)'" >> cross_file.txt
echo "endian = 'little'" >> cross_file.txt
echo "[paths]" >> cross_file.txt
echo "prefix = '${sysroot}'" >> cross_file.txt
echo "libdir = 'lib'" >> cross_file.txt
echo "bindir = 'bin'" >> cross_file.txt
unset AR
unset AS
unset CC
unset CXX
unset LD
unset NM
unset OBJCOPY
unset OBJDUMP
unset PKG_CONFIG
unset RANLIB
unset READELF
unset STRIP
meson . _build \
--cross-file cross_file.txt \
--buildtype release \
--strip \
-Ddefault_library=static \
-Dprefix=/ \
-Dlibdir=lib \
-Dbuiltin_loaders=all \
-Dgir=false \
-Dx11=false
ninja -C _build -v
skip=1
}
function recipe_clean {
"$REDOX_MAKE" clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
DESTDIR="$dest" ninja -C _build -v install
rm -f "$dest/lib/"*.la
skip=1
}

View File

@ -0,0 +1,67 @@
[source]
tar = "https://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.38/gdk-pixbuf-2.38.1.tar.xz"
blake3 = "131cf94d458bf353e42993714477e746fe3f1e4d39cb4acd4c82a5d5e341679b"
patches = ["redox.patch"]
[build]
dependencies = [
"gettext",
"glib",
"libffi",
"libiconv",
"libjpeg",
"libpng",
"pcre",
"shared-mime-info",
"zlib",
]
template = "custom"
script = """
DYNAMIC_INIT
# TODO: Fix this annoying shite
echo "[binaries]" > cross_file.txt
echo "c = '${CC}'" >> cross_file.txt
echo "cpp = '${CXX}'" >> cross_file.txt
echo "ar = '${AR}'" >> cross_file.txt
echo "strip = '${STRIP}'" >> cross_file.txt
echo "pkgconfig = '${PKG_CONFIG}'" >> cross_file.txt
echo "[host_machine]" >> cross_file.txt
echo "system = 'redox'" >> cross_file.txt
echo "cpu_family = '$(echo "${TARGET}" | cut -d - -f1)'" >> cross_file.txt
echo "cpu = '$(echo "${TARGET}" | cut -d - -f1)'" >> cross_file.txt
echo "endian = 'little'" >> cross_file.txt
echo "[paths]" >> cross_file.txt
echo "prefix = '${COOKBOOK_SYSROOT}'" >> cross_file.txt
echo "libdir = 'lib'" >> cross_file.txt
echo "bindir = 'bin'" >> cross_file.txt
unset AR
unset AS
unset CC
unset CXX
unset LD
unset NM
unset OBJCOPY
unset OBJDUMP
unset PKG_CONFIG
unset RANLIB
unset READELF
unset STRIP
meson setup "${COOKBOOK_SOURCE}" . \
--cross-file cross_file.txt \
--buildtype release \
--strip \
-Ddefault_library=shared \
-Dprefix=/ \
-Dlibdir=lib \
-Dbuiltin_loaders=all \
-Dgir=false \
-Dinstalled_tests=false \
-Dx11=false
ninja -v
DESTDIR="${COOKBOOK_STAGE}" ninja -v install
"""

View File

@ -0,0 +1,17 @@
diff -ruwN gdk-pixbuf-2.38.1/gdk-pixbuf/meson.build source/gdk-pixbuf/meson.build
--- gdk-pixbuf-2.38.1/gdk-pixbuf/meson.build 2019-02-28 09:22:57.000000000 -0700
+++ source/gdk-pixbuf/meson.build 2025-05-01 12:23:46.853375624 -0600
@@ -290,9 +290,10 @@
endif
gdkpixbuf_bin = [
- [ 'gdk-pixbuf-csource' ],
- [ 'gdk-pixbuf-pixdata' ],
- [ 'gdk-pixbuf-query-loaders', [ 'queryloaders.c' ] ],
+# Broken compilation on Redox
+# [ 'gdk-pixbuf-csource' ],
+# [ 'gdk-pixbuf-pixdata' ],
+# [ 'gdk-pixbuf-query-loaders', [ 'queryloaders.c' ] ],
]
foreach bin: gdkpixbuf_bin