From cabb1ff5646e40acda6656ad6462feb65a5653d4 Mon Sep 17 00:00:00 2001 From: Josh Megnauth Date: Fri, 25 Jul 2025 22:53:11 -0400 Subject: [PATCH] Dyn link Mesa, Mesa GLU, Tyrian, Quake --- recipes/games/opentyrian/recipe.toml | 6 ++++++ recipes/games/quakespasm/recipe.toml | 6 ++++++ recipes/libs/mesa-glu/recipe.toml | 11 ++++++----- recipes/libs/mesa/recipe.toml | 20 +++++++++++++++----- 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/recipes/games/opentyrian/recipe.toml b/recipes/games/opentyrian/recipe.toml index 55ecfa29..d20cecf3 100644 --- a/recipes/games/opentyrian/recipe.toml +++ b/recipes/games/opentyrian/recipe.toml @@ -22,6 +22,8 @@ dependencies = [ # "sdl2-net" ] script = """ +DYNAMIC_INIT + # Build system is only a standalone Makefile COOKBOOK_CONFIGURE="true" COOKBOOK_CONFIGURE_FLAGS="" @@ -36,6 +38,10 @@ export bindir="${prefix}/games" export icondir="/ui/icons/apps" export gamesdir="${prefix}/share/games" +if ! [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then + LDFLAGS+=" -lstdc++" +fi + # Prepare the sources and download Tyrian (freeware) rsync -av --delete "${COOKBOOK_SOURCE}/" "${COOKBOOK_RECIPE}/tyrian21.zip.sha" ./ mkdir -p "${ASSETSDIR}" diff --git a/recipes/games/quakespasm/recipe.toml b/recipes/games/quakespasm/recipe.toml index 519399e1..f101e897 100644 --- a/recipes/games/quakespasm/recipe.toml +++ b/recipes/games/quakespasm/recipe.toml @@ -21,6 +21,8 @@ dependencies = [ "zlib", ] script = """ +DYNAMIC_INIT + # Skip configuring because QuakeSpasm uses a custom build system COOKBOOK_CONFIGURE="true" COOKBOOK_CONFIGURE_FLAGS="" @@ -37,6 +39,10 @@ export USE_SDL2=1 export USE_CODEC_MP3=0 export DO_USERDIRS=1 +if ! [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then + LDFLAGS+=" -lstdc++" +fi + # Source is in Quake/ and icons are in Misc/ rsync -av --delete "${COOKBOOK_SOURCE}/Quake/" "${COOKBOOK_SOURCE}/Misc" ./ diff --git a/recipes/libs/mesa-glu/recipe.toml b/recipes/libs/mesa-glu/recipe.toml index 9844b0c8..a79880b8 100644 --- a/recipes/libs/mesa-glu/recipe.toml +++ b/recipes/libs/mesa-glu/recipe.toml @@ -1,11 +1,12 @@ [source] -tar = "https://archive.mesa3d.org/glu/glu-9.0.1.tar.xz" -blake3 = "461543526cd681bc8fa91a1ece9519188c64ce7ad130a71213bdd0867e0884c9" +tar = "https://archive.mesa3d.org/glu/glu-9.0.3.tar.xz" +blake3 = "beed1665ed983540e7502289ec50c7e66d840820af3e9ef21c9c4a7e9686ab9f" [build] -dependencies = ["mesa"] +dependencies = ["mesa", "zlib"] template = "custom" script = """ -COOKBOOK_CONFIGURE_FLAGS+=(--enable-osmesa) -cookbook_configure +DYNAMIC_INIT + +cookbook_meson -Dgl_provider=osmesa """ diff --git a/recipes/libs/mesa/recipe.toml b/recipes/libs/mesa/recipe.toml index aa7b394c..d473cc8c 100644 --- a/recipes/libs/mesa/recipe.toml +++ b/recipes/libs/mesa/recipe.toml @@ -11,19 +11,29 @@ dependencies = [ "zlib", ] script = """ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include -DHAVE_PTHREAD=1" -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include -DHAVE_PTHREAD=1" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib --static" +DYNAMIC_INIT + +export CFLAGS+="-I${COOKBOOK_SYSROOT}/include -DHAVE_PTHREAD=1" +export CPPFLAGS+="-I${COOKBOOK_SYSROOT}/include -DHAVE_PTHREAD=1" export LLVM_CONFIG="${TARGET}-llvm-config" +if [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then + export LDFLAGS+=" --static" + export DEFAULTLIB="static" + export LLVMSHARED="disabled" +else + export DEFAULTLIB="shared" + export LLVMSHARED="enabled" +fi + COOKBOOK_MESON_FLAGS=( - -Ddefault_library=static + -Ddefault_library="${DEFAULTLIB}" -Dglx=disabled -Dllvm=enabled -Dosmesa=true -Dplatforms= -Dshader-cache=disabled - -Dshared-llvm=disabled + -Dshared-llvm="${LLVMSHARED}" -Dshared-glapi=disabled )