mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-28 14:01:29 -05:00
svn-download: Pass parameters through environment variables.
This ensures a single "svn-download" script is created in the store for all the origins that use 'svn-fetch'. * guix/svn-download.scm (svn-fetch)[build]: Check for environment variables instead of splicing REF fields. Pass #:script-name and #:env-vars to 'gexp->derivation'.
This commit is contained in:
parent
ec7ba6ae53
commit
8599fccef8
1 changed files with 33 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2014, 2015, 2016, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2014-2016, 2019, 2021-2022 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
|
;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
|
||||||
;;; Copyright © 2017, 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
|
;;; Copyright © 2017, 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
|
||||||
;;;
|
;;;
|
||||||
|
@ -79,17 +79,42 @@ (define build
|
||||||
(with-imported-modules '((guix build svn)
|
(with-imported-modules '((guix build svn)
|
||||||
(guix build utils))
|
(guix build utils))
|
||||||
#~(begin
|
#~(begin
|
||||||
(use-modules (guix build svn))
|
(use-modules (guix build svn)
|
||||||
(svn-fetch '#$(svn-reference-url ref)
|
(ice-9 match))
|
||||||
'#$(svn-reference-revision ref)
|
|
||||||
|
(svn-fetch (getenv "svn url")
|
||||||
|
(string->number (getenv "svn revision"))
|
||||||
#$output
|
#$output
|
||||||
#:svn-command (string-append #+svn "/bin/svn")
|
#:svn-command #+(file-append svn "/bin/svn")
|
||||||
#:recursive? #$(svn-reference-recursive? ref)
|
#:recursive? (match (getenv "svn recursive?")
|
||||||
#:user-name #$(svn-reference-user-name ref)
|
("yes" #t)
|
||||||
#:password #$(svn-reference-password ref)))))
|
(_ #f))
|
||||||
|
#:user-name (getenv "svn user name")
|
||||||
|
#:password (getenv "svn password")))))
|
||||||
|
|
||||||
(mlet %store-monad ((guile (package->derivation guile system)))
|
(mlet %store-monad ((guile (package->derivation guile system)))
|
||||||
(gexp->derivation (or name "svn-checkout") build
|
(gexp->derivation (or name "svn-checkout") build
|
||||||
|
|
||||||
|
;; Use environment variables and a fixed script name so
|
||||||
|
;; there's only one script in store for all the
|
||||||
|
;; downloads.
|
||||||
|
#:script-name "svn-download"
|
||||||
|
#:env-vars
|
||||||
|
`(("svn url" . ,(svn-reference-url ref))
|
||||||
|
("svn revision"
|
||||||
|
. ,(number->string (svn-reference-revision ref)))
|
||||||
|
,@(if (svn-reference-recursive? ref)
|
||||||
|
`(("svn recursive?" . "yes"))
|
||||||
|
'())
|
||||||
|
,@(if (svn-reference-user-name ref)
|
||||||
|
`(("svn user name"
|
||||||
|
. ,(svn-reference-user-name ref)))
|
||||||
|
'())
|
||||||
|
,@(if (svn-reference-password ref)
|
||||||
|
`(("svn password"
|
||||||
|
. ,(svn-reference-password ref)))
|
||||||
|
'()))
|
||||||
|
|
||||||
#:system system
|
#:system system
|
||||||
#:hash-algo hash-algo
|
#:hash-algo hash-algo
|
||||||
#:hash hash
|
#:hash hash
|
||||||
|
|
Loading…
Reference in a new issue