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'.
This commit is contained in:
Ludovic Courtès 2012-08-22 17:24:38 +02:00
parent af5521ca01
commit 800cdeef31
9 changed files with 34 additions and 19 deletions

View file

@ -35,14 +35,16 @@ MODULES = \
GOBJECTS = $(MODULES:%.scm=%.go)
nobase_dist_guilemodule_DATA = \
$(MODULES) \
distro/guile-1.8-cpp-4.5.patch \
distro/m4-readlink-EINVAL.patch \
distro/m4-s_isdir.patch \
distro/make-impure-dirs.patch \
distro/findutils-absolute-paths.patch \
distro/readline-link-ncurses.patch
nobase_dist_guilemodule_DATA = $(MODULES)
patchdir = $(pkgdatadir)/patches
dist_patch_DATA = \
distro/patches/guile-1.8-cpp-4.5.patch \
distro/patches/m4-readlink-EINVAL.patch \
distro/patches/m4-s_isdir.patch \
distro/patches/make-impure-dirs.patch \
distro/patches/findutils-absolute-paths.patch \
distro/patches/readline-link-ncurses.patch
nobase_nodist_guilemodule_DATA = $(GOBJECTS)
@ -57,6 +59,7 @@ TESTS_ENVIRONMENT = \
NIX_HASH="$(NIX_HASH)"; \
NIX_INSTANTIATE="$(NIX_INSTANTIATE)"; \
NIXPKGS="$(NIXPKGS)"; \
DISTRO_PATCH_DIRECTORY="$(top_srcdir)/distro/patches" \
GUILE_LOAD_COMPILED_PATH="$(top_builddir):$$GUILE_LOAD_COMPILED_PATH"; \
export NIX_HASH NIX_INSTANTIATE NIXPKGS GUILE_LOAD_COMPILED_PATH;
@ -78,6 +81,8 @@ CLEANFILES = $(GOBJECTS) *.log
NIX_INSTANTIATE="$(NIX_INSTANTIATE)" \
NIXPKGS="$(NIXPKGS)" \
LIBGCRYPT="$(LIBGCRYPT)" \
DISTRO_PATCH_DIRECTORY="$(top_srcdir)/distro/patches" \
DISTRO_INSTALLED_PATCH_DIRECTORY="$(patchdir)" \
GUILE_AUTO_COMPILE=0 \
GUILE_LOAD_COMPILED_PATH="$(top_builddir):$$GUILE_LOAD_COMPILED_PATH" \
$(GUILD) compile -L "$(top_srcdir)" \

View file

@ -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"))

View file

@ -17,6 +17,7 @@
;;; along with Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (distro base)
#:use-module (distro)
#:use-module (guix packages)
#:use-module (guix http)
#:use-module (guix build-system gnu)
@ -191,7 +192,7 @@ (define-public findutils
(build-system gnu-build-system)
(native-inputs
`(("patch/absolute-paths"
,(search-path %load-path "distro/findutils-absolute-paths.patch"))))
,(search-patch "findutils-absolute-paths.patch"))))
(arguments
(case-lambda
((system)
@ -245,10 +246,9 @@ (define-public m4
`(#:patches (list (assoc-ref %build-inputs "patch/s_isdir")
(assoc-ref %build-inputs
"patch/readlink-EINVAL"))))))
(inputs `(("patch/s_isdir"
,(search-path %load-path "distro/m4-s_isdir.patch"))
(inputs `(("patch/s_isdir" ,(search-patch "m4-s_isdir.patch"))
("patch/readlink-EINVAL"
,(search-path %load-path "distro/m4-readlink-EINVAL.patch"))))
,(search-patch "m4-readlink-EINVAL.patch"))))
(description "GNU M4, a macro processor")
(long-description
"GNU M4 is an implementation of the traditional Unix macro processor. It
@ -280,8 +280,7 @@ (define-public gnu-make
"0ri98385hsd7li6rh4l5afcq92v8l2lgiaz85wgcfh4w2wzsghg2"))))
(build-system gnu-build-system)
(native-inputs
`(("patch/impure-dirs"
,(search-path %load-path "distro/make-impure-dirs.patch"))))
`(("patch/impure-dirs" ,(search-patch "make-impure-dirs.patch"))))
(arguments `(#:patches (list (assoc-ref %build-inputs
"patch/impure-dirs"))))
(description "GNU Make, a program controlling the generation of non-source
@ -481,8 +480,7 @@ (define-public readline
(build-system gnu-build-system)
(propagated-inputs `(("ncurses" ,ncurses)))
(inputs `(("patch/link-ncurses"
,(search-path %load-path
"distro/readline-link-ncurses.patch"))))
,(search-patch "readline-link-ncurses.patch"))))
(arguments `(#:patches (list (assoc-ref %build-inputs
"patch/link-ncurses"))
#:patch-flags '("-p0")))
@ -664,8 +662,7 @@ (define-public guile-1.8
match
(assoc-ref outputs "out")))))
%standard-phases)))
(inputs `(("patch/snarf"
,(search-path %load-path "distro/guile-1.8-cpp-4.5.patch"))
(inputs `(("patch/snarf" ,(search-patch "guile-1.8-cpp-4.5.patch"))
("gawk" ,gawk)
("readline" ,readline)))