projects/guix·blob python-team · refs

107 lines · 4.8 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2023 Sughosha <[email protected]>
3;;; Copyright © 2025 Herman Rimm <[email protected]>
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
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 ;; The first two tests require a pmaports git repository in the workdir.
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 ;; RuntimeError: No package repositories specified?
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)) ; for losetup
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
106to develop and install postmarketOS.")
107 (license license:gpl3+)))