From 604e23fe8f2c624a70bdc26cd829dce539778323 Mon Sep 17 00:00:00 2001 From: Petr Hodina Date: Sun, 18 Jul 2021 12:33:07 +0200 Subject: [PATCH 1/3] gnu: Add pmbootstrap. * gnu/packages/python-xyz.scm (pmbootstrap): New variable. diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 6132019a53..8c33364c40 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -1178,6 +1178,65 @@ (define-public python-shortuuid module and then similar looking characters are removed.") (license license:bsd-3))) +(define-public pmbootstrap + (package + (name "pmbootstrap") + (version "1.44.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pmbootstrap" version)) + (sha256 + (base32 + "0hzfgf085b4h2pmbgfkx25sxq9a27m1l77jx7in48vfv8lihmhzh")))) + (build-system python-build-system) + (arguments + (list #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'replace-programs + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "pmb/chroot/apk_static.py" + (("\"openssl\"") (string-append "\"" #$openssl + "/bin/openssl\""))) + (substitute* "pmb/config/__init__.py" + (("\"git\"") (string-append "\"" #$git + "/bin/git\"")) + (("\"openssl\"") (string-append "\"" #$openssl + "/bin/openssl\"")) + (("\"ps\"") (string-append "\"" #$procps + "/bin/ps\""))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + ;(add-installed-pythonpath inputs outputs) + (when tests? + ;; To import pmb_test module + (setenv "PYTHONPATH" + (string-append (assoc-ref %outputs "out") "/test/pmb_test:" + (getenv "PYTHONPATH"))) + (invoke "pytest" "-vv")))) + ;; Circular dependency with pmbootstrap + (delete 'sanity-check)))) + (native-inputs (list python-pytest)) + (inputs (list git procps openssl)) + (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.35.1