guix-packages/ambrevar/games: eduke32: Wrap to auto-load mods

master
Pierre Neidhardt 2019-03-19 18:21:29 +01:00
parent 315798ab3d
commit 7051afb07a
1 changed files with 34 additions and 10 deletions

View File

@ -123,16 +123,40 @@ and sprites with high-res versions, optimizing it for latest OpenGL ports.")
#t))
(replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(glu (assoc-ref inputs "glu")))
(let* ((out (assoc-ref outputs "out"))
(glu (assoc-ref inputs "glu"))
(eduke (string-append out "/bin/eduke32"))
(eduke-real (string-append out "/bin/.eduke32-real")))
;; TODO: Install custom .desktop file? Need icon.
;; See https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=eduke32.
(install-file "eduke32" (string-append out "/bin"))
(install-file "mapster32" (string-append out "/bin"))
(install-file "package/common/buildlic.txt" (string-append out "/share/licenses"))
(wrap-program (string-append out "/bin/eduke32")
`("LD_LIBRARY_PATH" ":" prefix
(,(string-append glu "/lib"))))))))))
;; Wrap program:
;; - Need to expose GLU so that the polymer renderer can load.
;; - Make sure current directory is writable, else eduke32 will segfault.
;; - Add ../share/dukenukem3d to the dir search list.
(rename-file eduke eduke-real)
(call-with-output-file eduke
(lambda (p)
(format p "\
#!~a
export LD_LIBRARY_PATH=\"~a/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH\"
cd \"$(mktemp -d)\"
exec -a \"$0\" ~a\
-g \"${0%/*}\"/../~a/*.grp\
-g \"${0%/*}\"/../~a/*.zip\
-g \"${0%/*}\"/../~a/*.map\
-g \"${0%/*}\"/../~a/*.con\
-g \"${0%/*}\"/../~a/*.def\
\"$@\"~%"
(which "bash") glu eduke-real
,duke-nukem-3d-directory
,duke-nukem-3d-directory
,duke-nukem-3d-directory
,duke-nukem-3d-directory
,duke-nukem-3d-directory)))
(chmod eduke #o755)))))))
(native-inputs
`(("pkg-config" ,pkg-config)))
(inputs
@ -143,13 +167,13 @@ and sprites with high-res versions, optimizing it for latest OpenGL ports.")
("flac" ,flac)
("gtk+" ,gtk+-2)))
(synopsis "Source port of the classic PC first person shooter Duke Nukem 3D")
(description "EDuke32 is an awesome, free homebrew game engine and source port of the
(description "EDuke32 is a free homebrew game engine and source port of the
classic PC first person shooter Duke Nukem 3DDuke3D for shortto Windows,
Linux, Mac OS X, FreeBSD, several handhelds, your family toaster, and to your
girlfriend's vibrator. We've added thousands of cool and useful features and
upgrades for regular players and additional editing capabilities and scripting
extensions for homebrew developers and mod creators. EDuke32 is open source
software that is completely free to use for all non-commercial purposes.")
vibrator. A thousands of cool and useful features and upgrades were added for
regular players and additional editing capabilities and scripting extensions for
homebrew developers and mod creators. EDuke32 is open source but non-free
software.")
(home-page "https://eduke32.com/")
(license ((@@ (guix licenses) license) "BUILD license"
"https://eduke32.com/buildlic.txt"