diff --git a/gnu/packages.scm b/gnu/packages.scm index 6109d1f896..7f0b58b971 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2013 Mark H Weaver ;;; Copyright © 2014 Eric Bavier ;;; @@ -64,11 +64,6 @@ ;; and an extra environment variable. One advantage of this setup is ;; that everything just works in an auto-compilation setting. -(define %patch-path - (make-parameter - (map (cut string-append <> "/gnu/packages/patches") - %load-path))) - (define %bootstrap-binaries-path (make-parameter (map (cut string-append <> "/gnu/packages/bootstrap") @@ -104,6 +99,16 @@ (make-parameter (append environment `((,%distro-root-directory . "gnu/packages")))))) +(define %patch-path + ;; Define it after '%package-module-path' so that '%load-path' contains user + ;; directories, allowing patches in $GUIX_PACKAGE_PATH to be found. + (make-parameter + (map (lambda (directory) + (if (string=? directory %distro-root-directory) + (string-append directory "/gnu/packages/patches") + directory)) + %load-path))) + (define* (scheme-files directory) "Return the list of Scheme files found under DIRECTORY, recursively. The returned list is sorted in alphabetical order." diff --git a/tests/guix-package.sh b/tests/guix-package.sh index f4e091a5a2..3959269d44 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2013, 2014 Ludovic Courtès +# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès # Copyright © 2013 Nikita Karetnikov # # This file is part of GNU Guix. @@ -289,10 +289,29 @@ GUIX_PACKAGE_PATH="$module_dir" export GUIX_PACKAGE_PATH guix package -A emacs-foo-bar | grep 42 guix package -i emacs-foo-bar-42 -n + +# Make sure patches that live under $GUIX_PACKAGE_PATH are found. +cat > "$module_dir/emacs.patch"< "$module_dir/foo.scm"<