From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qOw4GdnmVGFTFQAAgWs5BA (envelope-from ) for ; Thu, 30 Sep 2021 00:21:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id GBbRFNnmVGGlPgAAB5/wlQ (envelope-from ) for ; Wed, 29 Sep 2021 22:21:13 +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 16ECA35285 for ; Thu, 30 Sep 2021 00:21:13 +0200 (CEST) Received: from localhost ([::1]:43248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVhwu-0006jh-5h for larch@yhetil.org; Wed, 29 Sep 2021 18:21:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVhwk-0006e3-Pd for guix-patches@gnu.org; Wed, 29 Sep 2021 18:21:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39170) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVhwk-0001yM-Hr for guix-patches@gnu.org; Wed, 29 Sep 2021 18:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mVhwk-0000iR-EC for guix-patches@gnu.org; Wed, 29 Sep 2021 18:21:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50905] [PATCH 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: Wed, 29 Sep 2021 22:21:02 +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: 50905@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 50905-submit@debbugs.gnu.org id=B50905.16329540072412 (code B ref 50905); Wed, 29 Sep 2021 22:21:02 +0000 Received: (at 50905) by debbugs.gnu.org; 29 Sep 2021 22:20:07 +0000 Received: from localhost ([127.0.0.1]:50647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVhvo-0000c2-Mh for submit@debbugs.gnu.org; Wed, 29 Sep 2021 18:20:06 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:36154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVhvW-0000YW-9u for 50905@debbugs.gnu.org; Wed, 29 Sep 2021 18:19:46 -0400 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id zyKh2500E0mfAB401yKlQs; Thu, 30 Sep 2021 00:19:45 +0200 From: Maxime Devos Date: Thu, 30 Sep 2021 00:19:05 +0200 Message-Id: <20210929221938.17168-5-maximedevos@telenet.be> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210929221938.17168-1-maximedevos@telenet.be> References: <20210929221938.17168-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=1632953985; bh=VVt3ntCLp/UoKgWoBp+TFdwruGuf+mFnPp+kfLWP5Y0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IuYSgdTT2H5PPz6mxdIGKK1JknMtg6UV5IELIcyt+HWVEFioRLLNTyuuirZsNrhog wkj0yy29ymh1gm7nToV+dFyLzVf7CPzoFR54p/S2x9xz3i04aBLGTSHQA4P8X60ntX v9R23NkPRsPNKbK2ciaICTDWLjKFCltXKNJe6/AmTIISap1G+armmkeLhLXue2CSAj jM6zqmr1DcE3VAYC9CCBD3Czb7PxONpPm+ixguYDgnWYOKL4Dv4q/tic1JF1vAcCdT KH6ibdA0IEHBRPX22STAe8n6IR2SajFGsTSfsvTt6Gtt2AjbX/eB+lzBp0sfs4RTh0 IhLim95jTk6Bg== 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=1632954073; 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=SmsBswLV1bS+byMZir8z7RJvgrOEIA0JSQnKb50lgMJQ2QNHYbvlqc34ZPKZKsFW1NcAag pEzkBLosq+KTzDeIO29uI0QviBUnGBEnSfEjLP5IFveTKzgFbWGOmPQIIrj5imHfvcr9A1 BxSXUY94ZakMHUpQQS5uI+FaYuth85Qo9qHp32nU022W1W/rfygluZzQVos9Uq8Tp3qwnO nJe2+LCwglosMcMHxdKNWt4Vv6CimsYDuf4DQYTUDDQAMVPkeGcpugv1zTQMCB8LOLZ3rn ikQgjkGkNBlRfzWcy5UzN3cd7MHlzQOcwTwHoKohRSu8jXyGMMZrvVmG3QqLVA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632954073; a=rsa-sha256; cv=none; b=IObHZ8mqsQtg2Je/2Pgcy9TQGIoUi5e3e+ISrMfq57aRxFq1bhVMxv8LaGVjrTyrGZOBez NpvVharSQrIbS9l7jBIUnr5RU8a4hUTo5AZ53t6TkxH74/98rFkrDiBjkcigvn+k9LqnN4 wXdXGpcx5ar/gLidZH35e4H7oELRlnn0fVQB4bygB5WLGDzijTTrL21rGdzyS7nUdLdfuh MhkjhCla0eb9i0YdoNmVUOwsnMizVXQf6Liz0eDIoWVLbTffLTJLCZd0QYkhmQPWiHgJA9 JovcrKaf9IMzMYuw4bgkMrjtF/hot1NFOuoXjsMmpdupc0sRTeSt8yzyiEl8/w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=IuYSgdTT; 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=IuYSgdTT; 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: 16ECA35285 X-Spam-Score: -0.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: aAXkzQwYek6w 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