diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-01-18 01:06:47 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-01-18 01:07:53 +0100 |
commit | 59a43334a98babd6c776648967e48d7c44723639 (patch) | |
tree | 773b1410caede08cab50eb26b2fcf617da419c7c /gnu | |
parent | 1ffa7090b99dfd2f54fa883929c5e78d7852657a (diff) | |
download | patches-59a43334a98babd6c776648967e48d7c44723639.tar patches-59a43334a98babd6c776648967e48d7c44723639.tar.gz |
distro: Rename (distro) to (gnu packages).
* distro.scm: Rename to...
* gnu/packages.scm: ... this. Update all users accordingly.
* Makefile.am (MODULES): Adjust accordingly.
* po/POTFILES.in: Likewise.
Diffstat (limited to 'gnu')
39 files changed, 177 insertions, 38 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm new file mode 100644 index 0000000000..792fe44efa --- /dev/null +++ b/gnu/packages.scm @@ -0,0 +1,139 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (gnu packages) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (ice-9 ftw) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-39) + #:export (search-patch + search-bootstrap-binary + %patch-directory + %bootstrap-binaries-path + fold-packages + find-packages-by-name)) + +;;; Commentary: +;;; +;;; General utilities for the software distribution---i.e., the modules under +;;; (gnu packages ...). +;;; +;;; Code: + +(define _ (cut gettext <> "guix")) + +;; By default, we store patches and bootstrap binaries alongside Guile +;; modules. This is so that these extra files can be found without +;; requiring a special setup, such as a specific installation directory +;; 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") + %load-path))) + +(define (search-patch file-name) + "Search the patch FILE-NAME." + (search-path (%patch-path) file-name)) + +(define (search-bootstrap-binary file-name system) + "Search the bootstrap binary FILE-NAME for SYSTEM." + (search-path (%bootstrap-binaries-path) + (string-append system "/" file-name))) + +(define %distro-module-directory + ;; Absolute path of the (gnu packages ...) module root. + (string-append (dirname (search-path %load-path "gnu/packages.scm")) + "/packages")) + +(define (package-files) + "Return the list of files that implement distro modules." + (define prefix-len + (string-length + (dirname (dirname (search-path %load-path "gnu/packages.scm"))))) + + (file-system-fold (const #t) ; enter? + (lambda (path stat result) ; leaf + (if (string-suffix? ".scm" path) + (cons (substring path prefix-len) result) + result)) + (lambda (path stat result) ; down + result) + (lambda (path stat result) ; up + result) + (const #f) ; skip + (lambda (path stat errno result) + (format (current-error-port) + (_ "warning: cannot access `~a': ~a~%") + path (strerror errno)) + result) + '() + %distro-module-directory + stat)) + +(define (package-modules) + "Return the list of modules that provide packages for the distribution." + (define not-slash + (char-set-complement (char-set #\/))) + + (filter-map (lambda (path) + (let ((name (map string->symbol + (string-tokenize (string-drop-right path 4) + not-slash)))) + (false-if-exception (resolve-interface name)))) + (package-files))) + +(define (fold-packages proc init) + "Call (PROC PACKAGE RESULT) for each available package, using INIT as +the initial value of RESULT." + (fold (lambda (module result) + (fold (lambda (var result) + (if (package? var) + (proc var result) + result)) + result + (module-map (lambda (sym var) + (false-if-exception (variable-ref var))) + module))) + init + (package-modules))) + +(define* (find-packages-by-name name #:optional version) + "Return the list of packages with the given NAME. If VERSION is not #f, +then only return packages whose version is equal to VERSION." + (define right-package? + (if version + (lambda (p) + (and (string=? (package-name p) name) + (string=? (package-version p) version))) + (lambda (p) + (string=? (package-name p) name)))) + + (fold-packages (lambda (package result) + (if (right-package? package) + (cons package result) + result)) + '())) diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index 088e32bc0c..84806f9e3a 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -18,7 +18,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages algebra) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages multiprecision) #:use-module (gnu packages perl) #:use-module (gnu packages readline) diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm index b5c8b6ec87..05fddcc2ab 100644 --- a/gnu/packages/autotools.scm +++ b/gnu/packages/autotools.scm @@ -19,7 +19,7 @@ (define-module (gnu packages autotools) #:use-module (guix licenses) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages perl) #:use-module (gnu packages m4) #:use-module (guix packages) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index b5a5856609..4764039afd 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -19,7 +19,7 @@ (define-module (gnu packages base) #:use-module (guix licenses) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages acl) #:use-module (gnu packages bash) #:use-module (gnu packages bootstrap) diff --git a/gnu/packages/bdb.scm b/gnu/packages/bdb.scm index 1be57b302a..c9cdf4af6b 100644 --- a/gnu/packages/bdb.scm +++ b/gnu/packages/bdb.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages bdb) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 6cad933644..39cdea2f62 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -18,7 +18,7 @@ (define-module (gnu packages bootstrap) #:use-module (guix licenses) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system) diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index ec2997cbe6..ebb04e2b53 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages check) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) diff --git a/gnu/packages/cpio.scm b/gnu/packages/cpio.scm index 6fddc3f768..711d64d7af 100644 --- a/gnu/packages/cpio.scm +++ b/gnu/packages/cpio.scm @@ -18,7 +18,7 @@ (define-module (gnu packages cpio) #:use-module (guix licenses) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu)) diff --git a/gnu/packages/cyrus-sasl.scm b/gnu/packages/cyrus-sasl.scm index fe8ea4ef7c..b724d4fc2f 100644 --- a/gnu/packages/cyrus-sasl.scm +++ b/gnu/packages/cyrus-sasl.scm @@ -18,7 +18,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages cyrus-sasl) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages gdbm) #:use-module (gnu packages mit-krb5) #:use-module (gnu packages openssl) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index c9d0822a80..13a03ce365 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -21,7 +21,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages ncurses) #:use-module (gnu packages texinfo) #:use-module (gnu packages gnutls) diff --git a/gnu/packages/file.scm b/gnu/packages/file.scm index 5a2cc2ad80..1e09fb7f18 100644 --- a/gnu/packages/file.scm +++ b/gnu/packages/file.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages file) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) diff --git a/gnu/packages/flex.scm b/gnu/packages/flex.scm index 7a6d5f507d..5548dcf05d 100644 --- a/gnu/packages/flex.scm +++ b/gnu/packages/flex.scm @@ -21,7 +21,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages m4) #:use-module (gnu packages bison) #:use-module (gnu packages indent)) diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm index c45a488dca..e85b8f69c3 100644 --- a/gnu/packages/gettext.scm +++ b/gnu/packages/gettext.scm @@ -18,7 +18,7 @@ (define-module (gnu packages gettext) #:use-module (guix licenses) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu)) diff --git a/gnu/packages/global.scm b/gnu/packages/global.scm index 705efbbbed..592aefc66e 100644 --- a/gnu/packages/global.scm +++ b/gnu/packages/global.scm @@ -23,7 +23,7 @@ #:use-module (guix licenses) #:use-module (gnu packages ncurses) #:use-module (gnu packages autotools) - #:use-module (distro)) + #:use-module (gnu packages)) (define-public global ; a global variable (package diff --git a/gnu/packages/gsasl.scm b/gnu/packages/gsasl.scm index dc75b18455..832ae0c2ff 100644 --- a/gnu/packages/gsasl.scm +++ b/gnu/packages/gsasl.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages gsasl) - #:use-module (distro) + #:use-module (gnu packages) #:use-module ((gnu packages compression) #:renamer (symbol-prefix-proc 'guix:)) #:use-module (gnu packages gnutls) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 5034ae914a..4c87465b25 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -18,7 +18,7 @@ (define-module (gnu packages guile) #:use-module (guix licenses) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages bdw-gc) #:use-module (gnu packages gawk) #:use-module (gnu packages gperf) diff --git a/gnu/packages/icu4c.scm b/gnu/packages/icu4c.scm index e0aa3bcd88..35b0c35069 100644 --- a/gnu/packages/icu4c.scm +++ b/gnu/packages/icu4c.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages icu4c) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages perl) #:use-module (guix licenses) #:use-module (guix packages) diff --git a/gnu/packages/idutils.scm b/gnu/packages/idutils.scm index 34b6dfcff9..775de18c5c 100644 --- a/gnu/packages/idutils.scm +++ b/gnu/packages/idutils.scm @@ -21,7 +21,7 @@ #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module (guix licenses) - #:use-module (distro)) + #:use-module (gnu packages)) (define-public idutils (package diff --git a/gnu/packages/indent.scm b/gnu/packages/indent.scm index eb42e6a7b4..c70a790e62 100644 --- a/gnu/packages/indent.scm +++ b/gnu/packages/indent.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages indent) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) diff --git a/gnu/packages/libidn.scm b/gnu/packages/libidn.scm index dd246ef3e1..b49a2018ca 100644 --- a/gnu/packages/libidn.scm +++ b/gnu/packages/libidn.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages libidn) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) diff --git a/gnu/packages/libjpeg.scm b/gnu/packages/libjpeg.scm index 22d5a6b1c1..e646b1dfa2 100644 --- a/gnu/packages/libjpeg.scm +++ b/gnu/packages/libjpeg.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages libjpeg) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) diff --git a/gnu/packages/libtiff.scm b/gnu/packages/libtiff.scm index 0e785a622b..5c5f1cc094 100644 --- a/gnu/packages/libtiff.scm +++ b/gnu/packages/libtiff.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages libtiff) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages file) #:use-module (gnu packages libjpeg) #:use-module (guix licenses) diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm index 1813f0cd04..86ead7b22e 100644 --- a/gnu/packages/libusb.scm +++ b/gnu/packages/libusb.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages libusb) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index ded36c5eec..de6d53a0d9 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -19,7 +19,7 @@ (define-module (gnu packages linux) #:use-module (guix licenses) - #:use-module (distro) + #:use-module (gnu packages) #:use-module ((gnu packages compression) #:renamer (symbol-prefix-proc 'guix:)) #:use-module (gnu packages flex) diff --git a/gnu/packages/lsh.scm b/gnu/packages/lsh.scm index b42eb24639..5b3e9a7e0b 100644 --- a/gnu/packages/lsh.scm +++ b/gnu/packages/lsh.scm @@ -21,7 +21,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages m4) #:use-module (gnu packages linux) #:use-module ((gnu packages compression) diff --git a/gnu/packages/m4.scm b/gnu/packages/m4.scm index bac8d02c85..fdf55f802d 100644 --- a/gnu/packages/m4.scm +++ b/gnu/packages/m4.scm @@ -18,7 +18,7 @@ (define-module (gnu packages m4) #:use-module (guix licenses) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix utils) diff --git a/gnu/packages/mailutils.scm b/gnu/packages/mailutils.scm index f6d46aaf34..d9f26323e8 100644 --- a/gnu/packages/mailutils.scm +++ b/gnu/packages/mailutils.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages mailutils) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages linux) #:use-module (gnu packages gnutls) #:use-module (gnu packages gdbm) diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index 20679d2244..a252848a47 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -22,7 +22,7 @@ #:use-module (guix licenses) #:use-module (guix build-system trivial) #:use-module (guix build-system gnu) - #:use-module ((distro) #:select (search-patch)) + #:use-module ((gnu packages) #:select (search-patch)) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages compression) diff --git a/gnu/packages/mit-krb5.scm b/gnu/packages/mit-krb5.scm index 4b30a7ca17..4fbd301957 100644 --- a/gnu/packages/mit-krb5.scm +++ b/gnu/packages/mit-krb5.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages mit-krb5) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages bison) #:use-module (gnu packages perl) #:use-module (guix licenses) diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm index f05fe1994e..1d74dadef0 100644 --- a/gnu/packages/multiprecision.scm +++ b/gnu/packages/multiprecision.scm @@ -18,7 +18,7 @@ (define-module (gnu packages multiprecision) #:use-module (guix licenses) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages m4) #:use-module (guix packages) #:use-module (guix download) diff --git a/gnu/packages/mysql.scm b/gnu/packages/mysql.scm index 517f65610e..4258bf6fe5 100644 --- a/gnu/packages/mysql.scm +++ b/gnu/packages/mysql.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages mysql) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages perl) #:use-module (gnu packages linux) #:use-module (gnu packages openssl) diff --git a/gnu/packages/openssl.scm b/gnu/packages/openssl.scm index 8c8ba4c668..2af24abe4a 100644 --- a/gnu/packages/openssl.scm +++ b/gnu/packages/openssl.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages openssl) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages perl) #:use-module ((guix licenses) #:renamer (symbol-prefix-proc 'license:)) #:use-module (guix packages) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 719aa4db5c..a37202b7bb 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -18,7 +18,7 @@ (define-module (gnu packages perl) #:use-module (guix licenses) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix utils) diff --git a/gnu/packages/readline.scm b/gnu/packages/readline.scm index 8623e63758..83666b225d 100644 --- a/gnu/packages/readline.scm +++ b/gnu/packages/readline.scm @@ -18,7 +18,7 @@ (define-module (gnu packages readline) #:use-module (guix licenses) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages ncurses) #:use-module (guix packages) #:use-module (guix download) diff --git a/gnu/packages/recutils.scm b/gnu/packages/recutils.scm index 39452b54b9..3104f71499 100644 --- a/gnu/packages/recutils.scm +++ b/gnu/packages/recutils.scm @@ -18,7 +18,7 @@ (define-module (gnu packages recutils) #:use-module (guix licenses) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix utils) diff --git a/gnu/packages/rsync.scm b/gnu/packages/rsync.scm index 3fb7874434..16e1a53cb2 100644 --- a/gnu/packages/rsync.scm +++ b/gnu/packages/rsync.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages rsync) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages perl) #:use-module (gnu packages acl) #:use-module (guix licenses) diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm index a1b8f68c9d..ee8eb83d68 100644 --- a/gnu/packages/scheme.scm +++ b/gnu/packages/scheme.scm @@ -17,7 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages scheme) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) diff --git a/gnu/packages/shishi.scm b/gnu/packages/shishi.scm index d6d152f368..1590221496 100644 --- a/gnu/packages/shishi.scm +++ b/gnu/packages/shishi.scm @@ -19,7 +19,7 @@ (define-module (gnu packages shishi) #:use-module (guix licenses) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages gnutls) #:use-module (gnu packages gnupg) #:use-module ((gnu packages compression) diff --git a/gnu/packages/system.scm b/gnu/packages/system.scm index 5fb3dc463b..1eddd6de86 100644 --- a/gnu/packages/system.scm +++ b/gnu/packages/system.scm @@ -21,7 +21,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) - #:use-module (distro) + #:use-module (gnu packages) #:use-module (gnu packages ncurses)) (define-public pies |