GNU bug report logs - #49828
[PATCH 00/20] Add minetest mods

Previous Next

Package: guix-patches;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Mon, 2 Aug 2021 15:48:02 UTC

Severity: normal

Tags: patch

Done: Leo Prikler <leo.prikler <at> student.tugraz.at>

Bug is archived. No further changes may be made.

Full log


Message #107 received at 49828 <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: Maxime Devos <maximedevos <at> telenet.be>, 49828 <at> debbugs.gnu.org
Subject: Re: [PATCH 05/20] build-system: minetest: Don't retain references
 to "bash-minimal".
Date: Thu, 05 Aug 2021 14:04:07 +0200
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.





This bug report was last modified 3 years and 330 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.