| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 |
|
| 20 | (define-module (gnu packages postmarketos)
|
| 21 | #:use-module (gnu packages admin)
|
| 22 | #:use-module (gnu packages android)
|
| 23 | #:use-module (gnu packages base)
|
| 24 | #:use-module (gnu packages bash)
|
| 25 | #:use-module (gnu packages check)
|
| 26 | #:use-module (gnu packages linux)
|
| 27 | #:use-module (gnu packages python-build)
|
| 28 | #:use-module (gnu packages tls)
|
| 29 | #:use-module (gnu packages version-control)
|
| 30 | #:use-module (guix build-system pyproject)
|
| 31 | #:use-module (guix gexp)
|
| 32 | #:use-module (guix git-download)
|
| 33 | #:use-module ((guix licenses) #:prefix license:)
|
| 34 | #:use-module (guix packages)
|
| 35 | #:use-module (ice-9 match))
|
| 36 |
|
| 37 | (define-public pmbootstrap
|
| 38 | (package
|
| 39 | (name "pmbootstrap")
|
| 40 | (version "3.6.0")
|
| 41 | (source
|
| 42 | (origin
|
| 43 | (method git-fetch)
|
| 44 | (uri (git-reference
|
| 45 | (url (string-append "https://gitlab.postmarketos.org/"
|
| 46 | "postmarketOS/pmbootstrap.git"))
|
| 47 | (commit version)))
|
| 48 | (file-name (git-file-name name version))
|
| 49 | (sha256
|
| 50 | (base32 "161q8nr9vwa7bbi5d7bqan0h7dn573xqmr48iadr3km897d3ivdh"))))
|
| 51 | (build-system pyproject-build-system)
|
| 52 | (arguments
|
| 53 | (list
|
| 54 | #:modules '((guix build pyproject-build-system)
|
| 55 | (guix build utils)
|
| 56 | (ice-9 match))
|
| 57 | #:phases #~(modify-phases %standard-phases
|
| 58 | (add-after 'unpack 'set-sudo
|
| 59 | (lambda _
|
| 60 | (substitute* "pmb/config/sudo.py"
|
| 61 | (("sudo\"") "/run/privileged/bin/sudo\""))))
|
| 62 | (add-after 'wrap 'wrap-required-programs
|
| 63 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 64 | (wrap-program (string-append #$output
|
| 65 | "/bin/pmbootstrap")
|
| 66 | '("PATH" ":" prefix
|
| 67 | #$(map (match-lambda
|
| 68 | ((input directory)
|
| 69 | (file-append (this-package-input input)
|
| 70 | "/" directory)))
|
| 71 | '(("bash-minimal" "bin")
|
| 72 | ("coreutils-minimal" "bin")
|
| 73 | ("git-minimal" "bin")
|
| 74 | ("multipath-tools" "sbin")
|
| 75 | ("openssl" "bin")
|
| 76 | ("procps" "bin")
|
| 77 | ("tar" "bin")
|
| 78 | ("util-linux" "bin")
|
| 79 | ("util-linux" "sbin"))))))))
|
| 80 | |
| 81 | #:test-flags #~(list (string-append "--deselect=test/core/test_pkgrepo"
|
| 82 | ".py::test_pkgrepo_pmaports")
|
| 83 | (string-append "--deselect=test/parse/test_bootimg"
|
| 84 | ".py::test_bootimg")
|
| 85 | |
| 86 | (string-append "--deselect=test/parse/"
|
| 87 | "test_deviceinfo.py::"
|
| 88 | "test_random_valid_deviceinfos"))))
|
| 89 | (native-inputs (list mkbootimg
|
| 90 | python-pytest
|
| 91 | python-setuptools
|
| 92 | python-wheel
|
| 93 | util-linux)) |
| 94 | (inputs (list bash-minimal
|
| 95 | coreutils-minimal
|
| 96 | git-minimal
|
| 97 | multipath-tools
|
| 98 | openssl
|
| 99 | procps
|
| 100 | tar
|
| 101 | util-linux))
|
| 102 | (home-page "https://gitlab.com/postmarketOS/pmbootstrap")
|
| 103 | (synopsis "Bootstrap a postmarketOS system")
|
| 104 | (description
|
| 105 | "This package provides a sophisticated chroot, build and flash tool
|
| 106 | to develop and install postmarketOS.")
|
| 107 | (license license:gpl3+)))
|