Use guile-zlib extension in build-side code.
* Makefile.am (MODULES): Move guix/build/download-nar.scm to ... (MODULES_NOT_COMPILED): ... here. * guix/build/download-nar.scm: Use (zlib) instead of (guix zlib). * guix/cvs-download.scm (cvs-fetch): Do not stub (guix config) in imported modules list, instead add "guile-zlib" to the extension list. * guix/git-download.scm (git-fetch): Ditto. * guix/hg-download.scm (hg-fetch): Do not stub (guix config) in imported modules list, instead add "guile-zlib" to the extension list.
This commit is contained in:
parent
c6872990b5
commit
e9f8a7e215
4 changed files with 40 additions and 67 deletions
|
@ -20,7 +20,7 @@
|
||||||
#:use-module (guix build download)
|
#:use-module (guix build download)
|
||||||
#:use-module (guix build utils)
|
#:use-module (guix build utils)
|
||||||
#:use-module ((guix serialization) #:hide (dump-port*))
|
#:use-module ((guix serialization) #:hide (dump-port*))
|
||||||
#:use-module (guix zlib)
|
#:autoload (zlib) (call-with-gzip-input-port)
|
||||||
#:use-module (guix progress)
|
#:use-module (guix progress)
|
||||||
#:use-module (web uri)
|
#:use-module (web uri)
|
||||||
#:use-module (srfi srfi-11)
|
#:use-module (srfi srfi-11)
|
||||||
|
|
|
@ -60,35 +60,26 @@
|
||||||
"Return a fixed-output derivation that fetches REF, a <cvs-reference>
|
"Return a fixed-output derivation that fetches REF, a <cvs-reference>
|
||||||
object. The output is expected to have recursive hash HASH of type
|
object. The output is expected to have recursive hash HASH of type
|
||||||
HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
|
HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
|
||||||
(define zlib
|
(define guile-zlib
|
||||||
(module-ref (resolve-interface '(gnu packages compression)) 'zlib))
|
(module-ref (resolve-interface '(gnu packages guile)) 'guile-zlib))
|
||||||
|
|
||||||
(define config.scm
|
|
||||||
(scheme-file "config.scm"
|
|
||||||
#~(begin
|
|
||||||
(define-module (guix config)
|
|
||||||
#:export (%libz))
|
|
||||||
|
|
||||||
(define %libz
|
|
||||||
#+(file-append zlib "/lib/libz")))))
|
|
||||||
|
|
||||||
(define modules
|
(define modules
|
||||||
(cons `((guix config) => ,config.scm)
|
(delete '(guix config)
|
||||||
(delete '(guix config)
|
(source-module-closure '((guix build cvs)
|
||||||
(source-module-closure '((guix build cvs)
|
(guix build download-nar)))))
|
||||||
(guix build download-nar))))))
|
|
||||||
(define build
|
(define build
|
||||||
(with-imported-modules modules
|
(with-imported-modules modules
|
||||||
#~(begin
|
(with-extensions (list guile-zlib)
|
||||||
(use-modules (guix build cvs)
|
#~(begin
|
||||||
(guix build download-nar))
|
(use-modules (guix build cvs)
|
||||||
|
(guix build download-nar))
|
||||||
|
|
||||||
(or (cvs-fetch '#$(cvs-reference-root-directory ref)
|
(or (cvs-fetch '#$(cvs-reference-root-directory ref)
|
||||||
'#$(cvs-reference-module ref)
|
'#$(cvs-reference-module ref)
|
||||||
'#$(cvs-reference-revision ref)
|
'#$(cvs-reference-revision ref)
|
||||||
#$output
|
#$output
|
||||||
#:cvs-command (string-append #+cvs "/bin/cvs"))
|
#:cvs-command (string-append #+cvs "/bin/cvs"))
|
||||||
(download-nar #$output)))))
|
(download-nar #$output))))))
|
||||||
|
|
||||||
(mlet %store-monad ((guile (package->derivation guile system)))
|
(mlet %store-monad ((guile (package->derivation guile system)))
|
||||||
(gexp->derivation (or name "cvs-checkout") build
|
(gexp->derivation (or name "cvs-checkout") build
|
||||||
|
|
|
@ -84,35 +84,26 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
|
||||||
("tar" ,(module-ref (resolve-interface '(gnu packages base))
|
("tar" ,(module-ref (resolve-interface '(gnu packages base))
|
||||||
'tar)))))
|
'tar)))))
|
||||||
|
|
||||||
(define zlib
|
|
||||||
(module-ref (resolve-interface '(gnu packages compression)) 'zlib))
|
|
||||||
|
|
||||||
(define guile-json
|
(define guile-json
|
||||||
(module-ref (resolve-interface '(gnu packages guile)) 'guile-json-3))
|
(module-ref (resolve-interface '(gnu packages guile)) 'guile-json-3))
|
||||||
|
|
||||||
|
(define guile-zlib
|
||||||
|
(module-ref (resolve-interface '(gnu packages guile)) 'guile-zlib))
|
||||||
|
|
||||||
(define gnutls
|
(define gnutls
|
||||||
(module-ref (resolve-interface '(gnu packages tls)) 'gnutls))
|
(module-ref (resolve-interface '(gnu packages tls)) 'gnutls))
|
||||||
|
|
||||||
(define config.scm
|
|
||||||
(scheme-file "config.scm"
|
|
||||||
#~(begin
|
|
||||||
(define-module (guix config)
|
|
||||||
#:export (%libz))
|
|
||||||
|
|
||||||
(define %libz
|
|
||||||
#+(file-append zlib "/lib/libz")))))
|
|
||||||
|
|
||||||
(define modules
|
(define modules
|
||||||
(cons `((guix config) => ,config.scm)
|
(delete '(guix config)
|
||||||
(delete '(guix config)
|
(source-module-closure '((guix build git)
|
||||||
(source-module-closure '((guix build git)
|
(guix build utils)
|
||||||
(guix build utils)
|
(guix build download-nar)
|
||||||
(guix build download-nar)
|
(guix swh)))))
|
||||||
(guix swh))))))
|
|
||||||
|
|
||||||
(define build
|
(define build
|
||||||
(with-imported-modules modules
|
(with-imported-modules modules
|
||||||
(with-extensions (list guile-json gnutls) ;for (guix swh)
|
(with-extensions (list guile-json gnutls ;for (guix swh)
|
||||||
|
guile-zlib)
|
||||||
#~(begin
|
#~(begin
|
||||||
(use-modules (guix build git)
|
(use-modules (guix build git)
|
||||||
(guix build utils)
|
(guix build utils)
|
||||||
|
|
|
@ -60,35 +60,26 @@
|
||||||
"Return a fixed-output derivation that fetches REF, a <hg-reference>
|
"Return a fixed-output derivation that fetches REF, a <hg-reference>
|
||||||
object. The output is expected to have recursive hash HASH of type
|
object. The output is expected to have recursive hash HASH of type
|
||||||
HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
|
HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
|
||||||
(define zlib
|
(define guile-zlib
|
||||||
(module-ref (resolve-interface '(gnu packages compression)) 'zlib))
|
(module-ref (resolve-interface '(gnu packages guile)) 'guile-zlib))
|
||||||
|
|
||||||
(define config.scm
|
|
||||||
(scheme-file "config.scm"
|
|
||||||
#~(begin
|
|
||||||
(define-module (guix config)
|
|
||||||
#:export (%libz))
|
|
||||||
|
|
||||||
(define %libz
|
|
||||||
#+(file-append zlib "/lib/libz")))))
|
|
||||||
|
|
||||||
(define modules
|
(define modules
|
||||||
(cons `((guix config) => ,config.scm)
|
(delete '(guix config)
|
||||||
(delete '(guix config)
|
(source-module-closure '((guix build hg)
|
||||||
(source-module-closure '((guix build hg)
|
(guix build download-nar)))))
|
||||||
(guix build download-nar))))))
|
|
||||||
|
|
||||||
(define build
|
(define build
|
||||||
(with-imported-modules modules
|
(with-imported-modules modules
|
||||||
#~(begin
|
(with-extensions (list guile-zlib)
|
||||||
(use-modules (guix build hg)
|
#~(begin
|
||||||
(guix build download-nar))
|
(use-modules (guix build hg)
|
||||||
|
(guix build download-nar))
|
||||||
|
|
||||||
(or (hg-fetch '#$(hg-reference-url ref)
|
(or (hg-fetch '#$(hg-reference-url ref)
|
||||||
'#$(hg-reference-changeset ref)
|
'#$(hg-reference-changeset ref)
|
||||||
#$output
|
#$output
|
||||||
#:hg-command (string-append #+hg "/bin/hg"))
|
#:hg-command (string-append #+hg "/bin/hg"))
|
||||||
(download-nar #$output)))))
|
(download-nar #$output))))))
|
||||||
|
|
||||||
(mlet %store-monad ((guile (package->derivation guile system)))
|
(mlet %store-monad ((guile (package->derivation guile system)))
|
||||||
(gexp->derivation (or name "hg-checkout") build
|
(gexp->derivation (or name "hg-checkout") build
|
||||||
|
|
Reference in a new issue