From 6d505a649c2bdfae8121c76094196f6cf3d9e96f Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sat, 23 Aug 2025 18:33:13 +0700 Subject: [PATCH] Push many recipes to be dynamically linked --- recipes/demos/gears/recipe.toml | 10 ++++++---- recipes/demos/glutin/recipe.toml | 5 ++--- recipes/demos/osdemo/recipe.toml | 2 +- recipes/demos/sdl2-gears/recipe.toml | 5 ++++- recipes/dev/llvm18/recipe.toml | 1 + recipes/emulators/dosbox/recipe.toml | 2 +- recipes/emulators/scummvm/recipe.toml | 2 +- recipes/games/neverball/recipe.toml | 1 - recipes/games/spacecadetpinball/recipe.toml | 9 ++------- recipes/gui/orbital/recipe.toml | 2 -- recipes/libs/atk/recipe.toml | 2 +- recipes/libs/ffmpeg6/recipe.toml | 6 +++++- recipes/libs/libogg/recipe.toml | 13 ++----------- recipes/libs/libpng/recipe.toml | 2 +- recipes/libs/libvorbis/recipe.toml | 13 ++----------- recipes/libs/ncurses/recipe.toml | 1 + recipes/libs/sdl1-mixer/recipe.toml | 1 + recipes/libs/sdl2-gfx/recipe.toml | 2 +- recipes/libs/sdl2-mixer/recipe.toml | 1 - recipes/net/curl/recipe.toml | 16 +++++----------- recipes/tests/vttest/recipe.toml | 2 +- recipes/tools/nano/recipe.toml | 2 +- recipes/wip/libs/other/libtheora/recipe.toml | 2 +- 23 files changed, 40 insertions(+), 62 deletions(-) diff --git a/recipes/demos/gears/recipe.toml b/recipes/demos/gears/recipe.toml index d74ce80f1..b736d6b4f 100644 --- a/recipes/demos/gears/recipe.toml +++ b/recipes/demos/gears/recipe.toml @@ -8,9 +8,11 @@ dependencies=[ ] template = "custom" script = """ -set -x -"${CXX}" -O2 -I "${COOKBOOK_SYSROOT}/usr/include" -L "${COOKBOOK_SYSROOT}/usr/lib" "${COOKBOOK_RECIPE}/gears.c" -o gears -static -lorbital $("${PKG_CONFIG}" --libs glu) -lz -set +x +DYNAMIC_INIT + +${CXX} -O2 -I "${COOKBOOK_SYSROOT}/usr/include" \ + $LDFLAGS "${COOKBOOK_RECIPE}/gears.c" \ + -o gears -lorbital $("${PKG_CONFIG}" --libs glu) -lz mkdir -pv "${COOKBOOK_STAGE}/usr/bin" cp -v "gears" "${COOKBOOK_STAGE}/usr/bin/gears" -""" \ No newline at end of file +""" diff --git a/recipes/demos/glutin/recipe.toml b/recipes/demos/glutin/recipe.toml index 1d3a416e2..67dd944a9 100644 --- a/recipes/demos/glutin/recipe.toml +++ b/recipes/demos/glutin/recipe.toml @@ -11,6 +11,7 @@ dependencies = [ "zlib" ] script = """ +DYNAMIC_INIT EXAMPLES=( window ) @@ -21,9 +22,7 @@ do --release \ --manifest-path "${COOKBOOK_SOURCE}/glutin_examples/Cargo.toml" \ --example "${example}" \ - -- \ - -L "${COOKBOK_SYSROOT}/lib" \ - -C link-args="-Wl,-Bstatic $("${TARGET}-pkg-config" --libs osmesa) -lz -lstdc++ -lc -lgcc" + -- -C link-args="$LDFLAGS $("${TARGET}-pkg-config" --libs osmesa) -lz -lstdc++ -lc -lgcc" mkdir -pv "${COOKBOOK_STAGE}/bin" cp -v "target/${TARGET}/release/examples/${example}" "${COOKBOOK_STAGE}/bin/glutin_${example}" done diff --git a/recipes/demos/osdemo/recipe.toml b/recipes/demos/osdemo/recipe.toml index f400a6f30..3fd27e849 100644 --- a/recipes/demos/osdemo/recipe.toml +++ b/recipes/demos/osdemo/recipe.toml @@ -9,7 +9,7 @@ dependencies = [ ] script = """ cp "${COOKBOOK_SOURCE}/../osdemo.c" ./osdemo.c -"${CXX}" -O2 -I "${COOKBOOK_SYSROOT}/include" -L "${COOKBOOK_SYSROOT}/lib" osdemo.c -o osdemo -static -lorbital $("${PKG_CONFIG}" --libs glu) -lz +${CXX} -O2 -I "${COOKBOOK_SYSROOT}/include" -L "${COOKBOOK_SYSROOT}/lib" osdemo.c -o osdemo -static -lorbital $("${PKG_CONFIG}" --libs glu) -lz mkdir -pv "${COOKBOOK_STAGE}/usr/bin" cp -v "osdemo" "${COOKBOOK_STAGE}/usr/bin/osdemo" """ diff --git a/recipes/demos/sdl2-gears/recipe.toml b/recipes/demos/sdl2-gears/recipe.toml index 491270669..7c582e986 100644 --- a/recipes/demos/sdl2-gears/recipe.toml +++ b/recipes/demos/sdl2-gears/recipe.toml @@ -16,9 +16,12 @@ dependencies = [ "zlib" ] script = """ +DYNAMIC_INIT cp "${COOKBOOK_SOURCE}/../gears.c" ./gears.c rsync -av --delete --exclude='.git' "${COOKBOOK_SOURCE}/../assets" ./assets -"${CXX}" -O2 -I "${COOKBOOK_SYSROOT}/include" -L "${COOKBOOK_SYSROOT}/lib" gears.c -o sdl2_gears -dynamic -lSDL2_image -lSDL2_mixer -lSDL2_ttf -lSDL2 -lorbital $("${PKG_CONFIG}" --libs osmesa) -lfreetype -lpng -ljpeg -lvorbisfile -lvorbis -logg -lz +${CXX} -O2 -I "${COOKBOOK_SYSROOT}/include" $LDFLAGS gears.c -o sdl2_gears \ + -dynamic -lSDL2_image -lSDL2_mixer -lSDL2_ttf -lSDL2 -lorbital \ + $("${PKG_CONFIG}" --libs osmesa) -lfreetype -lpng -ljpeg -lvorbisfile -lvorbis -logg -lz rm -rf "${COOKBOOK_STAGE}/usr/games/sdl2_gears" mkdir -pv "${COOKBOOK_STAGE}/usr/games/sdl2_gears" cp -v "sdl2_gears" "${COOKBOOK_STAGE}/usr/games/sdl2_gears/sdl2_gears" diff --git a/recipes/dev/llvm18/recipe.toml b/recipes/dev/llvm18/recipe.toml index d6cd8458a..938511e0b 100644 --- a/recipes/dev/llvm18/recipe.toml +++ b/recipes/dev/llvm18/recipe.toml @@ -2,6 +2,7 @@ git = "https://gitlab.redox-os.org/redox-os/llvm-project.git" upstream = "https://github.com/rust-lang/llvm-project.git" branch = "redox-2024-05-11" +shallow_clone = true [build] template = "custom" diff --git a/recipes/emulators/dosbox/recipe.toml b/recipes/emulators/dosbox/recipe.toml index e3cf69f1d..c93ec9bd7 100644 --- a/recipes/emulators/dosbox/recipe.toml +++ b/recipes/emulators/dosbox/recipe.toml @@ -4,7 +4,7 @@ blake3 = "8bc50ffdba20579fb3080a0dca32cb939c8a3c19259aed026482c6ac069b0007" patches = ["01_redox.patch"] script = """ ./autogen.sh -wget -O config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false" +GNU_CONFIG_GET config.sub """ [build] diff --git a/recipes/emulators/scummvm/recipe.toml b/recipes/emulators/scummvm/recipe.toml index 0ec2f0052..db6cd35cb 100644 --- a/recipes/emulators/scummvm/recipe.toml +++ b/recipes/emulators/scummvm/recipe.toml @@ -3,7 +3,7 @@ tar = "https://downloads.scummvm.org/frs/scummvm/2.0.0/scummvm-2.0.0.tar.xz" blake3 = "02e6791fd43ad3cb4238c07d23350ca1459a0f692689e585dba1d46648f64327" patches = ["redox.patch"] script = """ -wget -O config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false" +GNU_CONFIG_GET config.sub """ [build] diff --git a/recipes/games/neverball/recipe.toml b/recipes/games/neverball/recipe.toml index c621dcff9..880c8b0c7 100644 --- a/recipes/games/neverball/recipe.toml +++ b/recipes/games/neverball/recipe.toml @@ -29,7 +29,6 @@ env -i \ PKG_CONFIG="pkg-config" \ "${COOKBOOK_MAKE}" -j"${COOKBOOK_MAKE_JOBS}" ENABLE_FS=stdio mapc sols -export LDFLAGS+="-L${COOKBOOK_SYSROOT}/lib -z noexecstack" "${COOKBOOK_MAKE}" -j"${COOKBOOK_MAKE_JOBS}" ENABLE_FS=stdio ENABLE_NLS=0 clean-src "${COOKBOOK_MAKE}" -j"${COOKBOOK_MAKE_JOBS}" ENABLE_FS=stdio ENABLE_NLS=0 neverball neverputt diff --git a/recipes/games/spacecadetpinball/recipe.toml b/recipes/games/spacecadetpinball/recipe.toml index 384f78529..d0d3857e1 100644 --- a/recipes/games/spacecadetpinball/recipe.toml +++ b/recipes/games/spacecadetpinball/recipe.toml @@ -16,17 +16,12 @@ dependencies = [ "zlib", ] script = """ -COOKBOOK_CONFIGURE="cmake" +DYNAMIC_INIT COOKBOOK_CONFIGURE_FLAGS=( - -DCMAKE_VERBOSE_MAKEFILE=On - -DCMAKE_CROSSCOMPILING=True - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX="/usr" -DSDL2_INCLUDE_DIR="${COOKBOOK_SYSROOT}/include/SDL2" -DSDL2_LIBRARY="-lSDL2_mixer -lvorbisfile -lvorbis -logg -lSDL2 -lorbital $("${TARGET}-pkg-config" --libs osmesa)" -DSDL2_MIXER_INCLUDE_DIR="${COOKBOOK_SYSROOT}/include/SDL2" -DSDL2_MIXER_LIBRARY="SDL2_mixer" - "${COOKBOOK_SOURCE}" ) -cookbook_configure +cookbook_cmake """ diff --git a/recipes/gui/orbital/recipe.toml b/recipes/gui/orbital/recipe.toml index 0ae660fd4..b1a4a819e 100644 --- a/recipes/gui/orbital/recipe.toml +++ b/recipes/gui/orbital/recipe.toml @@ -1,5 +1,3 @@ -[source] -git = "https://gitlab.redox-os.org/redox-os/orbital.git" [build] template = "cargo" diff --git a/recipes/libs/atk/recipe.toml b/recipes/libs/atk/recipe.toml index a0d1185fe..6ad310a1d 100644 --- a/recipes/libs/atk/recipe.toml +++ b/recipes/libs/atk/recipe.toml @@ -2,7 +2,7 @@ tar = "https://download.gnome.org/sources/atk/2.38/atk-2.38.0.tar.xz" blake3 = "cbc1b7ba03009ee5cc0e646d8a86117e0d65bf8d105f2e8714fbde0299a8012e" script = """ -wget -O config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false" +GNU_CONFIG_GET config.sub """ [build] diff --git a/recipes/libs/ffmpeg6/recipe.toml b/recipes/libs/ffmpeg6/recipe.toml index b370ea4f0..3808c2f91 100644 --- a/recipes/libs/ffmpeg6/recipe.toml +++ b/recipes/libs/ffmpeg6/recipe.toml @@ -16,14 +16,18 @@ dependencies = [ "zlib", ] script = """ +DYNAMIC_INIT + ARCH="${TARGET%%-*}" COOKBOOK_CONFIGURE_FLAGS=( --enable-cross-compile --target-os=redox --arch="${ARCH}" --cross_prefix="${TARGET}-" - --prefix=/ + --prefix=/usr --disable-doc + --enable-shared + --disable-static --disable-network --enable-sdl2 --enable-zlib diff --git a/recipes/libs/libogg/recipe.toml b/recipes/libs/libogg/recipe.toml index f0dcf4064..4d35c4c05 100644 --- a/recipes/libs/libogg/recipe.toml +++ b/recipes/libs/libogg/recipe.toml @@ -6,18 +6,9 @@ patches = [ ] script = """ DYNAMIC_INIT +GNU_CONFIG_GET config.sub autotools_recursive_regenerate """ [build] -template = "custom" -script = """ -DYNAMIC_INIT -COOKBOOK_CONFIGURE_FLAGS=( - --host="${GNU_TARGET}" - --prefix="/usr" - --enable-shared - --enable-static -) -cookbook_configure -""" +template = "configure" diff --git a/recipes/libs/libpng/recipe.toml b/recipes/libs/libpng/recipe.toml index 3fedf1c51..d516a8571 100644 --- a/recipes/libs/libpng/recipe.toml +++ b/recipes/libs/libpng/recipe.toml @@ -4,7 +4,7 @@ blake3 = "36f4bbb48c70975116b00ab0cff577931b96f703b2774ac3b33131d001419435" script = """ DYNAMIC_INIT chmod +w config.sub -wget -O config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false" +GNU_CONFIG_GET config.sub autotools_recursive_regenerate """ diff --git a/recipes/libs/libvorbis/recipe.toml b/recipes/libs/libvorbis/recipe.toml index b3908c09e..7cbeca05c 100644 --- a/recipes/libs/libvorbis/recipe.toml +++ b/recipes/libs/libvorbis/recipe.toml @@ -3,21 +3,12 @@ tar = "https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.t blake3 = "c67f3f74ec26d93a5571c4404a64eb6e6587d7d77b46b552f7b410f5bc5b1f03" script = """ DYNAMIC_INIT +GNU_CONFIG_GET config.sub autotools_recursive_regenerate """ [build] -template = "custom" +template = "configure" dependencies = [ "libogg" ] -script = """ -DYNAMIC_INIT -COOKBOOK_CONFIGURE_FLAGS=( - --host="${GNU_TARGET}" - --prefix="/usr" - --enable-shared - --enable-static -) -cookbook_configure -""" diff --git a/recipes/libs/ncurses/recipe.toml b/recipes/libs/ncurses/recipe.toml index ed678dc3f..ff2e30688 100644 --- a/recipes/libs/ncurses/recipe.toml +++ b/recipes/libs/ncurses/recipe.toml @@ -5,6 +5,7 @@ blake3 = "0d1c9fdf53c0ca4bd66ba707d49a079d2dd6f5a960cdec74a56e29952c4ffe73" [build] template = "custom" script = """ +DYNAMIC_INIT COOKBOOK_CONFIGURE_FLAGS+=( --disable-db-install --disable-stripping diff --git a/recipes/libs/sdl1-mixer/recipe.toml b/recipes/libs/sdl1-mixer/recipe.toml index 3e19795a5..59755cff9 100644 --- a/recipes/libs/sdl1-mixer/recipe.toml +++ b/recipes/libs/sdl1-mixer/recipe.toml @@ -15,6 +15,7 @@ dependencies = [ ] template = "custom" script = """ +DYNAMIC_INIT export LIBS="-lvorbis -logg" COOKBOOK_CONFIGURE_FLAGS+=( --enable-music-ogg diff --git a/recipes/libs/sdl2-gfx/recipe.toml b/recipes/libs/sdl2-gfx/recipe.toml index 8ceefde4b..bf4b621fb 100644 --- a/recipes/libs/sdl2-gfx/recipe.toml +++ b/recipes/libs/sdl2-gfx/recipe.toml @@ -2,7 +2,7 @@ tar = "http://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-1.0.4.tar.gz" blake3 = "2e9bd2dc0f004349b51418f33219ebf5cd69f25ed0ba660373652a662cbb857c" script = """ -wget -O config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false" +GNU_CONFIG_GET config.sub """ [build] diff --git a/recipes/libs/sdl2-mixer/recipe.toml b/recipes/libs/sdl2-mixer/recipe.toml index 2c9d9b829..d73bd12e9 100644 --- a/recipes/libs/sdl2-mixer/recipe.toml +++ b/recipes/libs/sdl2-mixer/recipe.toml @@ -28,6 +28,5 @@ COOKBOOK_CONFIGURE_FLAGS=( --disable-music-midi --disable-music-mod ) -set -x cookbook_configure """ diff --git a/recipes/net/curl/recipe.toml b/recipes/net/curl/recipe.toml index b09f3a22a..229d7777f 100644 --- a/recipes/net/curl/recipe.toml +++ b/recipes/net/curl/recipe.toml @@ -13,26 +13,20 @@ dependencies = [ ] script = """ rsync -av --delete "${COOKBOOK_SOURCE}/" ./ -wget -O config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false" -# FIXME(andypython): dynamically compile +GNU_CONFIG_GET config.sub DYNAMIC_INIT autotools_recursive_regenerate COOKBOOK_CONFIGURE="./configure" -COOKBOOK_CONFIGURE_FLAGS=( - --build="$(cc -dumpmachine)" - --host="${TARGET}" - --prefix="" +COOKBOOK_CONFIGURE_FLAGS+=( --disable-ftp --disable-ipv6 --disable-ntlm-wb --disable-tftp --disable-threaded-resolver - --enable-shared - --enable-static --with-ca-path=/etc/ssl/certs - --with-nghttp2="${COOKBOOK_SYSROOT}" - --with-ssl="${COOKBOOK_SYSROOT}" - --with-zlib="${COOKBOOK_SYSROOT}" + --with-nghttp2 + --with-ssl + --with-zlib --without-libpsl ) cookbook_configure diff --git a/recipes/tests/vttest/recipe.toml b/recipes/tests/vttest/recipe.toml index 22716635f..020c41925 100644 --- a/recipes/tests/vttest/recipe.toml +++ b/recipes/tests/vttest/recipe.toml @@ -3,7 +3,7 @@ tar = "https://invisible-island.net/archives/vttest/vttest-20140305.tgz" blake3 = "b515b9a5e1f1498ed99e1a1c172fbcfdf2b7a214e185bd2005cc994407ded89e" patches = ["redox.patch"] script = """ -wget -O config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false" +GNU_CONFIG_GET config.sub """ [build] diff --git a/recipes/tools/nano/recipe.toml b/recipes/tools/nano/recipe.toml index b58776561..875e01e72 100644 --- a/recipes/tools/nano/recipe.toml +++ b/recipes/tools/nano/recipe.toml @@ -6,7 +6,7 @@ dependencies = [ "ncurses", ] script = """ -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include/ncurses" +DYNAMIC_INIT cookbook_configure """ diff --git a/recipes/wip/libs/other/libtheora/recipe.toml b/recipes/wip/libs/other/libtheora/recipe.toml index b03418d87..95db350e5 100644 --- a/recipes/wip/libs/other/libtheora/recipe.toml +++ b/recipes/wip/libs/other/libtheora/recipe.toml @@ -2,7 +2,7 @@ [source] tar = "http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2" script = """ -wget -O config.sub "https://gitlab.redox-os.org/redox-os/gnu-config/-/raw/master/config.sub?inline=false" +GNU_CONFIG_GET config.sub """ [build]