me
/
guix
Archived
1
0
Fork 0

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'.
master
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) GOBJECTS = $(MODULES:%.scm=%.go)
nobase_dist_guilemodule_DATA = \ nobase_dist_guilemodule_DATA = $(MODULES)
$(MODULES) \
distro/guile-1.8-cpp-4.5.patch \ patchdir = $(pkgdatadir)/patches
distro/m4-readlink-EINVAL.patch \ dist_patch_DATA = \
distro/m4-s_isdir.patch \ distro/patches/guile-1.8-cpp-4.5.patch \
distro/make-impure-dirs.patch \ distro/patches/m4-readlink-EINVAL.patch \
distro/findutils-absolute-paths.patch \ distro/patches/m4-s_isdir.patch \
distro/readline-link-ncurses.patch distro/patches/make-impure-dirs.patch \
distro/patches/findutils-absolute-paths.patch \
distro/patches/readline-link-ncurses.patch
nobase_nodist_guilemodule_DATA = $(GOBJECTS) nobase_nodist_guilemodule_DATA = $(GOBJECTS)
@ -57,6 +59,7 @@ TESTS_ENVIRONMENT = \
NIX_HASH="$(NIX_HASH)"; \ NIX_HASH="$(NIX_HASH)"; \
NIX_INSTANTIATE="$(NIX_INSTANTIATE)"; \ NIX_INSTANTIATE="$(NIX_INSTANTIATE)"; \
NIXPKGS="$(NIXPKGS)"; \ NIXPKGS="$(NIXPKGS)"; \
DISTRO_PATCH_DIRECTORY="$(top_srcdir)/distro/patches" \
GUILE_LOAD_COMPILED_PATH="$(top_builddir):$$GUILE_LOAD_COMPILED_PATH"; \ GUILE_LOAD_COMPILED_PATH="$(top_builddir):$$GUILE_LOAD_COMPILED_PATH"; \
export NIX_HASH NIX_INSTANTIATE NIXPKGS 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)" \ NIX_INSTANTIATE="$(NIX_INSTANTIATE)" \
NIXPKGS="$(NIXPKGS)" \ NIXPKGS="$(NIXPKGS)" \
LIBGCRYPT="$(LIBGCRYPT)" \ LIBGCRYPT="$(LIBGCRYPT)" \
DISTRO_PATCH_DIRECTORY="$(top_srcdir)/distro/patches" \
DISTRO_INSTALLED_PATCH_DIRECTORY="$(patchdir)" \
GUILE_AUTO_COMPILE=0 \ GUILE_AUTO_COMPILE=0 \
GUILE_LOAD_COMPILED_PATH="$(top_builddir):$$GUILE_LOAD_COMPILED_PATH" \ GUILE_LOAD_COMPILED_PATH="$(top_builddir):$$GUILE_LOAD_COMPILED_PATH" \
$(GUILD) compile -L "$(top_srcdir)" \ $(GUILD) compile -L "$(top_srcdir)" \

View File

@ -18,10 +18,14 @@
(define-module (distro) (define-module (distro)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix utils)
#:use-module (ice-9 ftw) #:use-module (ice-9 ftw)
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
#:use-module (srfi srfi-26) #: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: ;;; Commentary:
;;; ;;;
@ -32,6 +36,15 @@
(define _ (cut gettext <> "guix")) (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 (define %distro-module-directory
;; Absolute path of the (distro ...) module root. ;; Absolute path of the (distro ...) module root.
(string-append (dirname (search-path %load-path "distro.scm")) (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/>. ;;; along with Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (distro base) (define-module (distro base)
#:use-module (distro)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix http) #:use-module (guix http)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
@ -191,7 +192,7 @@ files (as archives).")
(build-system gnu-build-system) (build-system gnu-build-system)
(native-inputs (native-inputs
`(("patch/absolute-paths" `(("patch/absolute-paths"
,(search-path %load-path "distro/findutils-absolute-paths.patch")))) ,(search-patch "findutils-absolute-paths.patch"))))
(arguments (arguments
(case-lambda (case-lambda
((system) ((system)
@ -245,10 +246,9 @@ The tools supplied with this package are:
`(#:patches (list (assoc-ref %build-inputs "patch/s_isdir") `(#:patches (list (assoc-ref %build-inputs "patch/s_isdir")
(assoc-ref %build-inputs (assoc-ref %build-inputs
"patch/readlink-EINVAL")))))) "patch/readlink-EINVAL"))))))
(inputs `(("patch/s_isdir" (inputs `(("patch/s_isdir" ,(search-patch "m4-s_isdir.patch"))
,(search-path %load-path "distro/m4-s_isdir.patch"))
("patch/readlink-EINVAL" ("patch/readlink-EINVAL"
,(search-path %load-path "distro/m4-readlink-EINVAL.patch")))) ,(search-patch "m4-readlink-EINVAL.patch"))))
(description "GNU M4, a macro processor") (description "GNU M4, a macro processor")
(long-description (long-description
"GNU M4 is an implementation of the traditional Unix macro processor. It "GNU M4 is an implementation of the traditional Unix macro processor. It
@ -280,8 +280,7 @@ macro processor in its own right.")
"0ri98385hsd7li6rh4l5afcq92v8l2lgiaz85wgcfh4w2wzsghg2")))) "0ri98385hsd7li6rh4l5afcq92v8l2lgiaz85wgcfh4w2wzsghg2"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(native-inputs (native-inputs
`(("patch/impure-dirs" `(("patch/impure-dirs" ,(search-patch "make-impure-dirs.patch"))))
,(search-path %load-path "distro/make-impure-dirs.patch"))))
(arguments `(#:patches (list (assoc-ref %build-inputs (arguments `(#:patches (list (assoc-ref %build-inputs
"patch/impure-dirs")))) "patch/impure-dirs"))))
(description "GNU Make, a program controlling the generation of non-source (description "GNU Make, a program controlling the generation of non-source
@ -481,8 +480,7 @@ UNIX. It has even been ported to OS/2 Warp!")
(build-system gnu-build-system) (build-system gnu-build-system)
(propagated-inputs `(("ncurses" ,ncurses))) (propagated-inputs `(("ncurses" ,ncurses)))
(inputs `(("patch/link-ncurses" (inputs `(("patch/link-ncurses"
,(search-path %load-path ,(search-patch "readline-link-ncurses.patch"))))
"distro/readline-link-ncurses.patch"))))
(arguments `(#:patches (list (assoc-ref %build-inputs (arguments `(#:patches (list (assoc-ref %build-inputs
"patch/link-ncurses")) "patch/link-ncurses"))
#:patch-flags '("-p0"))) #:patch-flags '("-p0")))
@ -664,8 +662,7 @@ records, each record containing an arbitrary number of named fields.")
match match
(assoc-ref outputs "out"))))) (assoc-ref outputs "out")))))
%standard-phases))) %standard-phases)))
(inputs `(("patch/snarf" (inputs `(("patch/snarf" ,(search-patch "guile-1.8-cpp-4.5.patch"))
,(search-path %load-path "distro/guile-1.8-cpp-4.5.patch"))
("gawk" ,gawk) ("gawk" ,gawk)
("readline" ,readline))) ("readline" ,readline)))