From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:37281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEeGx-0003zz-Tw for guix-patches@gnu.org; Thu, 11 Apr 2019 14:18:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hEeGw-0004Q9-JH for guix-patches@gnu.org; Thu, 11 Apr 2019 14:18:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41609) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hEeGw-0004Ps-8G for guix-patches@gnu.org; Thu, 11 Apr 2019 14:18:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hEeGv-0005Oq-T9 for guix-patches@gnu.org; Thu, 11 Apr 2019 14:18:01 -0400 Subject: [bug#35234] [PATCH] gnu: Add the-dark-mod. Resent-Message-ID: Received: from eggs.gnu.org ([209.51.188.92]:37090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEeFs-0003ZB-PG for guix-patches@gnu.org; Thu, 11 Apr 2019 14:16:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hEeFr-0003qY-6p for guix-patches@gnu.org; Thu, 11 Apr 2019 14:16:56 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:49985) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hEeFq-0003id-Qi for guix-patches@gnu.org; Thu, 11 Apr 2019 14:16:55 -0400 Received: from localhost.localdomain (lfbn-1-4117-19.w92-169.abo.wanadoo.fr [92.169.116.19]) (Authenticated sender: mail@ambrevar.xyz) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id A3B4D1C0002 for ; Thu, 11 Apr 2019 18:16:44 +0000 (UTC) From: Pierre Neidhardt Date: Thu, 11 Apr 2019 20:16:44 +0200 Message-Id: <20190411181644.21661-1-mail@ambrevar.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 35234@debbugs.gnu.org * gnu/packages/games.scm (the-dark-mod): New variable. --- gnu/packages/games.scm | 142 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) 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 @@ -113,6 +113,7 @@ #: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) @@ -141,6 +142,7 @@ #: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 Orcus Dome from evil.") (license license:gpl3+))) + +(define-public the-dark-mod + (let ((scons-flags + (string-append "TARGET_ARCH=" + (match (%current-system) + ("i686-linux" "x86") + ("x86_64-linux" "x64")))) + (the-dark-mod-env-var-name "THEDARKMOD_PATH") + (the-dark-mod-env-var-value "~/.local/share/darkmod")) + (package + (name "the-dark-mod") + (version "2.07") + (source (origin + (method url-fetch) + (uri (string-append "http://www.thedarkmod.com/sources/thedarkmod." + version ".src.7z")) + (sha256 + (base32 + "1lhqwl0qnddzbh9na9c73aqg923ixyrr5ih12p4y9v5nis9b3kyy")))) + (build-system scons-build-system) + (arguments + `(#:tests? #f ;no test + #:scons ,scons-python2 + ;; BUILD=release makes Scons strip the executable, which fails because + ;; "strip" is not found in the path. + #:scons-flags (list ,scons-flags) + #:phases + (modify-phases %standard-phases + (replace 'unpack + (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 + ;; gcc>5. + (lambda _ + (substitute* "SConstruct" + (("BASELINKFLAGS.append\\( '-no-pie' \\)") "")) + #t)) + (add-after 'build 'build-updater + (lambda _ + (with-directory-excursion "tdm_update" + (apply invoke "scons" + (append (list "-j" (number->string + (parallel-job-count))) + (list ,scons-flags)))) + #t)) + (replace 'install + (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) + ("i686-linux" + '("thedarkmod.x86")) + ("x86_64-linux" + '("thedarkmod.x64"))) + bin-real) + (copy-file "tdm_update/tdm_update.linux" updater-real) + (with-output-to-file bin + (lambda _ + (format #t "\ +#!~a +export LD_LIBRARY_PATH=~a/lib +~a=${~a:-~a} +cd \"$~a\" +exec -a \"~a\" ~a \"$@\"\n" + (which "bash") + mesa + ,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))) + (chmod bin #o555) + (with-output-to-file updater + (lambda _ + (format #t "\ +#!~a +~a=${~a:-~a} +mkdir -p \"$~a\" +## tdm_update outputs a log in its current working directory. +cd \"$~a\" +~a --noselfupdate --targetdir \"$~a\" \"$@\"~%" + (which "bash") + ,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 + updater-real + ,the-dark-mod-env-var-name))) + (chmod updater #o555) + (mkdir-p apps) + (mkdir-p icons) + (install-file "tdm_update/darkmod.ico" icons) + (with-output-to-file + (string-append apps "/darkmod.desktop") + (lambda _ + (format #t + "[Desktop Entry]~@ + Name=The Dark Mod~@ + Comment=The Dark Mod~@ + Exec=~a~@ + TryExec=~@*~a~@ + Icon=darkmod~@ + Categories=Game~@ + Type=Application~%" + bin))))))))) + (inputs + `(("mesa" ,mesa) + ("libxxf86vm" ,libxxf86vm) + ("openal" ,openal) + ("libxext" ,libxext))) + (native-inputs + `(("p7zip" ,p7zip) + ("m4" ,m4) + ("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 + ;; them. + license:cc-by-sa3.0))))) -- 2.21.0