mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
gnu: commencement: Add git-fetch-from-tarball utility.
* gnu/packages/commencement.scm (git-fetch-from-tarball): New procedure.
This commit is contained in:
parent
85f940b0e7
commit
ed88588931
1 changed files with 35 additions and 0 deletions
|
@ -57,7 +57,10 @@ (define-module (gnu packages commencement)
|
|||
#: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 @@ (define-module (gnu packages commencement)
|
|||
;;;
|
||||
;;; 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")
|
||||
|
|
Loading…
Reference in a new issue