From 800cdeef31ccc92c9f54b62ec5276985d7b157b1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 22 Aug 2012 17:24:38 +0200 Subject: distro: Move patches to their own directory. * Makefile.am (nobase_dist_guilemodule_DATA): Keep only $(MODULES). (patchdir): New variable. (dist_patch_DATA): New variable. Patch files formerly in $(nobase_dist_guilemodule_DATA). (.scm.go): Define `DISTRO_PATCH_DIRECTORY' and `DISTRO_INSTALLED_PATCH_DIRECTORY'. (TESTS_ENVIRONMENT): Define `DISTRO_PATCH_DIRECTORY'. * distro.scm (%patch-directory): New variable. (search-patch): New procedure. * distro/base.scm: Use `search-patch' instead of `(search-path %load-path ...)'. * distro/findutils-absolute-paths.patch, distro/guile-1.8-cpp-4.5.patch, distro/m4-readlink-EINVAL.patch, distro/m4-s_isdir.patch, distro/make-impure-dirs.patch: Move to `distro/patches'. --- distro.scm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'distro.scm') diff --git a/distro.scm b/distro.scm index 784e537deb..b21b0e6184 100644 --- a/distro.scm +++ b/distro.scm @@ -18,10 +18,14 @@ (define-module (distro) #:use-module (guix packages) + #:use-module (guix utils) #:use-module (ice-9 ftw) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) - #:export (find-packages-by-name)) + #:use-module (srfi srfi-39) + #:export (search-patch + %patch-directory + find-packages-by-name)) ;;; Commentary: ;;; @@ -32,6 +36,15 @@ (define-module (distro) (define _ (cut gettext <> "guix")) +(define %patch-directory + (make-parameter + (or (getenv "DISTRO_PATCH_DIRECTORY") + (compile-time-value (getenv "DISTRO_INSTALLED_PATCH_DIRECTORY"))))) + +(define (search-patch file-name) + "Search the patch FILE-NAME." + (search-path (list (%patch-directory)) file-name)) + (define %distro-module-directory ;; Absolute path of the (distro ...) module root. (string-append (dirname (search-path %load-path "distro.scm")) -- cgit v1.2.3