* [bug#59709] [PATCH] gnu: Add rpi-imager.
@ 2022-11-30 1:28 Maxim Cournoyer
2022-12-09 2:51 ` 宋文武 via Guix-patches via
0 siblings, 1 reply; 5+ messages in thread
From: Maxim Cournoyer @ 2022-11-30 1:28 UTC (permalink / raw)
To: 59709; +Cc: Maxim Cournoyer
* 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@elephly.net>
;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
;;; Copyright © 2022 Peter Polidoro <peter@polidoro.io>
+;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [bug#59709] [PATCH] gnu: Add rpi-imager.
2022-11-30 1:28 [bug#59709] [PATCH] gnu: Add rpi-imager Maxim Cournoyer
@ 2022-12-09 2:51 ` 宋文武 via Guix-patches via
2022-12-09 20:01 ` Maxim Cournoyer
0 siblings, 1 reply; 5+ messages in thread
From: 宋文武 via Guix-patches via @ 2022-12-09 2:51 UTC (permalink / raw)
To: Maxim Cournoyer; +Cc: 59709
Maxim Cournoyer <maxim.cournoyer@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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [bug#59709] [PATCH] gnu: Add rpi-imager.
2022-12-09 2:51 ` 宋文武 via Guix-patches via
@ 2022-12-09 20:01 ` Maxim Cournoyer
2022-12-13 6:22 ` 宋文武 via Guix-patches via
0 siblings, 1 reply; 5+ messages in thread
From: Maxim Cournoyer @ 2022-12-09 20:01 UTC (permalink / raw)
To: 宋文武; +Cc: 59709
Hi,
宋文武 <iyzsong@envs.net> writes:
> Maxim Cournoyer <maxim.cournoyer@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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [bug#59709] [PATCH] gnu: Add rpi-imager.
2022-12-09 20:01 ` Maxim Cournoyer
@ 2022-12-13 6:22 ` 宋文武 via Guix-patches via
2022-12-13 15:15 ` bug#59709: " Maxim Cournoyer
0 siblings, 1 reply; 5+ messages in thread
From: 宋文武 via Guix-patches via @ 2022-12-13 6:22 UTC (permalink / raw)
To: Maxim Cournoyer; +Cc: 59709
Maxim Cournoyer <maxim.cournoyer@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!
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#59709: [PATCH] gnu: Add rpi-imager.
2022-12-13 6:22 ` 宋文武 via Guix-patches via
@ 2022-12-13 15:15 ` Maxim Cournoyer
0 siblings, 0 replies; 5+ messages in thread
From: Maxim Cournoyer @ 2022-12-13 15:15 UTC (permalink / raw)
To: 宋文武; +Cc: 59709-done
Hi,
宋文武 <iyzsong@envs.net> writes:
> Maxim Cournoyer <maxim.cournoyer@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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-12-13 15:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30 1:28 [bug#59709] [PATCH] gnu: Add rpi-imager Maxim Cournoyer
2022-12-09 2:51 ` 宋文武 via Guix-patches via
2022-12-09 20:01 ` Maxim Cournoyer
2022-12-13 6:22 ` 宋文武 via Guix-patches via
2022-12-13 15:15 ` bug#59709: " Maxim Cournoyer
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.