From 2b12ab1fe58e57358edd0c8e9b7bfb1100b21381 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 1 May 2025 12:24:59 -0600 Subject: [PATCH] gdk-pixbuf: convert to toml, compile dynamically --- recipes/dev/gdk-pixbuf/recipe.sh | 70 ------------------------------ recipes/dev/gdk-pixbuf/recipe.toml | 67 ++++++++++++++++++++++++++++ recipes/dev/gdk-pixbuf/redox.patch | 17 ++++++++ 3 files changed, 84 insertions(+), 70 deletions(-) delete mode 100644 recipes/dev/gdk-pixbuf/recipe.sh create mode 100644 recipes/dev/gdk-pixbuf/recipe.toml create mode 100644 recipes/dev/gdk-pixbuf/redox.patch diff --git a/recipes/dev/gdk-pixbuf/recipe.sh b/recipes/dev/gdk-pixbuf/recipe.sh deleted file mode 100644 index cc6f16773..000000000 --- a/recipes/dev/gdk-pixbuf/recipe.sh +++ /dev/null @@ -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 -} diff --git a/recipes/dev/gdk-pixbuf/recipe.toml b/recipes/dev/gdk-pixbuf/recipe.toml new file mode 100644 index 000000000..a79e37b27 --- /dev/null +++ b/recipes/dev/gdk-pixbuf/recipe.toml @@ -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 +""" \ No newline at end of file diff --git a/recipes/dev/gdk-pixbuf/redox.patch b/recipes/dev/gdk-pixbuf/redox.patch new file mode 100644 index 000000000..ecedea689 --- /dev/null +++ b/recipes/dev/gdk-pixbuf/redox.patch @@ -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