From patchwork Wed Jan 22 11:11:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Giacomo Leidi X-Patchwork-Id: 19951 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 F3FE217A97; Wed, 22 Jan 2020 11:12:23 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable 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 8802F17A7B for ; Wed, 22 Jan 2020 11:12:23 +0000 (GMT) Received: from localhost ([::1]:40108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuDvq-0003Oo-S5 for patchwork@mira.cbaines.net; Wed, 22 Jan 2020 06:12:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35788) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuDvX-0003Og-U5 for guix-patches@gnu.org; Wed, 22 Jan 2020 06:12:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuDvW-0004rX-GY for guix-patches@gnu.org; Wed, 22 Jan 2020 06:12:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43079) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iuDvW-0004rR-DL for guix-patches@gnu.org; Wed, 22 Jan 2020 06:12:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iuDvW-00043F-90 for guix-patches@gnu.org; Wed, 22 Jan 2020 06:12:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38687] [PATCH] gnu: Add libtcod. Resent-From: goodoldpaul@autistici.org Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Jan 2020 11:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38687 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: 38687@debbugs.gnu.org Received: via spool by 38687-submit@debbugs.gnu.org id=B38687.157969150015545 (code B ref 38687); Wed, 22 Jan 2020 11:12:02 +0000 Received: (at 38687) by debbugs.gnu.org; 22 Jan 2020 11:11:40 +0000 Received: from localhost ([127.0.0.1]:49052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iuDv9-00042e-Is for submit@debbugs.gnu.org; Wed, 22 Jan 2020 06:11:39 -0500 Received: from devianza.investici.org ([198.167.222.108]:54097) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iuDv7-00042W-6b for 38687@debbugs.gnu.org; Wed, 22 Jan 2020 06:11:38 -0500 Received: from 1.mail-backend.investici.org (unknown [10.0.0.11]) by devianza.investici.org (Postfix) with ESMTP id AD510E0630; Wed, 22 Jan 2020 11:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1579691495; bh=xHGvW0fxAdBobtazGl3XHfOAIBFDZM7SmP6F2bkZP+c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bMrsGie29p27OHLa9Y5m0u+SkJdunIAwDC/PoVk7gKprOxlEY9z0mT7iQRU4EN+H1 TneuOrbh2A96gCZgvfoOoDTY0N7MlDSBFQyunj5aURYrvmC2DhmAW2OTYihdWy7J80 Kl/PNJ2C5p4W9+b/McEF3ogJ8vl0C5QbwcKpyXeQ= Received: from 1.webmail.investici.org (localhost [127.0.0.1]) (Authenticated sender: goodoldpaul@autistici.org) by 1.mail-backend.investici.org (Postfix) with ESMTPA id 9685ABEE32; Wed, 22 Jan 2020 11:11:34 +0000 (UTC) MIME-Version: 1.0 Date: Wed, 22 Jan 2020 11:11:34 +0000 From: goodoldpaul@autistici.org In-Reply-To: <875zi6j3c1.fsf@gnu.org> References: <20191220123739.18081-1-goodoldpaul@autistici.org> <875zi6j3c1.fsf@gnu.org> User-Agent: Roundcube Webmail Message-ID: <891e12c54b84a6f4caad6b4c72f1ecba@autistici.org> X-Sender: goodoldpaul@autistici.org 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 On 2019-12-23 18:37, Ludovic Courtès wrote: > Hi, > > Giacomo Leidi skribis: > >> * gnu/packages/game-development.scm (libtcod): New variable. > > Could you (1) add a ‘snippet’ that removes zlib and utf8proc from > src/vendor (assuming it doesn’t break the build system…), and (2) add > utf8proc as an input? > > That way we’d make sure we don’t end up using bundled copies of these > packages > > Apart from that it LGTM, thanks! > > Ludo’. Hi Ludo', Sorry for the delay. I checked and it seems that a lot of vendor library paths are hardcoded in the C headers. I made a new patch with a snippet that deletes zlib sources, but I'm unsure about how to approach the hardcoded paths. grepping for 'vendor' inside the source returns src/libtcod/sys_sdl_img_png.cpp 41:#include "../vendor/lodepng.h" src/libtcod/console/printing.cpp 54:#include "../../vendor/utf8proc/utf8proc.h" src/libtcod/sdl2/gl2_ext_.h 36:#include "../../vendor/glad.h" src/libtcod/color/canvas.cpp 39:#include "../../vendor/lodepng.h" src/libtcod/tileset/truetype.cpp 43:#include "../../vendor/stb_truetype.h" src/libtcod/tileset/tilesheet.cpp 34:#include "../../vendor/lodepng.h" As far as I understood (I'm no C wizard) lodepng, glad and stb are libraries which are designed to be dropped inside a source tree and statically built in binaries. Right now I think those are secondary problems and the main deal is how to effectively replace the included utf8proc. I'm not sure if replacing every "#include ../../vendor/something.h" with "#include " ( by including a .patch file or with substitute* ? Food for thought :D) and then placing something.h inside a path known by the C linker is enough but it's the I'm not really sure where to go from here. Any advice is very welcome, thanks. Giacomo From 01877f5f7a7beed2d52729c4ca5577cccc495a88 Mon Sep 17 00:00:00 2001 From: Giacomo Leidi Date: Sun, 19 Jan 2020 16:59:57 +0100 Subject: [PATCH] gnu: Add libtcod. * gnu/packages/game-development.scm (libtcod): New variable. --- gnu/packages/game-development.scm | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index ee8dea23b5..f03321281e 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2019, 2020 Leo Prikler ;;; Copyright © 2019 Jethro Cao ;;; Copyright © 2020 Nicolas Goaziou +;;; Copyright © 2020 Giacomo Leidi ;;; ;;; This file is part of GNU Guix. ;;; @@ -86,6 +87,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 xdisorg) @@ -2049,3 +2051,46 @@ 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/zlib") + #t)))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'change-to-build-dir + (lambda _ + (chdir "buildsys/autotools") + (patch-shebang "get_version.py") + #t))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool) + ("python" ,python) + ("pkg-config" ,pkg-config) + ("sdl2" ,sdl2))) + (inputs + `(("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