From dfdfeb3b7b0f5eeb2eb8c18cdec9b7e4eb796609 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jackpot51@gmail.com>
Date: Wed, 2 May 2018 19:18:39 -0600
Subject: [PATCH] Add binaries to run freedoom

---
 recipes/freedoom/recipe.sh | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/recipes/freedoom/recipe.sh b/recipes/freedoom/recipe.sh
index 262f1f1e3..19adca409 100644
--- a/recipes/freedoom/recipe.sh
+++ b/recipes/freedoom/recipe.sh
@@ -1,4 +1,5 @@
 GIT=https://github.com/redox-os/freedoom.git
+DEPENDS=(ion prboom)
 
 function recipe_version {
     echo "0.11.3"
@@ -26,8 +27,18 @@ function recipe_clean {
 }
 
 function recipe_stage {
-    mkdir -pv "$1/share/games/doom"
-    cp -Rv ./*.wad "$1/share/games/doom"
+    mkdir -pv "$1/games" "$1/share/games/doom"
+    for file in ./*.wad
+    do
+        game="$(basename "$file" .wad)"
+
+        wad="/share/games/doom/$game.wad"
+        cp -v "$file" "$1$wad"
+
+        bin="/games/$game"
+        echo "#!/bin/ion" > "$1$bin"
+        echo "/games/prboom -geom 800x600 -vidmode 32 -iwad $wad" >> "$1$bin"
+        chmod +x "$1$bin"
+    done
     skip=1
 }
-
-- 
GitLab