From patchwork Sat May 31 08:32:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 42961 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7887A27BC49; Sat, 31 May 2025 09:34:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6E48927BC4A for ; Sat, 31 May 2025 09:34:20 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uLHfL-0006Zl-DY; Sat, 31 May 2025 04:34:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uLHfI-0006ZQ-Vk for guix-patches@gnu.org; Sat, 31 May 2025 04:34:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uLHfI-0005Gn-La for guix-patches@gnu.org; Sat, 31 May 2025 04:34:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=7ct1DwaiBPJqYAtlEWCr7o8n1Tlc07Wwftgf+3wZgGE=; b=XpN7JO4UEkeYbWAV+LtD6keEb7FkqR0KAV4z3TuxbY+5ER05BGcEMU7IpvdSfJtU/U/NR4WO9JPQqByp3r32YO/L/txigXzQsMcTATMJXa3aYfNQ8o1SvxGZuOl2uuoVx5Yyx5lKx0YU7RYLwzuHRKJIZhsjib2jmen/2EgEDeWWHw+ii9nEMmMky2vcbD/BY2eXtuT5J54hG22uyH9IcUBNFZ81h1Qn1g2IE0enROoMdZ01mlDe9EUP4YZXdsoMHFcm9iWZYx/mBbc/6wqhxJposILU10K5W/jfXEL84SEsKDW/uIGQoyFXKmm/k5bDyo3MsgcBvET3cNZGwyUpjQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uLHfH-0006NP-Hd for guix-patches@gnu.org; Sat, 31 May 2025 04:34:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62640] [PATCH v5] gnu: Add pmbootstrap. References: In-Reply-To: Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 31 May 2025 08:34:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62640 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62640@debbugs.gnu.org Cc: =?utf-8?b?QW5kcsOp?= Batista , Sughosha Received: via spool by 62640-submit@debbugs.gnu.org id=B62640.174868043524423 (code B ref 62640); Sat, 31 May 2025 08:34:03 +0000 Received: (at 62640) by debbugs.gnu.org; 31 May 2025 08:33:55 +0000 Received: from localhost ([127.0.0.1]:55366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uLHf6-0006LY-Bi for submit@debbugs.gnu.org; Sat, 31 May 2025 04:33:54 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:46917 helo=email.rimm.ee) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uLHf0-0006JL-Sq for 62640@debbugs.gnu.org; Sat, 31 May 2025 04:33:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1748680418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7ct1DwaiBPJqYAtlEWCr7o8n1Tlc07Wwftgf+3wZgGE=; b=mYTzprWIfvB9rhytaL+EJljA9BRdo0aS2p9NWgUHFkBv2JkFbHXGnYNbLBRh2c2xV8Rlje btfZNHPaD2iHcuEm0aT9BH6DzDeu1UgzB2KliVx69fa8++9Ozz9NWa+0ky1FQ/MXVvYqgR E2z4Lo54ao9Qm+FLj49+NI7olAm9TQ1csoy3tgBPEg7h5xlWPprlTCcyYPtzOpimOkIfB2 UcuPWijEFF5WV8hHqDyGSpJBvOOBIjI67mGNmwSEfrmN4TwBlmv3zhigtHfaOflwBZYFum I8z6TmkYlB7yNxw1DjtZMKsFcqMEOXa4DZSW4CwPV7Sk0v8duhp8wsmJ/kF/dA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 34a73e2a (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Sat, 31 May 2025 08:33:38 +0000 (UTC) Date: Sat, 31 May 2025 10:32:15 +0200 Message-ID: <3c4fc10fc9cf18685baf7343fd07b5ad650753c9.1748679476.git.herman@rimm.ee> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Sughosha * gnu/packages/postmarketos.scm: New file. * gnu/packages/local.mk (GNU_SYSTEM_MODULES): Register file. Change-Id: Ib8347dd536738d2ea16a961c85308a0e43b98c1f --- Hi, Thanks again André. The wrap-required-programs phase now uses output, ungexp and this-package-input. I also replaced the coreutils and git inputs with their minimal counterparts, and this still works: $ guix shell --pure pmbootstrap -- pmbootstrap init $ guix shell --pure pmbootstrap -- pmbootstrap export Cheers, Herman gnu/local.mk | 1 + gnu/packages/postmarketos.scm | 107 ++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 gnu/packages/postmarketos.scm base-commit: d3334af3958caad3617df5aa9ebe08c76285f345 diff --git a/gnu/local.mk b/gnu/local.mk index 2948bfb1bff..b56cfe34d75 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -567,6 +567,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/poedit.scm \ %D%/packages/polkit.scm \ %D%/packages/popt.scm \ + %D%/packages/postmarketos.scm \ %D%/packages/potassco.scm \ %D%/packages/power.scm \ %D%/packages/printers.scm \ diff --git a/gnu/packages/postmarketos.scm b/gnu/packages/postmarketos.scm new file mode 100644 index 00000000000..7bb7e788e34 --- /dev/null +++ b/gnu/packages/postmarketos.scm @@ -0,0 +1,107 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023 Sughosha +;;; Copyright © 2025 Herman Rimm +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages postmarketos) + #:use-module (gnu packages admin) + #:use-module (gnu packages android) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages check) + #:use-module (gnu packages linux) + #:use-module (gnu packages python-build) + #:use-module (gnu packages tls) + #:use-module (gnu packages version-control) + #:use-module (guix build-system pyproject) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (ice-9 match)) + +(define-public pmbootstrap + (package + (name "pmbootstrap") + (version "3.4.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url (string-append "https://gitlab.postmarketos.org/" + "postmarketOS/pmbootstrap.git")) + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "16naj8ykipbrs2a93zaxci1wl045cc9jn7rq8sy76d1rqlqb9mmw")))) + (build-system pyproject-build-system) + (arguments + (list + #:modules '((guix build pyproject-build-system) + (guix build utils) + (ice-9 match)) + #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'set-sudo + (lambda _ + (substitute* "pmb/config/sudo.py" + (("sudo\"") "/run/privileged/bin/sudo\"")))) + (add-after 'wrap 'wrap-required-programs + (lambda* (#:key inputs outputs #:allow-other-keys) + (wrap-program (string-append #$output + "/bin/pmbootstrap") + '("PATH" ":" prefix + #$(map (match-lambda + ((input directory) + (file-append (this-package-input input) + "/" directory))) + '(("bash-minimal" "bin") + ("coreutils-minimal" "bin") + ("git-minimal" "bin") + ("multipath-tools" "sbin") + ("openssl" "bin") + ("procps" "bin") + ("tar" "bin") + ("util-linux" "bin") + ("util-linux" "sbin")))))))) + ;; The first two tests require a pmaports git repository in the workdir. + #:test-flags #~(list (string-append "--deselect=test/core/test_pkgrepo" + ".py::test_pkgrepo_pmaports") + (string-append "--deselect=test/parse/test_bootimg" + ".py::test_bootimg") + ;; RuntimeError: No package repositories specified? + (string-append "--deselect=test/parse/" + "test_deviceinfo.py::" + "test_random_valid_deviceinfos")))) + (native-inputs (list mkbootimg + python-pytest + python-setuptools + python-wheel + util-linux)) ; for losetup + (inputs (list bash-minimal + coreutils-minimal + git-minimal + multipath-tools + openssl + procps + tar + util-linux)) + (home-page "https://gitlab.com/postmarketOS/pmbootstrap") + (synopsis "Bootstrap a postmarketOS system") + (description + "This package provides a sophisticated chroot, build and flash tool +to develop and install postmarketOS.") + (license license:gpl3+)))