From 9ad1b9cc00638c2055bb7393a2b267f3268bd0ed Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jackpot51@gmail.com>
Date: Wed, 13 Dec 2023 15:54:00 -0700
Subject: [PATCH] eduke32: convert to toml

---
 recipes/games/eduke32/recipe.sh   | 37 -------------------------------
 recipes/games/eduke32/recipe.toml | 35 +++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 37 deletions(-)
 delete mode 100644 recipes/games/eduke32/recipe.sh
 create mode 100644 recipes/games/eduke32/recipe.toml

diff --git a/recipes/games/eduke32/recipe.sh b/recipes/games/eduke32/recipe.sh
deleted file mode 100644
index 855d3e18a..000000000
--- a/recipes/games/eduke32/recipe.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-VERSION=20181010-7067
-TAR=https://dukeworld.com/eduke32/synthesis/$VERSION/eduke32_src_$VERSION.tar.xz
-BUILD_DEPENDS=(sdl1 sdl1-mixer liborbital libiconv libogg libvorbis)
-
-function recipe_version {
-    echo "$VERSION"
-    skip=1
-}
-
-function recipe_build {
-    sysroot="$(realpath ../sysroot)"
-    export CFLAGS="-I$sysroot/include -I$sysroot/include/SDL"
-    export LDFLAGS="-L$sysroot/lib -static"
-    export SDLCONFIG="$sysroot/bin/sdl-config --prefix=$sysroot"
-
-    PLATFORM=REDOX "$REDOX_MAKE" -j"$($NPROC)"
-    skip=1
-}
-
-function recipe_clean {
-    "$REDOX_MAKE" clean
-    skip=1
-}
-
-function recipe_stage {
-    mkdir -pv "$1/games"
-    cp -v ./eduke32 "$1/games/eduke32"
-    cp -v ./mapster32 "$1/games/mapster32"
-
-    mkdir -pv "$1/ui/apps"
-    cp -v "${COOKBOOK_RECIPE}/manifest" "$1/ui/apps/eduke32"
-
-    mkdir -pv "$1/ui/icons/apps"
-    cp -v "${COOKBOOK_RECIPE}/icon.png" "$1/ui/icons/apps/eduke32.png"
-
-    skip=1
-}
diff --git a/recipes/games/eduke32/recipe.toml b/recipes/games/eduke32/recipe.toml
new file mode 100644
index 000000000..e150b2c87
--- /dev/null
+++ b/recipes/games/eduke32/recipe.toml
@@ -0,0 +1,35 @@
+[source]
+tar = "https://dukeworld.com/eduke32/synthesis/20181010-7067/eduke32_src_20181010-7067.tar.xz"
+blake3 = "b0b759fe9ca51849f42669e4832ae1ae1f9ad7938529769108f7cf6a6a176558"
+patches = ["redox.patch"]
+
+[build]
+dependencies = [
+    "sdl1",
+    "sdl1-mixer",
+    "liborbital",
+    "libiconv",
+    "libogg",
+    "libvorbis",
+]
+template = "custom"
+script = """
+# Copy source to build directory
+rsync -av --delete "${COOKBOOK_SOURCE}/" ./
+
+export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/SDL"
+export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib -static"
+export SDLCONFIG="${COOKBOOK_SYSROOT}/bin/sdl-config --prefix=${COOKBOOK_SYSROOT}"
+
+PLATFORM=REDOX "${COOKBOOK_MAKE}" -j"$($NPROC)"
+
+mkdir -pv "${COOKBOOK_STAGE}/games"
+cp -v ./eduke32 "${COOKBOOK_STAGE}/games/eduke32"
+cp -v ./mapster32 "${COOKBOOK_STAGE}/games/mapster32"
+
+mkdir -pv "${COOKBOOK_STAGE}/ui/apps"
+cp -v "${COOKBOOK_RECIPE}/manifest" "${COOKBOOK_STAGE}/ui/apps/eduke32"
+
+mkdir -pv "${COOKBOOK_STAGE}/ui/icons/apps"
+cp -v "${COOKBOOK_RECIPE}/icon.png" "${COOKBOOK_STAGE}/ui/icons/apps/eduke32.png"
+"""
-- 
GitLab