From 5443a12dc08936a7facab4b1b85953624a29df24 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sun, 18 Jul 2021 12:33:07 +0200
Subject: [PATCH v4] gnu: Add pmbootstrap.
* gnu/packages/python-xyz.scm (pmbootstrap): New variable.
@@ -153,6 +153,7 @@ (define-module (gnu packages python-xyz)
#:use-module (gnu packages)
#:use-module (gnu packages algebra)
#:use-module (gnu packages adns)
+ #:use-module (gnu packages admin)
#:use-module (gnu packages aidc)
#:use-module (gnu packages attr)
#:use-module (gnu packages backup)
@@ -1458,6 +1459,56 @@ (define-public python-shortuuid
module and then similar looking characters are removed.")
(license license:bsd-3)))
+(define-public pmbootstrap
+ (package
+ (name "pmbootstrap")
+ (version "1.50.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/postmarketOS/pmbootstrap")
+ (commit version)))
+ (sha256
+ (base32
+ "0n26zbpw7nhyh9gq0ydgij7m4pgv2n5wlmyc7g2sr7gqhqv04j2j"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:tests? #f ; TODO: many test fail
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'install 'fix-paths
+ (lambda* _
+ (let ((git (string-append #$git "/bin/"))
+ (procps (string-append #$procps "/bin"))
+ (openssl (string-append #$openssl "/bin"))
+ (sudo "/run/setuid-programs"))
+ (wrap-program (string-append #$output
+ "/bin/pmbootstrap")
+ `("PATH" ":" suffix
+ ,(list git procps openssl sudo))))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "pytest")))))))
+ (native-inputs (list python-pytest python-pyopenssl))
+ (inputs (list git procps openssl sudo))
+ (home-page "https://postmarketos.org")
+ (synopsis "Build and flash tool for postmarketOS")
+ (description
+ "Bootstrap program that abstracts everything in chroots and therefore
+basically runs on top of any Linux distribution. Features:
+@enumerate
+@item chroot setup (distro-independent QEMU user emulation
+@item clean chroot shutdown (umount) and zapping
+@item build software as packages
+@item cross-compile all armhf-packages
+@item effective caching out of the box (survives chroot zaps)
+@item installation targets
+@item flasher abstractions
+@item logging
+@item security
+@end enumerate")
+ (license license:gpl3+)))
+
(define-public python-logwrap
(package
(name "python-logwrap")
--
2.37.2