* gnu/packages/games.scm (the-dark-mod): New variable.
gnu/packages/games.scm | 142 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 142 insertions(+)
Toggle diff (166 lines)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 2afe5b58ba..4895c0e361 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
#:use-module (gnu packages libunwind)
#:use-module (gnu packages linux)
#:use-module (gnu packages lua)
+ #:use-module (gnu packages m4)
#:use-module (gnu packages man)
#:use-module (gnu packages maths)
#:use-module (gnu packages mp3)
#:use-module (gnu packages textutils)
#:use-module (gnu packages tls)
#:use-module (gnu packages upnp)
+ #:use-module (gnu packages version-control)
#:use-module (gnu packages video)
#:use-module (gnu packages vulkan)
#:use-module (gnu packages web)
@@ -6765,3 +6767,143 @@ a procedurally generated world, the player can explore thousands of rooms in
search of powerful artifacts, tools to help them, and to eventually free the
(license license:gpl3+)))
+(define-public the-dark-mod
+ (string-append "TARGET_ARCH="
+ (match (%current-system)
+ ("x86_64-linux" "x64"))))
+ (the-dark-mod-env-var-name "THEDARKMOD_PATH")
+ (the-dark-mod-env-var-value "~/.local/share/darkmod"))
+ (uri (string-append "http://www.thedarkmod.com/sources/thedarkmod."
+ "1lhqwl0qnddzbh9na9c73aqg923ixyrr5ih12p4y9v5nis9b3kyy"))))
+ (build-system scons-build-system)
+ ;; BUILD=release makes Scons strip the executable, which fails because
+ ;; "strip" is not found in the path.
+ #:scons-flags (list ,scons-flags)
+ (modify-phases %standard-phases
+ (lambda* (#:key source #:allow-other-keys)
+ (and (invoke "7z" "x" source))))
+ (add-after 'unpack 'fix-build-flags
+ ;; TODO: By default, -no-pie is passed because of the assumption
+ ;; that -fPIC was used to build ffmpeg. This does not work with
+ ;; out default gcc-5. This package does not seem to build with
+ (substitute* "SConstruct"
+ (("BASELINKFLAGS.append\\( '-no-pie' \\)") ""))
+ (add-after 'build 'build-updater
+ (with-directory-excursion "tdm_update"
+ (append (list "-j" (number->string
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (mesa (assoc-ref inputs "mesa"))
+ (bin (string-append out "/bin/thedarkmod"))
+ (bin-real (string-append out "/bin/.thedarkmod-real"))
+ (updater (string-append out "/bin/tdm_update"))
+ (updater-real (string-append out "/bin/.tdm_update-real"))
+ (apps (string-append out "/share/applications"))
+ (icons (string-append out "/share/icons")))
+ (mkdir-p (string-append out "/bin"))
+ (copy-file ,@(match (%current-system)
+ (copy-file "tdm_update/tdm_update.linux" updater-real)
+ (with-output-to-file bin
+export LD_LIBRARY_PATH=~a/lib
+exec -a \"~a\" ~a \"$@\"\n"
+ ,the-dark-mod-env-var-name ,the-dark-mod-env-var-name
+ ,the-dark-mod-env-var-value
+ ,the-dark-mod-env-var-name
+ (basename bin) bin-real)))
+ (with-output-to-file updater
+## tdm_update outputs a log in its current working directory.
+~a --noselfupdate --targetdir \"$~a\" \"$@\"~%"
+ ,the-dark-mod-env-var-name ,the-dark-mod-env-var-name
+ ,the-dark-mod-env-var-value
+ ,the-dark-mod-env-var-name
+ ,the-dark-mod-env-var-name
+ ,the-dark-mod-env-var-name)))
+ (install-file "tdm_update/darkmod.ico" icons)
+ (string-append apps "/darkmod.desktop")
+ ("libxxf86vm" ,libxxf86vm)
+ ("subversion" ,subversion)))
+ (home-page "http://www.thedarkmod.com/")
+ (synopsis "Game based on the Thief series by Looking Glass Studios")
+ (description (format #f "The Dark Mod (TDM) is stealth/infiltration game
+based on the Thief series by Looking Glass Studios. Formerly a Doom III mod,
+it is now released as a standalone.
+The game data must be fetched manually by running @command{tdm_update}.
+The ~a environment variable specifies the location where the game data is
+saved (defaults to ~a)."
+ the-dark-mod-env-var-name the-dark-mod-env-var-value))
+ (supported-systems '("x86_64-linux" "i686-linux"))
+ (license (list license:gpl3 ; idTech 4 engine
+ license:bsd-3 ; Portion of the engine by Broken Glass Studios
+ ;; All other non-software components: they are not
+ ;; included in the Guix package, but the updater fetches
+ license:cc-by-sa3.0)))))