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 ms11 with LMTPS id OOzAGoeot151GgAA0tVLHw (envelope-from ) for ; Sun, 10 May 2020 07:08:55 +0000 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 2Po5NJSot15TPwAAB5/wlQ (envelope-from ) for ; Sun, 10 May 2020 07:09:08 +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 9384E940B28 for ; Sun, 10 May 2020 07:09:06 +0000 (UTC) Received: from localhost ([::1]:57224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXg5B-0004J6-V8 for larch@yhetil.org; Sun, 10 May 2020 03:09:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXg58-0004In-GJ for guix-patches@gnu.org; Sun, 10 May 2020 03:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37262) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXg58-0003RH-7N for guix-patches@gnu.org; Sun, 10 May 2020 03:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jXg58-0000ed-0l for guix-patches@gnu.org; Sun, 10 May 2020 03:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41163] [PATCH] gnu: grub: Allow a PNG image and replace (aspect-ratio) with (resolution). Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 10 May 2020 07:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41163 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Stefan Cc: 41163@debbugs.gnu.org Received: via spool by 41163-submit@debbugs.gnu.org id=B41163.15890944872442 (code B ref 41163); Sun, 10 May 2020 07:09:01 +0000 Received: (at 41163) by debbugs.gnu.org; 10 May 2020 07:08:07 +0000 Received: from localhost ([127.0.0.1]:48808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXg4E-0000dK-Uq for submit@debbugs.gnu.org; Sun, 10 May 2020 03:08:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jXg4D-0000co-1F for 41163@debbugs.gnu.org; Sun, 10 May 2020 03:08:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39274) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXg45-0002rw-Og; Sun, 10 May 2020 03:07:57 -0400 Received: from [2a01:cb18:832e:5f00:708f:4d20:5fc9:ae90] (port=38578 helo=meru) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jXg45-0003WU-Bo; Sun, 10 May 2020 03:07:57 -0400 From: Mathieu Othacehe References: Date: Sun, 10 May 2020 09:07:54 +0200 In-Reply-To: (Stefan's message of "Sun, 10 May 2020 00:44:16 +0200") Message-ID: <87y2q0i7xx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) 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-Scanner: scn0 X-Spam-Score: -1.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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-Scan-Result: default: False [-1.01 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.53901735892871]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.08), country: US(-0.00), ip: 209.51.188.17(-0.54)]; DWL_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[othacehe@gnu.org,guix-patches-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[gnu.org]; HAS_LIST_UNSUB(-0.01)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; RCVD_COUNT_SEVEN(0.00)[9]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: aBcwVSGuIGG7 Hello Stefan, For some reason I cannot apply this patch. Could you send an updated revision based on master? A few comments below: > * gnu/bootloaders/grub.scm ()[resolution]: Replacement of the > 'aspect-ratio' field. You can write something like: * gnu/bootloaders/grub.scm ()[aspect-ratio]: Remove this field and replace it by ... [resolution]: ... this field. > + (resolution grub-image-resolution > + (default '(1024 . 768))) > + (file grub-image-file > + (default (file-append %artwork-repository > + "/grub/GuixSD-fully-black-4-3.svg")))) I'm not sure about defaulting to this file. This record is meant to describe a generic image. Could you keep this empty? > (define* (svg->png svg #:key width height) > - "Build a PNG of HEIGHT x WIDTH from SVG." > + "Build a PNG of HEIGHT x WIDTH from SVG if its file suffix is \".svg\". I'm not sure having "svg->png" handle other file types than ".svg" is very clear. > + #~(if (string-suffix? ".svg" #+svg) > + (begin > + (use-modules (gnu build svg)) > + (svg->png #+svg #$output > + #:width #$width > + #:height #$height)) > + (copy-file #+svg #$output)))))) You could move this check to "grub-background-image" procedure. So that "svg->png" only deals with ".svg" files. > + (let ((resolution (grub-image-resolution image))) > + (svg->png (grub-image-file image) > + #:width (car resolution) > + #:height (cdr resolution)))))) "car" and "cdr" should be avoided. You can write something like that instead: --8<---------------cut here---------------start------------->8--- (match resolution ((width . height) (svg->png (grub-image-file image) #:width width #:height height))) --8<---------------cut here---------------end--------------->8--- Thanks for this patch, Mathieu