From a18eda2747fa2eb962e3288066d2b1a679589ed3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 30 Mar 2013 22:56:38 +0100 Subject: packages: Add `native-search-paths' field and honor it. * guix/packages.scm (): New record type. (search-path-specification->sexp): New procedure. ()[native-search-paths]: New field. (package-derivation): Accumulate the search paths, and pass them as #:search-paths toe BUILDER. * guix/build-system/gnu.scm (gnu-build): Add #:search-paths. Compute `implicit-search-paths'. Pass #:search-paths in BUILDER. * guix/build-system/perl.scm (perl-build): Add #:search-paths, pass it to BUILDER with the search paths of PERL. * guix/build-system/cmake.scm (cmake-build): Add #:search-paths, pass it to BUILDER. * guix/build-system/trivial.scm (trivial-build): Add #:search-paths, ignore it. * guix/build/gnu-build-system.scm (set-paths): Add #:search-paths. Remove explicit settings of CPATH, LIBRARY_PATH, and PKG_CONFIG_PATH. Instead, walk SEARCH-PATHS and call `set-path-environment-variable' for them. * guix/build/perl-build-system.scm (perl-build): Remove PERL5LIB setting. * tests/packages.scm ("search paths"): New test. * gnu/packages/bootstrap.scm (%bootstrap-guile)[raw]: Add #:search-paths. (%bootstrap-gcc): Add `native-search-paths' field. * gnu/packages/perl.scm (perl): Likewise. * gnu/packages/pkg-config.scm (pkg-config): Likewise. * gnu/packages/glib.scm (intltool): Remove `arguments'. * gnu/packages/avahi.scm (avahi): Remove #:phases. --- tests/packages.scm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'tests') diff --git a/tests/packages.scm b/tests/packages.scm index c5d9d280ed..2d16f8a03f 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -22,6 +22,7 @@ (define-module (test-packages) #:use-module (guix utils) #:use-module (guix derivations) #:use-module (guix packages) + #:use-module (guix build-system) #:use-module (guix build-system trivial) #:use-module (guix build-system gnu) #:use-module (gnu packages) @@ -138,6 +139,41 @@ (define-syntax-rule (dummy-package name* extra-fields ...) (let ((p (pk 'drv d (derivation-path->output-path d)))) (eq? 'hello (call-with-input-file p read)))))) +(test-assert "search paths" + (let* ((p (make-prompt-tag "return-search-paths")) + (s (build-system + (name "raw") + (description "Raw build system with direct store access") + (build (lambda* (store name source inputs + #:key outputs system search-paths) + search-paths)))) + (x (list (search-path-specification + (variable "GUILE_LOAD_PATH") + (directories '("share/guile/site/2.0"))) + (search-path-specification + (variable "GUILE_LOAD_COMPILED_PATH") + (directories '("share/guile/site/2.0"))))) + (a (package (inherit (dummy-package "guile")) + (build-system s) + (native-search-paths x))) + (b (package (inherit (dummy-package "guile-foo")) + (build-system s) + (inputs `(("guile" ,a))))) + (c (package (inherit (dummy-package "guile-bar")) + (build-system s) + (inputs `(("guile" ,a) + ("guile-foo" ,b)))))) + (let-syntax ((collect (syntax-rules () + ((_ body ...) + (call-with-prompt p + (lambda () + body ...) + (lambda (k search-paths) + search-paths)))))) + (and (null? (collect (package-derivation %store a))) + (equal? x (collect (package-derivation %store b))) + (equal? x (collect (package-derivation %store c))))))) + (unless (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)) (test-skip 1)) (test-assert "GNU Make, bootstrap" -- cgit v1.2.3