From patchwork Thu Apr 11 18:16:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Neidhardt X-Patchwork-Id: 3269 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 60CF916E58; Thu, 11 Apr 2019 19:18:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 38C0116E58 for ; Thu, 11 Apr 2019 19:18:09 +0100 (BST) Received: from localhost ([127.0.0.1]:53159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEeH0-00042x-Vl for patchwork@mira.cbaines.net; Thu, 11 Apr 2019 14:18:07 -0400 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 X-Loop: help-debbugs@gnu.org Subject: [bug#35234] [PATCH] gnu: Add the-dark-mod. Resent-From: Pierre Neidhardt Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Apr 2019 18:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35234 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35234@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155500662620692 (code B ref -1); Thu, 11 Apr 2019 18:18:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 Apr 2019 18:17:06 +0000 Received: from localhost ([127.0.0.1]:55153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEeG1-0005Ne-VV for submit@debbugs.gnu.org; Thu, 11 Apr 2019 14:17:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50957) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEeFz-0005N5-Fs for submit@debbugs.gnu.org; Thu, 11 Apr 2019 14:17:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:54301) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hEeFu-0003uY-Bd for submit@debbugs.gnu.org; Thu, 11 Apr 2019 14:16:58 -0400 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 X-Originating-IP: 92.169.116.19 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> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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)))))