From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:43164) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iznbA-0003eC-D4 for guix-patches@gnu.org; Thu, 06 Feb 2020 15:18:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iznb8-0005M8-US for guix-patches@gnu.org; Thu, 06 Feb 2020 15:18:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42563) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iznb8-0005Ly-QJ for guix-patches@gnu.org; Thu, 06 Feb 2020 15:18:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iznb8-0003Je-M8 for guix-patches@gnu.org; Thu, 06 Feb 2020 15:18:02 -0500 Subject: [bug#38687] [PATCH 2/2] gnu: Add libtcod. Resent-Message-ID: From: Giacomo Leidi Date: Thu, 6 Feb 2020 21:17:13 +0100 Message-Id: <20200206201713.8535-2-goodoldpaul@autistici.org> In-Reply-To: <20200206201713.8535-1-goodoldpaul@autistici.org> References: <20200206201713.8535-1-goodoldpaul@autistici.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: 38687@debbugs.gnu.org Cc: Giacomo Leidi * gnu/packages/game-development.scm (libtcod): New variable. --- gnu/packages/game-development.scm | 76 +++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index 6fa4fed74f..ce25620773 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -19,6 +19,7 @@ ;;; Copyright © 2019 Jethro Cao ;;; Copyright © 2020 Nicolas Goaziou ;;; Copyright © 2020 Timotej Lazar +;;; Copyright © 2020 Giacomo Leidi ;;; ;;; This file is part of GNU Guix. ;;; @@ -88,6 +89,7 @@ #:use-module (gnu packages sphinx) #:use-module (gnu packages stb) #:use-module (gnu packages texinfo) + #:use-module (gnu packages textutils) #:use-module (gnu packages tls) #:use-module (gnu packages video) #:use-module (gnu packages web) @@ -2086,3 +2088,77 @@ computer games, 3D authoring tools and simulation tools.") (description "Chipmunk is a simple, lightweight, fast and portable 2D rigid body physics library written in C.") (license license:expat))) + +(define-public libtcod + (package + (name "libtcod") + (version "1.15.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/libtcod/libtcod.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0pzr8ajmbqvh43ldjajx962xirj3rf8ayh344p6mqlrmb8gxrfr5")) + (modules '((guix build utils))) + (snippet '(begin + (delete-file-recursively "src/vendor/utf8proc") + (delete-file-recursively "src/vendor/zlib") + (delete-file "src/vendor/stb_truetype.h") + (delete-file "src/vendor/stb_sprintf.h") + (delete-file "src/vendor/lodepng.cpp") + (delete-file "src/vendor/lodepng.h") + #t)))) + (build-system gnu-build-system) + (arguments + `(#:configure-flags '("--with-gnu-ld" + "LIBS=-lutf8proc -llodepng") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'change-to-build-dir + (lambda _ + (chdir "buildsys/autotools") + (patch-shebang "get_version.py") + #t)) + (add-before 'bootstrap 'remove-hardcoded-vendor-paths + (lambda _ + (substitute* "sources.am" + (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "") + (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\") + "../../src/vendor/stb.c") + (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") "")) + + (substitute* "../../src/libtcod/sys_sdl_img_png.cpp" + (("\\.\\./vendor/") "")) + + (substitute* '("../../src/libtcod/color/canvas.cpp" + "../../src/libtcod/sys_sdl_img_png.cpp" + "../../src/libtcod/tileset/truetype.cpp" + "../../src/libtcod/tileset/tilesheet.cpp") + (("\\.\\./\\.\\./vendor/") "")) + + (substitute* "../../src/libtcod/console/printing.cpp" + (("\\.\\./\\.\\./vendor/utf8proc/") "")) + #t))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool) + ("lodepng" ,lodepng) + ("python" ,python) + ("pkg-config" ,pkg-config) + ("sdl2" ,sdl2) + ("stb-sprintf" ,stb-sprintf) + ("stb-truetype" ,stb-truetype))) + (inputs + `(("utf8proc" ,utf8proc) + ("zlib" ,zlib))) + (home-page "https://github.com/libtcod/libtcod") + (synopsis "Library specifically designed for writing roguelikes") + (description + "libtcod is a free, fast, portable and uncomplicated API for roguelike +developers providing an advanced true color console, input, and lots of other +utilities frequently used in roguelikes.") + (license license:bsd-3))) -- 2.25.0