guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/38: build/minetest-build-system: Move png-file? to (guix build utils)


From: guix-commits
Subject: 05/38: build/minetest-build-system: Move png-file? to (guix build utils).
Date: Sat, 2 Oct 2021 12:52:38 -0400 (EDT)

mothacehe pushed a commit to branch core-updates
in repository guix.

commit 8a55fde935cc9bcf2c098cc7bff05c32d80da174
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Fri Oct 1 16:21:07 2021 +0200

    build/minetest-build-system: Move png-file? to (guix build utils).
    
    It's not really Minetest-specific.  It was only placed in
    (guix build minetest-build-system) to avoid a world rebuild.
    
    * guix/build/minetest-build-system.scm (%png-magic-bytes,png-file?):
      Move to ...
    * guix/build/utils.scm (%png-magic-bytes,png-file?): ... here.
    
    Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
---
 guix/build/minetest-build-system.scm |  9 ---------
 guix/build/utils.scm                 | 11 +++++++++++
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/guix/build/minetest-build-system.scm 
b/guix/build/minetest-build-system.scm
index 477cc3d..5d7d8d2 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -90,15 +90,6 @@ If it is unknown, make an educated guess."
          #:install-plan (mod-install-plan (apply guess-mod-name arguments))
          arguments))
 
-(define %png-magic-bytes
-  ;; Magic bytes of PNG images, see ‘5.2 PNG signatures’ in
-  ;; ‘Portable Network Graphics (PNG) Specification (Second Edition)’
-  ;; on <https://www.w3.org/TR/PNG/>.
-  #vu8(137 80 78 71 13 10 26 10))
-
-(define png-file?
-  ((@@ (guix build utils) file-header-match) %png-magic-bytes))
-
 (define* (minimise-png #:key inputs native-inputs #:allow-other-keys)
   "Minimise PNG images found in the working directory."
   (define optipng (which "optipng"))
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 3beb7da..39e581b 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -61,6 +61,8 @@
             symbolic-link?
             call-with-temporary-output-file
             call-with-ascii-input-file
+            file-header-match
+            png-file?
             elf-file?
             ar-file?
             gzip-file?
@@ -290,6 +292,15 @@ with the bytes in HEADER, a bytevector."
             #f                                    ;FILE is a directory
             (apply throw args))))))
 
+(define %png-magic-bytes
+  ;; Magic bytes of PNG images, see ‘5.2 PNG signatures’ in
+  ;; ‘Portable Network Graphics (PNG) Specification (Second Edition)’
+  ;; on <https://www.w3.org/TR/PNG/>.
+  #vu8(137 80 78 71 13 10 26 10))
+
+(define png-file?
+  (file-header-match %png-magic-bytes))
+
 (define %elf-magic-bytes
   ;; Magic bytes of ELF files.  See <elf.h>.
   (u8-list->bytevector (map char->integer (string->list "\x7FELF"))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]