From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AGTvBqIaV2HaEwAAgWs5BA (envelope-from ) for ; Fri, 01 Oct 2021 16:26:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id kK1lAqIaV2EjFgAA1q6Kng (envelope-from ) for ; Fri, 01 Oct 2021 14:26:42 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CE0681B16A for ; Fri, 1 Oct 2021 16:26:41 +0200 (CEST) Received: from localhost ([::1]:44546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWJUm-0002xB-Un for larch@yhetil.org; Fri, 01 Oct 2021 10:26:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWJUF-0002AT-Vw for guix-patches@gnu.org; Fri, 01 Oct 2021 10:26:12 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45415) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWJUC-0000WN-Ve for guix-patches@gnu.org; Fri, 01 Oct 2021 10:26:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWJUC-0005gb-Sa for guix-patches@gnu.org; Fri, 01 Oct 2021 10:26:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50905] [PATCH core-updates v2 05/38] build/minetest-build-system: Move png-file? to (guix build utils). Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Oct 2021 14:26:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50905 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: Maxime Devos , 50905@debbugs.gnu.org Received: via spool by 50905-submit@debbugs.gnu.org id=B50905.163309831321601 (code B ref 50905); Fri, 01 Oct 2021 14:26:04 +0000 Received: (at 50905) by debbugs.gnu.org; 1 Oct 2021 14:25:13 +0000 Received: from localhost ([127.0.0.1]:56911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWJTN-0005cF-Hz for submit@debbugs.gnu.org; Fri, 01 Oct 2021 10:25:13 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:33326) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWJQ4-0005Te-EK for 50905@debbugs.gnu.org; Fri, 01 Oct 2021 10:21:51 -0400 Received: from butterfly.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by andre.telenet-ops.be with bizsmtp id 0eMm260020mfAB401eMnKi; Fri, 01 Oct 2021 16:21:47 +0200 From: Maxime Devos Date: Fri, 1 Oct 2021 16:21:07 +0200 Message-Id: <20211001142140.17027-5-maximedevos@telenet.be> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001142140.17027-1-maximedevos@telenet.be> References: <20211001142140.17027-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1633098107; bh=VVt3ntCLp/UoKgWoBp+TFdwruGuf+mFnPp+kfLWP5Y0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MufgqSwJg6CtKaDs5QTJDgN7fFb5qURLElMUFmVgkmRKrikXNq2XNsnc6iP0qrdpF VDK4+3U+D8JDPBKOeSaYvovPdneLds5u+w6oYKvBMA6cFNVA4ackk3nxTFWSRkN4mX Dk3IfDKK/Sib47CmqkCEc+PWCY+WOrzT+zHvBA8boUHX9omSvKLsYZTpfNiE2QrzY+ z8rhTqJO4lDR1uHlCoJmf3G9MHlGTp3mMJnTulM1E3seimwxZUzNsL3eNIC/luTQwv 4A1uxAvmN/7H1JAizYqL8uR6ybZhcCUfoqjZMSKpGnTr0SdpUXEaIAEyHEhi98+/mX 5kWB+t0z1aVIA== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633098401; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=VVt3ntCLp/UoKgWoBp+TFdwruGuf+mFnPp+kfLWP5Y0=; b=rAqf4Q7Hi438uf3gequOt3/4iiq1OOrbea4RCjeRv9GRXgRBah4AXlPysT8ik/4ItkDeiF xGsjR6VPM9y8FQxwnRfTAaygBLUv4lT2FlG5CALcr/tdYcvZD86frGEwobeG4oMyhniDtY EnZ8PwviOTz6X7R0L8jkW1QkBaLNhuFTA6eK/2d3+oAwLQOToedW/SQcSVMFFJz2LLlD3z nrAl6CLQeyrBD9NFaE/kwV0jqSnU1yzrjc2FwmPfMiVswAX4d2lxtgQia4z8LpQwTxVJsU Bhvh8uVPlh+j30Cpj4vmT0D5fOeph7RNj9xEm4RvxOeBGuTAlPDmBV09WaVyXg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633098401; a=rsa-sha256; cv=none; b=C13LCyUi/R3xKCeDGDVoTRbeuSCfJW5f6NCmgObHtMeO7iJLmE7Ra6X8pRI0Gh6jazVsxn 7kZIfVtuSTofXx1hkjyzuEJy+MBKoHzgdvIb6e2ZYAsuzioKkeiOvYe8tmbSAhTJZwTxIg 4pRywo4LjXqvK30sM3gmrFOF+COutnP4newgd1XIw0sgACfVdPPwuZJhQjR+oc7S4sxCV0 pzBJ8j2HmqU/hEMTquTIJJploV1o4YWAi1o7TB+nB2yxz1wWBqyxjCEwTIB6JGPIBDyvSY LW6LjLecLaUjukQ/IS75yu4hdZIGoefGJ++ltRvehzXLiHEXTsHtdN4jrdd1lQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=MufgqSwJ; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -0.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=MufgqSwJ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: CE0681B16A X-Spam-Score: -0.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: 14YGOP/ag2iu 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. --- 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 477cc3d1d0..5d7d8d2292 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 . - #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 3beb7da67a..39e581b0fa 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 . + #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 . (u8-list->bytevector (map char->integer (string->list "\x7FELF")))) -- 2.33.0