[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/08: gnu: commencement: Add git-fetch-from-tarball utility.
From: |
guix-commits |
Subject: |
03/08: gnu: commencement: Add git-fetch-from-tarball utility. |
Date: |
Wed, 19 Jul 2023 01:52:11 -0400 (EDT) |
janneke pushed a commit to branch master
in repository guix.
commit ed88588931bafd6595cc038b9aeb5e8ff37561a8
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Jul 18 12:49:28 2023 +0200
gnu: commencement: Add git-fetch-from-tarball utility.
* gnu/packages/commencement.scm (git-fetch-from-tarball): New procedure.
---
gnu/packages/commencement.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index d0603e62c8..bec3db43e3 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -57,7 +57,10 @@
#:use-module (gnu packages xml)
#:use-module (guix gexp)
#:use-module (guix packages)
+ #:use-module ((guix store) #:select (%store-monad))
+ #:use-module (guix monads)
#:use-module (guix download)
+ #:use-module ((guix git-download) #:select (git-reference git-file-name))
#:use-module (guix build-system gnu)
#:use-module (guix build-system trivial)
#:use-module ((guix licenses) #:prefix license:)
@@ -90,6 +93,38 @@
;;;
;;; Code:
+(define* (git-fetch-from-tarball tarball)
+ "Return an <origin> method equivalent to 'git-fetch', except that it fetches
+the checkout from TARBALL, a tarball containing said checkout.
+
+ The purpose of this procedure is to work around bootstrapping issues:
+'git-fetch' depends on Git, which is much higher in the dependency graph."
+ (lambda* (url hash-algo hash
+ #:optional name
+ #:key (system (%current-system))
+ (guile %bootstrap-guile))
+ (mlet %store-monad ((guile (package->derivation guile system)))
+ (gexp->derivation
+ (or name "git-checkout")
+ (with-imported-modules '((guix build utils))
+ #~(begin
+ (use-modules (guix build utils)
+ (ice-9 ftw)
+ (ice-9 match))
+ (setenv "PATH"
+ #+(file-append %bootstrap-coreutils&co "/bin"))
+ (invoke "tar" "xf" #$tarball)
+ (match (scandir ".")
+ (("." ".." directory)
+ (copy-recursively directory #$output)))))
+ #:recursive? #t
+ #:hash-algo hash-algo
+ #:hash hash
+ #:system system
+ #:guile-for-build guile
+ #:graft? #f
+ #:local-build? #t))))
+
(define bootar
(package
(name "bootar")
- branch master updated (13cb9b3028 -> 8831d3ba9f), guix-commits, 2023/07/19
- 05/08: gnu: commencement: mig-boot0: Update to 1.8+git20230520., guix-commits, 2023/07/19
- 03/08: gnu: commencement: Add git-fetch-from-tarball utility.,
guix-commits <=
- 01/08: gnu: commencement: Add autoconf-boot0., guix-commits, 2023/07/19
- 08/08: gnu: commencement: hurd-minimal-boot0: Update to 0.9.git20230216., guix-commits, 2023/07/19
- 04/08: gnu: commencement: gnumach-headers-boot0: Update to 1.8+git20221224., guix-commits, 2023/07/19
- 02/08: gnu: commencement: Add automake-boot0., guix-commits, 2023/07/19
- 07/08: gnu: commencement: hurd-headers-boot0: Update to 0.9.git20230216., guix-commits, 2023/07/19
- 06/08: gnu: mig: Use git-fetch., guix-commits, 2023/07/19