GNU bug report logs - #59709
[PATCH] gnu: Add rpi-imager.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Wed, 30 Nov 2022 01:29:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59709 in the body.
You can then email your comments to 59709 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#59709; Package guix-patches. (Wed, 30 Nov 2022 01:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 30 Nov 2022 01:29:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH] gnu: Add rpi-imager.
Date: Tue, 29 Nov 2022 20:28:28 -0500
* gnu/packages/flashing-tools.scm (rpi-imager): New variable.
---
 gnu/packages/flashing-tools.scm | 88 +++++++++++++++++++++++++++++++++
 1 file changed, 88 insertions(+)

diff --git a/gnu/packages/flashing-tools.scm b/gnu/packages/flashing-tools.scm
index 08300cb860..4bbcd9c4f6 100644
--- a/gnu/packages/flashing-tools.scm
+++ b/gnu/packages/flashing-tools.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2021 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2021 Mathieu Othacehe <othacehe <at> gnu.org>
 ;;; Copyright © 2022 Peter Polidoro <peter <at> polidoro.io>
+;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@
 (define-module (gnu packages flashing-tools)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix packages)
   #:use-module (guix utils)
@@ -36,21 +38,26 @@ (define-module (gnu packages flashing-tools)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system qt)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages admin)
+  #:use-module (gnu packages backup)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages groff)
+  #:use-module (gnu packages guile)
   #:use-module (gnu packages pciutils)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages libftdi)
+  #:use-module (gnu packages linux)
   #:use-module (gnu packages pciutils)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages tls))
@@ -295,6 +302,87 @@ (define-public rkflashtool
 RK3036, RK3066, RK312X, RK3168, RK3188, RK3288, RK3368.")
       (license license:bsd-2))))
 
+(define-public rpi-imager
+  (package
+    (name "rpi-imager")
+    (version "1.7.3")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/raspberrypi/rpi-imager")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (modules '((guix build utils)
+                         (ice-9 ftw)
+                         (srfi srfi-26)))
+              (snippet '(begin
+                          ;; Remove all but the following bundled libraries,
+                          ;; which are not yet packaged in Guix.
+                          (define keep '("." ".."
+                                         "drivelist"
+                                         "mountutils"
+                                         "sha256crypt"))
+                          (with-directory-excursion "src/dependencies"
+                            (for-each delete-file-recursively
+                                      (scandir "." (negate
+                                                    (cut member <> keep)))))))
+              (sha256
+               (base32
+                "0i7r1myhinhlgispq92nzvrjvbc48l87z8xfwc038l44qj1lsq8g"))))
+    (build-system qt-build-system)
+    (arguments
+     (list
+      #:tests? #f                       ;no test suite
+      #:configure-flags #~(list "-DENABLE_TELEMETRY=OFF")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'chdir
+            (lambda _
+              (chdir "src")))
+          (add-after 'chdir 'customize-os-list.json
+            ;; The default operating system JSON list contains non-FSDG
+            ;; systems.
+            (lambda _
+              (let* ((datadir (string-append #$output
+                                             "/share/rpi-imager"))
+                     (os-list.json (string-append datadir "/os-list.json")))
+                (mkdir-p datadir)
+                #$(with-extensions (list guile-json-4)
+                    #~(begin
+                        (use-modules (json))
+                        (call-with-output-file os-list.json
+                          ;; TODO: Register FSDG and RPi compatible OS
+                          ;; images here.
+                          (lambda (port)
+                            (scm->json '() port)))))
+                (substitute* "config.h"
+                  (("#define OSLIST_URL.*")
+                   (string-append "#define OSLIST_URL \"file:///"
+                                  os-list.json "\"\n"))))))
+          (add-after 'chdir 'patch-cmake
+            (lambda _
+              (substitute* "CMakeLists.txt"
+                ;; lsblk expects to have access to /sys/dev/block,
+                ;; which doesn't exist in the build container;
+                ;; prevent the check to fail the build.
+                (("ret EQUAL \"1\"")
+                 "FALSE")))))))
+    (inputs
+     (list gnutls
+           curl
+           libarchive
+           qtdeclarative-5
+           qtquickcontrols2-5
+           qtsvg-5
+           qttools-5
+           util-linux))
+    (home-page "https://github.com/raspberrypi/rpi-imager/")
+    (synopsis "Raspberry Pi Imaging Utility")
+    (description "A graphical utility to easily provision and flash a memory
+card with an operating system image suitable for the Raspberry Pi single board
+computer.")
+    (license license:asl2.0)))
+
 (define-public heimdall
   (package
     (name "heimdall")

base-commit: b4be83b6ac7e2139bec5d3eaafcf8af6cbe50856
-- 
2.38.1





Information forwarded to guix-patches <at> gnu.org:
bug#59709; Package guix-patches. (Fri, 09 Dec 2022 02:52:02 GMT) Full text and rfc822 format available.

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

From: 宋文武 <iyzsong <at> envs.net>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 59709 <at> debbugs.gnu.org
Subject: Re: bug#59709: [PATCH] gnu: Add rpi-imager.
Date: Fri, 09 Dec 2022 10:51:46 +0800
Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> * gnu/packages/flashing-tools.scm (rpi-imager): New variable.
> [...]
> +    (synopsis "Raspberry Pi Imaging Utility")
> +    (description "A graphical utility to easily provision and flash a memory
> +card with an operating system image suitable for the Raspberry Pi single board
> +computer.")

Doesn't we require description to be a full sentence?  Like:
  "@command{rpi-imager} is a graphical utility to ..."

Otherwise looks good to me.




Information forwarded to guix-patches <at> gnu.org:
bug#59709; Package guix-patches. (Fri, 09 Dec 2022 20:03:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 宋文武 <iyzsong <at> envs.net>
Cc: 59709 <at> debbugs.gnu.org
Subject: Re: bug#59709: [PATCH] gnu: Add rpi-imager.
Date: Fri, 09 Dec 2022 15:01:50 -0500
Hi,

宋文武 <iyzsong <at> envs.net> writes:

> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
>
>> * gnu/packages/flashing-tools.scm (rpi-imager): New variable.
>> [...]
>> +    (synopsis "Raspberry Pi Imaging Utility")
>> +    (description "A graphical utility to easily provision and flash a memory
>> +card with an operating system image suitable for the Raspberry Pi single board
>> +computer.")
>
> Doesn't we require description to be a full sentence?  Like:
>   "@command{rpi-imager} is a graphical utility to ..."
>
> Otherwise looks good to me.

Oh, indeed.  Copy/paste gone wrong.  Thanks for the review.  I was also
wondering if perhaps (gnu packages raspberry-pi) would be a better home,
given its name.  What do you think?

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#59709; Package guix-patches. (Tue, 13 Dec 2022 06:22:02 GMT) Full text and rfc822 format available.

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

From: 宋文武 <iyzsong <at> envs.net>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 59709 <at> debbugs.gnu.org
Subject: Re: bug#59709: [PATCH] gnu: Add rpi-imager.
Date: Tue, 13 Dec 2022 14:22:15 +0800
Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> I was also wondering if perhaps (gnu packages raspberry-pi) would be a
> better home, given its name.  What do you think?

Yes, I think raspberry-pi.scm is better too!




Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Tue, 13 Dec 2022 15:16:01 GMT) Full text and rfc822 format available.

Notification sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
bug acknowledged by developer. (Tue, 13 Dec 2022 15:16:02 GMT) Full text and rfc822 format available.

Message #19 received at 59709-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 宋文武 <iyzsong <at> envs.net>
Cc: 59709-done <at> debbugs.gnu.org
Subject: Re: bug#59709: [PATCH] gnu: Add rpi-imager.
Date: Tue, 13 Dec 2022 10:15:42 -0500
Hi,

宋文武 <iyzsong <at> envs.net> writes:

> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
>
>> I was also wondering if perhaps (gnu packages raspberry-pi) would be a
>> better home, given its name.  What do you think?
>
> Yes, I think raspberry-pi.scm is better too!

OK!  I've moved the package there and adjusted the description to start
with a complete sentence, and pushed as 93b0c1e35e.

Closing!

-- 
Thanks,
Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 11 Jan 2023 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 102 days ago.

Previous Next


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