guix-packages/ambrevar/streetsofrage: Fix streets-of-rage wrapper

master
Pierre Neidhardt 2019-03-23 12:42:09 +01:00
parent 81a074fc3f
commit 91bd1ee32a
1 changed files with 22 additions and 7 deletions

View File

@ -178,8 +178,8 @@ guix environment --container \
(mkdir-p "share/icons/hicolor/48x48/apps/")
(rename-file "sorr.png" "share/icons/hicolor/48x48/apps/sorr.png")
(rename-file "data" "lib")
(mkdir-p "share/streetsofrageremake")
(for-each (lambda (f) (rename-file f (string-append "share/streetsofrageremake/" f)))
(mkdir-p "share/sorr")
(for-each (lambda (f) (rename-file f (string-append "share/sorr/" f)))
'("SorMaker.dat" "SorR.dat" "manual" "manual.html"
"mod" "palettes" "Readme.txt"))
(delete-file "sorr")
@ -218,24 +218,39 @@ guix environment --container \
(let* ((bash (assoc-ref %build-inputs "bash"))
(sorr (string-append out "/bin/sorr"))
(sorr-real (string-append out "/bin/bgdi"))
(sorr-data (string-append out "/share/streetsofrageremake/SorR.dat")))
(sorr-data (string-append out "/share/sorr/SorR.dat"))
(sorr-path (string-append out "/share/sorr/")))
(call-with-output-file sorr
(lambda (p)
;; Passing '-a "$0"' to exec breaks the game.
(format p "\
#!~a
STREETSOFRAGEREMAKE_PATH=\"${STREETSOFRAGEREMAKE_PATH:-$HOME/.config/streetsofrageremake}\"
mkdir -p \"$STREETSOFRAGEREMAKE_PATH\"
cd \"$STREETSOFRAGEREMAKE_PATH\"
SORR_PATH=\"${SORR_PATH:-$HOME/.config/sorr}\"
mkdir -p \"$SORR_PATH\"
cd \"$SORR_PATH\"
for i in \"~a\"/*; do
if [ \"$(basename \"$i\")\" != \"mod\" ]; then
ln -sf \"$i\"
fi
done
mkdir -p mod/games
for i in \"~a\"/mod/*; do
ln -sf \"$i\" mod/
done
exec ~a ~a \"$@\"~%"
(string-append bash "/bin/bash")
sorr-path sorr-path
sorr-real
sorr-data)))
(chmod sorr #o755))
#t))))
(home-page "http://www.sorrcommunity.com/t148-sor-v5-for-linux-debian-download-links")
(synopsis "Remake of the classic Streets of Rage 1, 2 and 3")
(description "Remake of the classic Streets of Rage 1, 2 and 3")
(description "This is a Bombergames remake of the classic Streets of Rage 1,
2 and 3 by Sega. The save games are stored in ~/.config/sorr (configurable via
the SORR_PATH environment variable). Mods can be installed in
$SORR_PATH/mod/games.
")
(license ((@@ (guix licenses) license) "No license"
"No URL"
""))))