From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 05 08:04:14 2021 Received: (at 49828) by debbugs.gnu.org; 5 Aug 2021 12:04:14 +0000 Received: from localhost ([127.0.0.1]:46117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBc6g-0003fR-1P for submit@debbugs.gnu.org; Thu, 05 Aug 2021 08:04:14 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:44129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBc6e-0003fH-0N for 49828@debbugs.gnu.org; Thu, 05 Aug 2021 08:04:13 -0400 Received: from nijino.local (194-118-35-216.adsl.highway.telekom.at [194.118.35.216]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4GgS2K018gz1DH9P; Thu, 5 Aug 2021 14:04:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4GgS2K018gz1DH9P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1628165049; bh=cdl1Uv7SMseSITfFEd3yF1LZNC2euuH5illtAH2rCMc=; h=Subject:From:To:Date:In-Reply-To:References:From; b=naDDzqlPWzBLsRxQnwKfaJoA6V3r4AlEJCB0wfaWH3XJ3X8iiQc3fkmKCGajYLZj7 aPGu1kMyqbss8dFlr+DNWuPuZI1u3VpiwGfTmnsvvB6pxX5WXDHF2ivwLL9y7/UiO5 TZ4xClbejqeDx2wSbFOQxpNT58wDezzUkzcQBz+Y= Message-ID: <2a49c566e1ecc280db79bcda1e893547216dd83a.camel@student.tugraz.at> Subject: Re: [PATCH 05/20] build-system: minetest: Don't retain references to "bash-minimal". From: Leo Prikler To: Maxime Devos , 49828@debbugs.gnu.org Date: Thu, 05 Aug 2021 14:04:07 +0200 In-Reply-To: <7680df67d8be80c1d55771407256c28b76e0d836.camel@telenet.be> References: <20210802155019.6122-1-maximedevos@telenet.be> <20210802155019.6122-5-maximedevos@telenet.be> <60c5062a7debff22cee27198c2548605fd7441e0.camel@student.tugraz.at> <265c85f914757066aee6b6933ba58bf1abd2bc84.camel@telenet.be> <8d13a1057f368f47eef8da538c554a379892cacc.camel@student.tugraz.at> <7680df67d8be80c1d55771407256c28b76e0d836.camel@telenet.be> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49828 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Am Donnerstag, den 05.08.2021, 13:01 +0200 schrieb Maxime Devos: > Hi, > > The attached patch squashes "PATCH 04" and "PATCH 05" together > and extends the build system. It now has an install plan only > installing > what's necessary (Lua code, PNG images, some configuration files > ...), > a 'check' build phase verifying Minetest can actually load the mod, > and a 'minimise-png' phase minimising PNG images. > > The mod name for ‘(("." "share/minetest/mods/the-mod-name"))’ can now > be determined exactly in most cases (Minetest doesn't really care but > the directory name can appear in the GUI in some cases). > > Greetings, > Maxime. > +mods, which consists of copying lua code, images and other resources > to s/lua/Lua/ :) > +(define* (install #:key inputs #:allow-other-keys #:rest arguments) > + (apply (@@ (guix build copy-build-system) install) > + #:install-plan (mod-install-plan (apply guess-mod-name > arguments)) > + arguments)) @@ is a code smell, as far as Guix is concerned. Rather import copy- build-system with the copy: prefix. > +(define png-file? > + ((@@ (guix build utils) file-header-match) %png-magic-bytes)) Likewise import (guix build utils) directly. > +(define (lower-mod name . arguments) > + (define lower (build-system-lower gnu-build-system)) > + (apply lower > + name > + #:imported-modules %minetest-build-system-modules > + #:modules %default-modules > + #:phases '%standard-phases > + #:implicit-inputs? #f > + ;; Mods are architecture-independent. > + #:target #f > + ;; Ensure nothing sneaks into the closure. > + #:allowed-references '() > + (substitute-keyword-arguments arguments > + ((#:native-inputs native-inputs '()) > + (append native-inputs (standard-minetest-packages)))))) This appears a little confusing. On first glance, it does not seem to allow overriding e.g. #:phases, but on a second look using `apply' together with shallowly substituted arguments would enable that. The only thing that's missing imo is that #:implicit-inputs? is not honoured for (standard-minetest-packages) -- I think you might want to rectify that. Otherwise looks pretty good to me.