From 971863fb45af749639a556e905997f48e895cfa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 8 Sep 2014 17:48:34 +0200 Subject: [PATCH 01/44] gnu: Remove extra import in (gnu packages admin). * gnu/packages/admin.scm: Remove duplicate use of (gnu packages base). --- gnu/packages/admin.scm | 2 -- 1 file changed, 2 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index c2599746d8..985cedfe9b 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -36,8 +36,6 @@ #:use-module (gnu packages gettext) #:use-module (gnu packages perl) #:use-module (gnu packages tcl) - #:use-module ((gnu packages base) - #:select (tar)) #:use-module ((gnu packages compression) #:select (gzip)) #:use-module ((gnu packages openssl) From 5f96f303eb9438d0395ad0b66e92e435531d7700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 8 Sep 2014 17:48:03 +0200 Subject: [PATCH 02/44] gnu: Consolidate databases in (gnu packages databases). * gnu/packages/databases.scm: New file, with the contents of the following deleted files. * gnu/packages/mysql.scm, gnu/packages/postgresql.scm, gnu/packages/recutils.scm, gnu/packages/sqlite.scm, gnu/packages/bdb.scm: Remove. * gnu-system.am (GNU_SYSTEM_MODULES): Adjust accordingly. * gnu/packages/apl.scm, gnu/packages/dc.scm, gnu/packages/games.scm, gnu/packages/gnunet.scm, gnu/packages/linux.scm, gnu/packages/mail.scm, gnu/packages/mpd.scm, gnu/packages/nvi.scm, gnu/packages/openldap.scm, gnu/packages/package-management.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/rdf.scm, gnu/packages/version-control.scm: Adjust to new module name. --- gnu-system.am | 6 +- gnu/packages/apl.scm | 2 +- gnu/packages/bdb.scm | 68 -------- gnu/packages/databases.scm | 245 ++++++++++++++++++++++++++++ gnu/packages/dc.scm | 2 +- gnu/packages/games.scm | 2 +- gnu/packages/gnunet.scm | 2 +- gnu/packages/linux.scm | 2 +- gnu/packages/mail.scm | 3 +- gnu/packages/mpd.scm | 2 +- gnu/packages/mysql.scm | 87 ---------- gnu/packages/nvi.scm | 2 +- gnu/packages/openldap.scm | 4 +- gnu/packages/package-management.scm | 2 +- gnu/packages/postgresql.scm | 52 ------ gnu/packages/python.scm | 2 +- gnu/packages/qt.scm | 2 +- gnu/packages/rdf.scm | 2 +- gnu/packages/recutils.scm | 66 -------- gnu/packages/sqlite.scm | 63 ------- gnu/packages/version-control.scm | 2 +- 21 files changed, 261 insertions(+), 357 deletions(-) delete mode 100644 gnu/packages/bdb.scm create mode 100644 gnu/packages/databases.scm delete mode 100644 gnu/packages/mysql.scm delete mode 100644 gnu/packages/postgresql.scm delete mode 100644 gnu/packages/recutils.scm delete mode 100644 gnu/packages/sqlite.scm diff --git a/gnu-system.am b/gnu-system.am index 9328d13083..b3d6123468 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -41,7 +41,6 @@ GNU_SYSTEM_MODULES = \ gnu/packages/backup.scm \ gnu/packages/base.scm \ gnu/packages/bash.scm \ - gnu/packages/bdb.scm \ gnu/packages/bdw-gc.scm \ gnu/packages/bittorrent.scm \ gnu/packages/bison.scm \ @@ -67,6 +66,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/curl.scm \ gnu/packages/cursynth.scm \ gnu/packages/cyrus-sasl.scm \ + gnu/packages/databases.scm \ gnu/packages/datamash.scm \ gnu/packages/dc.scm \ gnu/packages/dejagnu.scm \ @@ -172,7 +172,6 @@ GNU_SYSTEM_MODULES = \ gnu/packages/mpi.scm \ gnu/packages/multiprecision.scm \ gnu/packages/mtools.scm \ - gnu/packages/mysql.scm \ gnu/packages/nano.scm \ gnu/packages/ncdu.scm \ gnu/packages/ncurses.scm \ @@ -199,7 +198,6 @@ GNU_SYSTEM_MODULES = \ gnu/packages/pkg-config.scm \ gnu/packages/plotutils.scm \ gnu/packages/popt.scm \ - gnu/packages/postgresql.scm \ gnu/packages/pth.scm \ gnu/packages/pulseaudio.scm \ gnu/packages/pretty-print.scm \ @@ -210,7 +208,6 @@ GNU_SYSTEM_MODULES = \ gnu/packages/ratpoison.scm \ gnu/packages/rdf.scm \ gnu/packages/readline.scm \ - gnu/packages/recutils.scm \ gnu/packages/rrdtool.scm \ gnu/packages/rsync.scm \ gnu/packages/rush.scm \ @@ -224,7 +221,6 @@ GNU_SYSTEM_MODULES = \ gnu/packages/skribilo.scm \ gnu/packages/slim.scm \ gnu/packages/smalltalk.scm \ - gnu/packages/sqlite.scm \ gnu/packages/ssh.scm \ gnu/packages/stalonetray.scm \ gnu/packages/swig.scm \ diff --git a/gnu/packages/apl.scm b/gnu/packages/apl.scm index a08886c252..7da3b5eb4a 100644 --- a/gnu/packages/apl.scm +++ b/gnu/packages/apl.scm @@ -24,7 +24,7 @@ #:use-module (guix build-system gnu) #:use-module (gnu packages gettext) #:use-module (gnu packages maths) - #:use-module (gnu packages sqlite) + #:use-module (gnu packages databases) #:use-module (gnu packages readline)) (define-public apl diff --git a/gnu/packages/bdb.scm b/gnu/packages/bdb.scm deleted file mode 100644 index e82a683332..0000000000 --- a/gnu/packages/bdb.scm +++ /dev/null @@ -1,68 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012 Andreas Enge -;;; -;;; 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 . - -(define-module (gnu packages bdb) - #:use-module (gnu packages) - #:use-module (guix licenses) - #:use-module (guix packages) - #:use-module (guix download) - #:use-module (guix build-system gnu)) - -(define-public bdb - (package - (name "bdb") - (version "5.3.21") - (source (origin - (method url-fetch) - (uri (string-append "http://download.oracle.com/berkeley-db/db-" version - ".tar.gz")) - (sha256 (base32 - "1f2g2612lf8djbwbwhxsvmffmf9d7693kh2l20195pqp0f9jmnfx")))) - (build-system gnu-build-system) - (outputs '("out" ; programs, libraries, headers - "doc")) ; 94 MiB of HTML docs - (arguments - '(#:tests? #f ; no check target available - #:phases - (alist-replace - 'configure - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (doc (assoc-ref outputs "doc"))) - ;; '--docdir' is not honored, so we need to patch. - (substitute* "dist/Makefile.in" - (("docdir[[:blank:]]*=.*") - (string-append "docdir = " doc "/share/doc/bdb"))) - - (zero? - (system* "./dist/configure" - (string-append "--prefix=" out) - (string-append "CONFIG_SHELL=" (which "bash")) - (string-append "SHELL=" (which "bash")) - - ;; The compatibility mode is needed by some packages, - ;; notably iproute2. - "--enable-compat185")))) - %standard-phases))) - (synopsis "db, the Berkeley database") - (description - "Berkeley DB is an embeddable database allowing developers the choice of -SQL, Key/Value, XML/XQuery or Java Object storage for their data model.") - (license (bsd-style "file://LICENSE" - "See LICENSE in the distribution.")) - (home-page "http://www.oracle.com/us/products/database/berkeley-db/overview/index.html"))) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm new file mode 100644 index 0000000000..553a078a88 --- /dev/null +++ b/gnu/packages/databases.scm @@ -0,0 +1,245 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012 Andreas Enge +;;; Copyright © 2013 Cyril Roelandt +;;; Copyright © 2014 David Thompson +;;; Copyright © 2014 Mark H Weaver +;;; +;;; 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 . + +(define-module (gnu packages databases) + #:use-module (gnu packages) + #:use-module (gnu packages perl) + #:use-module (gnu packages linux) + #:use-module (gnu packages openssl) + #:use-module (gnu packages compression) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages readline) + #:use-module (gnu packages emacs) + #:use-module (gnu packages check) + #:use-module (gnu packages algebra) + #:use-module (gnu packages curl) + #:use-module (gnu packages gnupg) + #:use-module ((guix licenses) + #:select (gpl2 gpl3+ x11-style bsd-style + public-domain)) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (srfi srfi-26) + #:use-module (ice-9 match)) + +(define-public bdb + (package + (name "bdb") + (version "5.3.21") + (source (origin + (method url-fetch) + (uri (string-append "http://download.oracle.com/berkeley-db/db-" version + ".tar.gz")) + (sha256 (base32 + "1f2g2612lf8djbwbwhxsvmffmf9d7693kh2l20195pqp0f9jmnfx")))) + (build-system gnu-build-system) + (outputs '("out" ; programs, libraries, headers + "doc")) ; 94 MiB of HTML docs + (arguments + '(#:tests? #f ; no check target available + #:phases + (alist-replace + 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (doc (assoc-ref outputs "doc"))) + ;; '--docdir' is not honored, so we need to patch. + (substitute* "dist/Makefile.in" + (("docdir[[:blank:]]*=.*") + (string-append "docdir = " doc "/share/doc/bdb"))) + + (zero? + (system* "./dist/configure" + (string-append "--prefix=" out) + (string-append "CONFIG_SHELL=" (which "bash")) + (string-append "SHELL=" (which "bash")) + + ;; The compatibility mode is needed by some packages, + ;; notably iproute2. + "--enable-compat185")))) + %standard-phases))) + (synopsis "db, the Berkeley database") + (description + "Berkeley DB is an embeddable database allowing developers the choice of +SQL, Key/Value, XML/XQuery or Java Object storage for their data model.") + (license (bsd-style "file://LICENSE" + "See LICENSE in the distribution.")) + (home-page + "http://www.oracle.com/us/products/database/berkeley-db/overview/index.html"))) + +(define-public mysql + (package + (name "mysql") + (version "5.1.73") + (source (origin + (method url-fetch) + (uri (string-append + "http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-" + version ".tar.gz")) + (sha256 + (base32 + "1dfwi4ck0vq6sdci6gz0031s7zz5lc3pddqlgm0292s00l9y5sq5")))) + (build-system gnu-build-system) + (inputs + `(("procps" ,procps) + ("openssl" ,openssl) + ("perl" ,perl) + ("zlib" ,zlib) + ("ncurses" ,ncurses))) + (arguments + '(#:modules ((guix build gnu-build-system) + (guix build utils) + (ice-9 ftw)) ; for "rm -rf" + #:phases (alist-cons-after + 'install 'clean-up + (lambda* (#:key outputs #:allow-other-keys) + ;; Remove the 112 MiB of tests that get installed. + (let ((out (assoc-ref outputs "out"))) + (define (rm-rf dir) + (file-system-fold (const #t) ; enter? + (lambda (file stat result) ; leaf + (delete-file file)) + (const #t) ; down + (lambda (dir stat result) ; up + (rmdir dir)) + (const #t) + (lambda (file stat errno result) + (format (current-error-port) + "error: ~a: ~a~%" + file (strerror errno))) + #t + (string-append out "/" dir))) + (rm-rf "mysql-test") + (rm-rf "sql-bench") + + ;; Compress the 14 MiB Info file. + (zero? + (system* "gzip" "--best" + (string-append out "/share/info/mysql.info"))))) + %standard-phases))) + (home-page "http://www.mysql.com/") + (synopsis "A fast, easy to use, and popular database") + (description + "MySQL is a fast, reliable, and easy to use relational database +management system that supports the standardized Structured Query +Language.") + (license gpl2))) + +(define-public postgresql + (package + (name "postgresql") + (version "9.3.5") + (source (origin + (method url-fetch) + (uri (string-append "http://ftp.postgresql.org/pub/source/v" + version "/postgresql-" version ".tar.gz")) + (sha256 + (base32 + "08kga00izykgvnx7hn995wc4zjqslspapaa8z63045p1ya14mr4g")))) + (build-system gnu-build-system) + (inputs + `(("readline" ,readline) + ("zlib" ,zlib))) + (home-page "http://www.postgresql.org/") + (synopsis "Powerful object-relational database system") + (description + "PostgreSQL is a powerful object-relational database system. It is fully +ACID compliant, has full support for foreign keys, joins, views, triggers, and +stored procedures (in multiple languages). It includes most SQL:2008 data +types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and +TIMESTAMP. It also supports storage of binary large objects, including +pictures, sounds, or video.") + (license (x11-style "file://COPYRIGHT")))) + +(define-public recutils + (package + (name "recutils") + (version "1.7") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/recutils/recutils-" + version ".tar.gz")) + (sha256 + (base32 + "0cdwa4094x3yx7vn98xykvnlp9rngvd58d19vs3vh5hrvggccg93")))) + (build-system gnu-build-system) + + ;; Running tests in parallel leads to test failures and crashes in + ;; torture/utils. + (arguments '(#:parallel-tests? #f)) + + (native-inputs `(("emacs" ,emacs) + ("bc" ,bc))) + + ;; TODO: Add more optional inputs. + ;; FIXME: Our Bash doesn't have development headers (need for the 'readrec' + ;; built-in command), but it's not clear how to get them installed. + ;; See . + (inputs `(("curl" ,curl) + ("libgcrypt" ,libgcrypt) + ("check" ,check))) + (synopsis "Manipulate plain text files as databases") + (description + "GNU Recutils is a set of tools and libraries for creating and +manipulating text-based, human-editable databases. Despite being text-based, +databases created with Recutils carry all of the expected features such as +unique fields, primary keys, time stamps and more. Many different field types +are supported, as is encryption.") + (license gpl3+) + (home-page "http://www.gnu.org/software/recutils/"))) + +(define-public sqlite + (package + (name "sqlite") + (version "3.8.4.3") + (source (origin + (method url-fetch) + ;; TODO: Download from sqlite.org once this bug : + ;; http://lists.gnu.org/archive/html/bug-guile/2013-01/msg00027.html + ;; has been fixed. + (uri (let ((numeric-version + (match (string-split version #\.) + ((first-digit other-digits ...) + (string-append first-digit + (string-pad-right + (string-concatenate + (map (cut string-pad <> 2 #\0) + other-digits)) + 6 #\0)))))) + (string-append + "mirror://sourceforge/sqlite.mirror/SQLite%20" version + "/sqlite-autoconf-" numeric-version ".tar.gz"))) + (sha256 + (base32 + "0rcdsk5sz34w8vy0g5yhfms4saiq81i872jxx5m5sjij7bi9bsg0")) + (patches + (list (search-patch "sqlite-large-page-size-fix.patch"))))) + (build-system gnu-build-system) + (home-page "http://www.sqlite.org/") + (synopsis "The SQLite database management system") + (description + "SQLite is a software library that implements a self-contained, serverless, +zero-configuration, transactional SQL database engine. SQLite is the most +widely deployed SQL database engine in the world. The source code for SQLite is +in the public domain.") + (license public-domain))) diff --git a/gnu/packages/dc.scm b/gnu/packages/dc.scm index 0cb7c5b4f0..0e65d886d0 100644 --- a/gnu/packages/dc.scm +++ b/gnu/packages/dc.scm @@ -23,7 +23,7 @@ #:use-module (gnu packages gnutls) #:use-module (gnu packages ncurses) #:use-module (gnu packages pkg-config) - #:use-module (gnu packages sqlite) + #:use-module (gnu packages databases) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 84e09aaee7..f3c88c92d4 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -38,7 +38,7 @@ #:use-module (gnu packages readline) #:use-module (gnu packages xorg) #:use-module (gnu packages pkg-config) - #:use-module (gnu packages sqlite) + #:use-module (gnu packages databases) #:use-module (gnu packages sdl) #:use-module (gnu packages texinfo) #:use-module (guix build-system gnu)) diff --git a/gnu/packages/gnunet.scm b/gnu/packages/gnunet.scm index e4ef3d4871..d5a1930bbe 100644 --- a/gnu/packages/gnunet.scm +++ b/gnu/packages/gnunet.scm @@ -38,7 +38,7 @@ #:use-module (gnu packages perl) #:use-module (gnu packages pulseaudio) #:use-module (gnu packages python) - #:use-module (gnu packages sqlite) + #:use-module (gnu packages databases) #:use-module (gnu packages video) #:use-module (gnu packages xiph) #:use-module ((guix licenses) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 442f80103a..fbf70cca55 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -30,7 +30,7 @@ #:use-module (gnu packages libusb) #:use-module (gnu packages ncurses) #:use-module (gnu packages pciutils) - #:use-module (gnu packages bdb) + #:use-module (gnu packages databases) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index a9e862ac88..2a742cdc56 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -31,7 +31,7 @@ #:use-module (gnu packages guile) #:use-module (gnu packages linux) #:use-module (gnu packages m4) - #:use-module (gnu packages mysql) + #:use-module (gnu packages databases) #:use-module (gnu packages ncurses) #:use-module (gnu packages openssl) #:use-module (gnu packages perl) @@ -43,7 +43,6 @@ #:use-module (gnu packages glib) #:use-module (gnu packages pkg-config) #:use-module (gnu packages flex) - #:use-module (gnu packages bdb) #:use-module (gnu packages gdb) #:use-module (gnu packages samba) #:use-module ((guix licenses) diff --git a/gnu/packages/mpd.scm b/gnu/packages/mpd.scm index a20103df4f..634bc7c6bd 100644 --- a/gnu/packages/mpd.scm +++ b/gnu/packages/mpd.scm @@ -35,7 +35,7 @@ #:use-module (gnu packages ncurses) #:use-module (gnu packages pkg-config) #:use-module (gnu packages pulseaudio) - #:use-module (gnu packages sqlite) + #:use-module (gnu packages databases) #:use-module (gnu packages video) #:use-module (gnu packages xiph) #:export (libmpdclient diff --git a/gnu/packages/mysql.scm b/gnu/packages/mysql.scm deleted file mode 100644 index e89770e907..0000000000 --- a/gnu/packages/mysql.scm +++ /dev/null @@ -1,87 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Ludovic Courtès -;;; -;;; 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 . - -(define-module (gnu packages mysql) - #:use-module (gnu packages) - #:use-module (gnu packages perl) - #:use-module (gnu packages linux) - #:use-module (gnu packages openssl) - #:use-module (gnu packages compression) - #:use-module (gnu packages ncurses) - #:use-module ((guix licenses) #:select (gpl2)) - #:use-module (guix packages) - #:use-module (guix download) - #:use-module (guix build-system gnu)) - -(define-public mysql - (package - (name "mysql") - (version "5.1.73") - (source (origin - (method url-fetch) - (uri (string-append - "http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-" - version ".tar.gz")) - (sha256 - (base32 - "1dfwi4ck0vq6sdci6gz0031s7zz5lc3pddqlgm0292s00l9y5sq5")))) - (build-system gnu-build-system) - (inputs - `(("procps" ,procps) - ("openssl" ,openssl) - ("perl" ,perl) - ("zlib" ,zlib) - ("ncurses" ,ncurses))) - (arguments - '(#:modules ((guix build gnu-build-system) - (guix build utils) - (ice-9 ftw)) ; for "rm -rf" - #:phases (alist-cons-after - 'install 'clean-up - (lambda* (#:key outputs #:allow-other-keys) - ;; Remove the 112 MiB of tests that get installed. - (let ((out (assoc-ref outputs "out"))) - (define (rm-rf dir) - (file-system-fold (const #t) ; enter? - (lambda (file stat result) ; leaf - (delete-file file)) - (const #t) ; down - (lambda (dir stat result) ; up - (rmdir dir)) - (const #t) - (lambda (file stat errno result) - (format (current-error-port) - "error: ~a: ~a~%" - file (strerror errno))) - #t - (string-append out "/" dir))) - (rm-rf "mysql-test") - (rm-rf "sql-bench") - - ;; Compress the 14 MiB Info file. - (zero? - (system* "gzip" "--best" - (string-append out "/share/info/mysql.info"))))) - %standard-phases))) - (home-page "http://www.mysql.com/") - (synopsis "A fast, easy to use, and popular database") - (description - "MySQL is a fast, reliable, and easy to use relational database -management system that supports the standardized Structured Query -Language.") - (license gpl2))) diff --git a/gnu/packages/nvi.scm b/gnu/packages/nvi.scm index 3037e5bafc..8fd736d180 100644 --- a/gnu/packages/nvi.scm +++ b/gnu/packages/nvi.scm @@ -18,7 +18,7 @@ (define-module (gnu packages nvi) #:use-module (gnu packages) - #:use-module (gnu packages bdb) + #:use-module (gnu packages databases) #:use-module (gnu packages ncurses) #:use-module (guix packages) #:use-module (guix download) diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm index 574f11904a..23c32488e9 100644 --- a/gnu/packages/openldap.scm +++ b/gnu/packages/openldap.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2013, 2014 Ludovic Courtès ;;; Copyright © 2013 Andreas Enge ;;; ;;; This file is part of GNU Guix. @@ -19,7 +19,7 @@ (define-module (gnu packages openldap) #:use-module (gnu packages autotools) - #:use-module (gnu packages bdb) + #:use-module (gnu packages databases) #:use-module (gnu packages compression) #:use-module (gnu packages cyrus-sasl) #:use-module (gnu packages gnupg) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 66e71df284..9f35de1819 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -27,7 +27,7 @@ #:use-module (gnu packages guile) #:use-module ((gnu packages compression) #:select (bzip2 gzip)) #:use-module (gnu packages gnupg) - #:use-module (gnu packages sqlite) + #:use-module (gnu packages databases) #:use-module (gnu packages graphviz) #:use-module (gnu packages pkg-config) #:use-module (gnu packages autotools) diff --git a/gnu/packages/postgresql.scm b/gnu/packages/postgresql.scm deleted file mode 100644 index d6b505f6a2..0000000000 --- a/gnu/packages/postgresql.scm +++ /dev/null @@ -1,52 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014 David Thompson -;;; -;;; 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 . - -(define-module (gnu packages postgresql) - #:use-module ((guix licenses) #:select (x11-style)) - #:use-module (guix packages) - #:use-module (guix download) - #:use-module (guix build-system gnu) - #:use-module (gnu packages) - #:use-module (gnu packages compression) - #:use-module (gnu packages readline)) - -(define-public postgresql - (package - (name "postgresql") - (version "9.3.5") - (source (origin - (method url-fetch) - (uri (string-append "http://ftp.postgresql.org/pub/source/v" - version "/postgresql-" version ".tar.gz")) - (sha256 - (base32 - "08kga00izykgvnx7hn995wc4zjqslspapaa8z63045p1ya14mr4g")))) - (build-system gnu-build-system) - (inputs - `(("readline" ,readline) - ("zlib" ,zlib))) - (home-page "http://www.postgresql.org/") - (synopsis "Powerful object-relational database system") - (description - "PostgreSQL is a powerful object-relational database system. It is fully -ACID compliant, has full support for foreign keys, joins, views, triggers, and -stored procedures (in multiple languages). It includes most SQL:2008 data -types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and -TIMESTAMP. It also supports storage of binary large objects, including -pictures, sounds, or video.") - (license (x11-style "file://COPYRIGHT")))) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 81b6c956a9..3046c3b1e1 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -36,7 +36,7 @@ #:use-module (gnu packages openssl) #:use-module (gnu packages elf) #:use-module (gnu packages pkg-config) - #:use-module (gnu packages sqlite) + #:use-module (gnu packages databases) #:use-module (gnu packages zip) #:use-module (gnu packages multiprecision) #:use-module (guix packages) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 4d367d8ab7..ced7e90575 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -30,7 +30,7 @@ #:use-module (gnu packages icu4c) #:use-module (gnu packages image) #:use-module (gnu packages linux) - #:use-module (gnu packages mysql) + #:use-module (gnu packages databases) #:use-module (gnu packages openssl) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) diff --git a/gnu/packages/rdf.scm b/gnu/packages/rdf.scm index 7634e48018..19a68be229 100644 --- a/gnu/packages/rdf.scm +++ b/gnu/packages/rdf.scm @@ -23,7 +23,7 @@ #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (gnu packages) - #:use-module (gnu packages bdb) + #:use-module (gnu packages databases) #:use-module (gnu packages boost) #:use-module (gnu packages compression) #:use-module (gnu packages curl) diff --git a/gnu/packages/recutils.scm b/gnu/packages/recutils.scm deleted file mode 100644 index 7e78ac121d..0000000000 --- a/gnu/packages/recutils.scm +++ /dev/null @@ -1,66 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès -;;; -;;; 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 . - -(define-module (gnu packages recutils) - #:use-module (guix licenses) - #:use-module (gnu packages) - #:use-module (guix packages) - #:use-module (guix download) - #:use-module (guix build-system gnu) - #:use-module (gnu packages emacs) - #:use-module (gnu packages check) - #:use-module (gnu packages algebra) - #:use-module (gnu packages curl) - #:use-module (gnu packages gnupg)) - -(define-public recutils - (package - (name "recutils") - (version "1.7") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnu/recutils/recutils-" - version ".tar.gz")) - (sha256 - (base32 - "0cdwa4094x3yx7vn98xykvnlp9rngvd58d19vs3vh5hrvggccg93")))) - (build-system gnu-build-system) - - ;; Running tests in parallel leads to test failures and crashes in - ;; torture/utils. - (arguments '(#:parallel-tests? #f)) - - (native-inputs `(("emacs" ,emacs) - ("bc" ,bc))) - - ;; TODO: Add more optional inputs. - ;; FIXME: Our Bash doesn't have development headers (need for the 'readrec' - ;; built-in command), but it's not clear how to get them installed. - ;; See . - (inputs `(("curl" ,curl) - ("libgcrypt" ,libgcrypt) - ("check" ,check))) - (synopsis "Manipulate plain text files as databases") - (description - "GNU Recutils is a set of tools and libraries for creating and -manipulating text-based, human-editable databases. Despite being text-based, -databases created with Recutils carry all of the expected features such as -unique fields, primary keys, time stamps and more. Many different field types -are supported, as is encryption.") - (license gpl3+) - (home-page "http://www.gnu.org/software/recutils/"))) diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm deleted file mode 100644 index e19160a864..0000000000 --- a/gnu/packages/sqlite.scm +++ /dev/null @@ -1,63 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Cyril Roelandt -;;; Copyright © 2014 Mark H Weaver -;;; -;;; 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 . - -(define-module (gnu packages sqlite) - #:use-module (guix licenses) - #:use-module (guix packages) - #:use-module (guix download) - #:use-module (guix build-system gnu) - #:use-module (gnu packages) - #:use-module (srfi srfi-26) - #:use-module (ice-9 match)) - -(define-public sqlite - (package - (name "sqlite") - (version "3.8.4.3") - (source (origin - (method url-fetch) - ;; TODO: Download from sqlite.org once this bug : - ;; http://lists.gnu.org/archive/html/bug-guile/2013-01/msg00027.html - ;; has been fixed. - (uri (let ((numeric-version - (match (string-split version #\.) - ((first-digit other-digits ...) - (string-append first-digit - (string-pad-right - (string-concatenate - (map (cut string-pad <> 2 #\0) - other-digits)) - 6 #\0)))))) - (string-append - "mirror://sourceforge/sqlite.mirror/SQLite%20" version - "/sqlite-autoconf-" numeric-version ".tar.gz"))) - (sha256 - (base32 - "0rcdsk5sz34w8vy0g5yhfms4saiq81i872jxx5m5sjij7bi9bsg0")) - (patches - (list (search-patch "sqlite-large-page-size-fix.patch"))))) - (build-system gnu-build-system) - (home-page "http://www.sqlite.org/") - (synopsis "The SQLite database management system") - (description - "SQLite is a software library that implements a self-contained, serverless, -zero-configuration, transactional SQL database engine. SQLite is the most -widely deployed SQL database engine in the world. The source code for SQLite is -in the public domain.") - (license public-domain))) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 83ad35fb77..89b26e69df 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -44,7 +44,7 @@ #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) - #:use-module (gnu packages sqlite) + #:use-module (gnu packages databases) #:use-module (gnu packages admin) #:use-module (gnu packages xml) #:use-module (gnu packages emacs) From db60b1d9ffd8aa1ae98bfa9cf15614d9400fc1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 8 Sep 2014 18:00:03 +0200 Subject: [PATCH 03/44] gnu: Add tdb. * gnu/packages/databases.scm (tdb): New variable. --- gnu/packages/databases.scm | 40 +++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index 553a078a88..01d9cbdd62 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -33,8 +33,9 @@ #:use-module (gnu packages algebra) #:use-module (gnu packages curl) #:use-module (gnu packages gnupg) + #:use-module (gnu packages python) #:use-module ((guix licenses) - #:select (gpl2 gpl3+ x11-style bsd-style + #:select (gpl2 gpl3+ lgpl3+ x11-style bsd-style public-domain)) #:use-module (guix packages) #:use-module (guix download) @@ -243,3 +244,40 @@ zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.") (license public-domain))) + +(define-public tdb + (package + (name "tdb") + (version "1.3.0") + (source (origin + (method url-fetch) + (uri (string-append "http://samba.org/ftp/tdb/tdb-" + version ".tar.gz")) + (sha256 + (base32 + "085sd2kii72fr0c4pdc7c7m0xk34nc66wnjp21c83dss826y9gh4")))) + (build-system gnu-build-system) + (arguments + '(#:phases (alist-replace + 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + ;; The 'configure' script is a wrapper for Waf and + ;; doesn't recognize things like '--enable-fast-install'. + (zero? (system* "./configure" + (string-append "--prefix=" out))))) + %standard-phases))) + (native-inputs + `(;; TODO: Build the documentation. + ;; ("docbook-xsl" ,docbook-xsl) + ;; ("libxml2" ,libxml2) + ;; ("libxslt" ,libxslt) + ("python" ,python-2))) ;for the Waf build system + (home-page "http://tdb.samba.org/") + (synopsis "TDB, the trivial database") + (description + "TDB is a Trivial Database. In concept, it is very much like GDBM, +and BSD's DB except that it allows multiple simultaneous writers and uses +locking internally to keep writers from trampling on each other. TDB is also +extremely small.") + (license lgpl3+))) From 91cc37a1e3e0554ee95ceff96250fb65c63ea3bd Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Sat, 6 Sep 2014 18:00:45 +0400 Subject: [PATCH 04/44] emacs: Improve key bindings for marking the packages. Use "U" to upgrade the current package, "^" to upgrade all. * emacs/guix-list.el: (guix-list-unmark): With prefix, mark all. (guix-package-list-mark-outputs): New procedure. (guix-package-list-mark-install, guix-package-list-mark-delete) (guix-package-list-mark-upgrade): Use it. (guix-package-list-mark-upgrades): New command. * doc/emacs.texi (emacs List buffer): Update the manual accordingly. --- doc/emacs.texi | 16 ++++---- emacs/guix-list.el | 96 +++++++++++++++++++++++++++++++--------------- 2 files changed, 75 insertions(+), 37 deletions(-) diff --git a/doc/emacs.texi b/doc/emacs.texi index 55feb1bf9f..7616c8f92d 100644 --- a/doc/emacs.texi +++ b/doc/emacs.texi @@ -163,11 +163,9 @@ Mark the current entry. @item M Mark all entries. @item u -Unmark the current entry. +Unmark the current entry (with prefix, unmark all entries). @item @key{DEL} Unmark backward. -@item U -Unmark all entries. @item S Sort entries by a specified column. @end table @@ -179,12 +177,16 @@ A ``package-list'' buffer additionally provides the following bindings: Describe marked packages (display available information in a ``package-info'' buffer). @item i -Mark a package for installation (with prefix, prompt for output(s) to -install). +Mark "out" of the current package for installation (with prefix, prompt +for output(s) to install). @item d -Mark a package for deletion. +Mark all installed outputs of the current package for deletion (with +prefix, prompt for output(s) to delete). +@item U +Mark all installed outputs of the current package for upgrading (with +prefix, prompt for output(s) to upgrade). @item ^ -Mark a package for upgrading. +Mark all obsolete packages for upgrading. @item x Execute actions on marked packages. @end table diff --git a/emacs/guix-list.el b/emacs/guix-list.el index 08fb3cba5c..8d9b231dd1 100644 --- a/emacs/guix-list.el +++ b/emacs/guix-list.el @@ -303,10 +303,13 @@ Interactively, put a general mark on all lines." (interactive '(general)) (guix-list-for-each-line #'guix-list-mark mark-name)) -(defun guix-list-unmark () - "Unmark the current line and move to the next line." - (interactive) - (guix-list-mark 'empty t)) +(defun guix-list-unmark (&optional arg) + "Unmark the current line and move to the next line. +With ARG, unmark all lines." + (interactive "P") + (if arg + (guix-list-unmark-all) + (guix-list-mark 'empty t))) (defun guix-list-unmark-backward () "Move up one line and unmark it." @@ -344,7 +347,6 @@ Same as `tabulated-list-sort', but also restore marks after sorting." (define-key map (kbd "*") 'guix-list-mark) (define-key map (kbd "M") 'guix-list-mark-all) (define-key map (kbd "u") 'guix-list-unmark) - (define-key map (kbd "U") 'guix-list-unmark-all) (define-key map (kbd "DEL") 'guix-list-unmark-backward) (define-key map [remap tabulated-list-sort] 'guix-list-sort) map) @@ -478,8 +480,9 @@ likely)." (define-key map (kbd "RET") 'guix-package-list-describe) (define-key map (kbd "x") 'guix-package-list-execute) (define-key map (kbd "i") 'guix-package-list-mark-install) - (define-key map (kbd "^") 'guix-package-list-mark-upgrade) - (define-key map (kbd "d") 'guix-package-list-mark-delete)) + (define-key map (kbd "d") 'guix-package-list-mark-delete) + (define-key map (kbd "U") 'guix-package-list-mark-upgrade) + (define-key map (kbd "^") 'guix-package-list-mark-upgrades)) (defun guix-package-list-get-name (name entry) "Return NAME of the package ENTRY. @@ -505,24 +508,33 @@ Colorize it with `guix-package-list-installed' or (eq guix-search-type 'generation)) (error "Action marks are disabled for lists of 'generation packages'"))) +(defun guix-package-list-mark-outputs (mark default + &optional prompt available) + "Mark the current package with MARK and move to the next line. +If PROMPT is non-nil, use it to ask a user for outputs from +AVAILABLE list, otherwise mark all DEFAULT outputs." + (let ((outputs (if prompt + (guix-completing-read-multiple + prompt available nil t) + default))) + (apply #'guix-list-mark mark t outputs))) + (defun guix-package-list-mark-install (&optional arg) "Mark the current package for installation and move to the next line. With ARG, prompt for the outputs to install (several outputs may be separated with \",\")." (interactive "P") (guix-package-list-marking-check) - (let* ((entry (guix-list-current-entry)) - (available (guix-get-key-val entry 'outputs)) + (let* ((entry (guix-list-current-entry)) + (all (guix-get-key-val entry 'outputs)) (installed (guix-get-installed-outputs entry)) - (to-install (if arg - (guix-completing-read-multiple - "Output(s) to install: " available nil t) - '("out"))) - (to-install (cl-set-difference to-install installed - :test #'string=))) - (if to-install - (apply #'guix-list-mark 'install t to-install) - (user-error "This package is already installed")))) + (available (cl-set-difference all installed :test #'string=))) + (or available + (user-error "This package is already installed")) + (guix-package-list-mark-outputs + 'install '("out") + (and arg "Output(s) to install: ") + available))) (defun guix-package-list-mark-delete (&optional arg) "Mark the current package for deletion and move to the next line. @@ -534,23 +546,47 @@ be separated with \",\")." (installed (guix-get-installed-outputs entry))) (or installed (user-error "This package is not installed")) - (let ((to-delete (when arg - (guix-completing-read-multiple - "Output(s) to delete: " installed nil t)))) - (if to-delete - (apply #'guix-list-mark 'delete t to-delete) - (guix-package-list-mark-delete-simple))))) + (guix-package-list-mark-outputs + 'delete installed + (and arg "Output(s) to delete: ") + installed))) -(defun guix-package-list-mark-upgrade () - "Mark the current package for upgrading and move to the next line." - (interactive) +(defun guix-package-list-mark-upgrade (&optional arg) + "Mark the current package for upgrading and move to the next line. +With ARG, prompt for the outputs to upgrade (several outputs may +be separated with \",\")." + (interactive "P") (guix-package-list-marking-check) - (let ((entry (guix-list-current-entry))) - (or (guix-get-installed-outputs entry) + (let* ((entry (guix-list-current-entry)) + (installed (guix-get-installed-outputs entry))) + (or installed (user-error "This package is not installed")) (when (or (guix-get-key-val entry 'obsolete) (y-or-n-p "This package is not obsolete. Try to upgrade it anyway? ")) - (guix-package-list-mark-upgrade-simple)))) + (guix-package-list-mark-outputs + 'upgrade installed + (and arg "Output(s) to upgrade: ") + installed)))) + +(defun guix-package-list-mark-upgrades () + "Mark all obsolete packages for upgrading." + (interactive) + (guix-package-list-marking-check) + (let ((obsolete (cl-remove-if-not + (lambda (entry) + (guix-get-key-val entry 'obsolete)) + guix-entries))) + (guix-list-for-each-line + (lambda () + (let* ((id (guix-list-current-id)) + (entry (cl-find-if + (lambda (entry) + (equal id (guix-get-key-val entry 'id))) + obsolete))) + (when entry + (apply #'guix-list-mark + 'upgrade nil + (guix-get-installed-outputs entry)))))))) (defun guix-package-list-execute () "Perform actions on the marked packages." From 813caa0a66c0e9e2b2613fd0902906e19ada0a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 8 Sep 2014 21:00:48 +0200 Subject: [PATCH 05/44] gnu: youtube-dl: Update to 2014.09.06. * gnu/packages/video.scm (youtube-dl): Update to 2014.09.06. --- gnu/packages/video.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 2873c49e3b..2fabf2679d 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -383,7 +383,7 @@ SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.") (define-public youtube-dl (package (name "youtube-dl") - (version "2014.06.26") + (version "2014.09.06") (source (origin (method url-fetch) (uri (string-append "http://youtube-dl.org/downloads/" @@ -391,7 +391,7 @@ SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.") version ".tar.gz")) (sha256 (base32 - "0jl90plg9mz4mwich219a58y4npwi33myx0cx44v8pymkqykv5cd")))) + "1a50vqgzp9wjh2763shald6dlmdd5qlqy83vg4yrihdrlh8sk6dd")))) (build-system python-build-system) (inputs `(("setuptools" ,python-setuptools))) (home-page "http://youtube-dl.org") From c4492a16ea3a143672955653049bc6659a0e286d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 8 Sep 2014 21:20:55 +0200 Subject: [PATCH 06/44] gnu: Add testdisk. * gnu/packages/admin.scm (testdisk): New variable. --- gnu/packages/admin.scm | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 985cedfe9b..d5bf4317f5 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -37,7 +37,7 @@ #:use-module (gnu packages perl) #:use-module (gnu packages tcl) #:use-module ((gnu packages compression) - #:select (gzip)) + #:renamer (symbol-prefix-proc 'c:)) #:use-module ((gnu packages openssl) #:renamer (symbol-prefix-proc 'o:)) #:use-module (gnu packages bison) @@ -50,6 +50,7 @@ #:use-module (gnu packages pciutils) #:use-module (gnu packages libusb) #:use-module (gnu packages libftdi) + #:use-module (gnu packages image) #:use-module (gnu packages xorg)) (define-public dmd @@ -307,7 +308,7 @@ allow automatic login and starting any app.") '("services" "protocols" "rpc"))) #t)))) (native-inputs `(("tar" ,tar) - ("gzip" ,gzip))) + ("gzip" ,c:gzip))) (synopsis "IANA protocol, port, and RPC number assignments") (description "This package provides the /etc/services, /etc/protocols, and /etc/rpc @@ -938,3 +939,31 @@ under Unix and related operating systems. Spaces and various other unsafe characters (such as \"$\") get replaced with \"_\". ISO 8859-1 (Latin-1) characters can be replaced as well, as can UTF-8 characters.") (license bsd-3))) + +(define-public testdisk + (package + (name "testdisk") + (version "6.14") + (source (origin + (method url-fetch) + (uri (string-append "http://www.cgsecurity.org/testdisk-" + version ".tar.bz2")) + (sha256 + (base32 + "0v1jap83f5h99zv01v3qmqm160d36n4ysi0gyq7xzb3mqgmw75x5")))) + (build-system gnu-build-system) + (inputs + `(;; ("ntfs" ,ntfs) + ("util-linux" ,util-linux) + ("openssl" ,o:openssl) + ("zlib" ,c:zlib) + ("e2fsprogs" ,e2fsprogs) + ("libjpeg" ,libjpeg) + ("ncurses" ,ncurses))) + (home-page "http://www.cgsecurity.org/wiki/TestDisk") + (synopsis "Data recovery tool") + (description + "TestDisk is a program for data recovery, primarily designed to help +recover lost partitions and/or make non-booting disks bootable again.") + (license gpl2+))) + From c2619e10ea55ef12054eee41de58b1f6c867ac48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 8 Sep 2014 21:48:54 +0200 Subject: [PATCH 07/44] gnu: Add GNU direvent. * gnu/packages/admin.scm (direvent): New variable. --- gnu/packages/admin.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index d5bf4317f5..f28c768ceb 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -967,3 +967,40 @@ characters can be replaced as well, as can UTF-8 characters.") recover lost partitions and/or make non-booting disks bootable again.") (license gpl2+))) +(define-public direvent + (package + (name "direvent") + (version "5.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/direvent/direvent-" + version ".tar.gz")) + (sha256 + (base32 + "1i14131y6m8wvirz6piw4zxz2q1kbpl0lniv5kl55rx4k372dg8z")) + (modules '((guix build utils))) + (snippet '(substitute* "tests/testsuite" + (("#![[:blank:]]?/bin/sh") + "#!$SHELL"))))) + (build-system gnu-build-system) + (arguments + '(#:phases (alist-cons-before + 'build 'patch-/bin/sh + (lambda* (#:key inputs #:allow-other-keys) + ;; Use the right shell when executing the watcher. + (let ((bash (assoc-ref inputs "bash"))) + (substitute* "src/direvent.c" + (("\"/bin/sh\"") + (string-append "\"" bash "/bin/sh\""))))) + %standard-phases))) + (home-page "http://www.gnu.org/software/direvent/") + (synopsis "Daemon to monitor directories for events such as file removal") + (description + "A daemon that monitors directories for events, such as creating, +deleting or modifying files. It can monitor different sets of directories for +different events. When an event is detected, direvent calls a specified +external program with information about the event, such as the location +within the file system where it occurred. Thus, \"direvent\" provides an easy +way to react immediately if given files undergo changes, for example, to +track changes in important system configuration files.") + (license gpl3+))) From 70608adb4a054438a9dee4abcf63858f3d0dfded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 8 Sep 2014 22:26:05 +0200 Subject: [PATCH 08/44] linux-initrd: Copy all the script's closure to the initrd. * gnu/system/linux-initrd.scm (expression->initrd): Remove calls to 'imported-modules' and 'compiled-modules'. Use 'gexp->script' with EXP. Add the result to TO-COPY. Make /init a symlink to that script, and copy its closure into the "contents" directory. Add fake /proc/self/exe symlink. * gnu/build/linux-boot.scm (load-linux-module*): Add comment about mmap. * gnu/system/vm.scm (system-qemu-image/shared-store-script): Add "-m 256". This turns out to be needed for initrds containing things like e2fsck and several modules; with the default of 128 MiB, loading libahci.ko may fail with -1. --- gnu/build/linux-boot.scm | 1 + gnu/system/linux-initrd.scm | 112 +++++++++++++++++------------------- gnu/system/vm.scm | 4 +- 3 files changed, 56 insertions(+), 61 deletions(-) diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 21ee58ad50..1312da6bbd 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -221,6 +221,7 @@ networking values.) Return #t if INTERFACE is up, #f otherwise." (define (load-linux-module* file) "Load Linux module from FILE, the name of a `.ko' file." (define (slurp module) + ;; TODO: Use 'mmap' to reduce memory usage. (call-with-input-file file get-bytevector-all)) (load-linux-module (slurp file))) diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 627d17bac2..b05cfc5bcd 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -68,85 +68,77 @@ initrd." ;; General Linux overview in `Documentation/early-userspace/README' and ;; `Documentation/filesystems/ramfs-rootfs-initramfs.txt'. - (define graph-files - (unfold-right zero? - number->string - 1- - (length to-copy))) + (mlet* %store-monad ((init (gexp->script "init" exp + #:modules modules + #:guile guile)) + (to-copy -> (cons init to-copy)) + (module-dir (flat-linux-module-directory linux + linux-modules))) + (define graph-files + (unfold-right zero? + number->string + 1- + (length to-copy))) - (mlet %store-monad ((source (imported-modules modules)) - (compiled (compiled-modules modules)) - (module-dir (flat-linux-module-directory linux - linux-modules))) (define builder ;; TODO: Move most of this code to (gnu build linux-initrd). #~(begin (use-modules (gnu build linux-initrd) (guix build utils) (guix build store-copy) - (ice-9 pretty-print) - (ice-9 popen) - (ice-9 match) - (ice-9 ftw) - (srfi srfi-26) (system base compile) (rnrs bytevectors) ((system foreign) #:select (sizeof))) - (let ((modules #$source) - (gos #$compiled) - (scm-dir (string-append "share/guile/" (effective-version))) - (go-dir (format #f ".cache/guile/ccache/~a-~a-~a-~a" - (effective-version) - (if (eq? (native-endianness) (endianness little)) - "LE" - "BE") - (sizeof '*) - (effective-version)))) - (mkdir #$output) - (mkdir "contents") + (mkdir #$output) + (mkdir "contents") - (with-directory-excursion "contents" - (copy-recursively #$guile ".") - (call-with-output-file "init" - (lambda (p) - (format p "#!/bin/guile -ds~%!#~%" #$guile) - (pretty-print '#$exp p))) - (chmod "init" #o555) - (chmod "bin/guile" #o555) + (with-directory-excursion "contents" + ;; Copy Linux modules. + (mkdir "modules") + (copy-recursively #$module-dir "modules") - ;; Copy Guile modules. - (chmod scm-dir #o777) - (copy-recursively modules scm-dir - #:follow-symlinks? #t) - (copy-recursively gos (string-append "lib/guile/" - (effective-version) "/ccache") - #:follow-symlinks? #t) + ;; Populate the initrd's store. + (with-directory-excursion ".." + (populate-store '#$graph-files "contents")) - ;; Compile `init'. + ;; Make '/init'. + (symlink #$init "init") + + ;; Compile it. + (let* ((init (readlink "init")) + (scm-dir (string-append "share/guile/" (effective-version))) + (go-dir (format #f ".cache/guile/ccache/~a-~a-~a-~a/~a" + (effective-version) + (if (eq? (native-endianness) (endianness little)) + "LE" + "BE") + (sizeof '*) + (effective-version) + (dirname init)))) (mkdir-p go-dir) - (set! %load-path (cons modules %load-path)) - (set! %load-compiled-path (cons gos %load-compiled-path)) - (compile-file "init" + (compile-file init #:opts %auto-compilation-options - #:output-file (string-append go-dir "/init.go")) + #:output-file (string-append go-dir "/" + (basename init) + ".go"))) - ;; Copy Linux modules. - (mkdir "modules") - (copy-recursively #$module-dir "modules") + ;; This hack allows Guile to find out where it is. See + ;; 'guile-relocatable.patch'. + (mkdir-p "proc/self") + (symlink (string-append #$guile "/bin/guile") "proc/self/exe") + (readlink "proc/self/exe") - ;; Populate the initrd's store. - (with-directory-excursion ".." - (populate-store '#$graph-files "contents")) + ;; Reset the timestamps of all the files that will make it in the + ;; initrd. + (for-each (lambda (file) + (unless (eq? 'symlink (stat:type (lstat file))) + (utime file 0 0 0 0))) + (find-files "." ".*")) - ;; Reset the timestamps of all the files that will make it in the - ;; initrd. - (for-each (cut utime <> 0 0 0 0) - (find-files "." ".*")) - - (write-cpio-archive (string-append #$output "/initrd") "." - #:cpio (string-append #$cpio "/bin/cpio") - #:gzip (string-append #$gzip "/bin/gzip")))))) + (write-cpio-archive (string-append #$output "/initrd") "." + #:cpio (string-append #$cpio "/bin/cpio") + #:gzip (string-append #$gzip "/bin/gzip"))))) (gexp->derivation name builder #:modules '((guix build utils) diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 205bf2cb19..4ee8dc5cf2 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -428,7 +428,9 @@ exec " #$qemu "/bin/" #$(qemu-command (%current-system)) "--system=" #$os-drv " --load=" #$os-drv "/boot --root=/dev/vda1\" \ -serial stdio \ -drive file=" #$image - ",if=virtio,cache=writeback,werror=report,readonly\n") + ",if=virtio,cache=writeback,werror=report,readonly \ + -m 256 +\n") port) (chmod port #o555)))) From 1621cf97aa0b0e19a53366479abe19f602f5f9da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 8 Sep 2014 23:20:34 +0200 Subject: [PATCH 09/44] linux-initrd: Move initrd creation code to (guix build linux-initrd). * gnu/build/linux-initrd.scm (cache-compiled-file-name, compile-to-cache, build-initrd): New procedures. * gnu/system/linux-initrd.scm (expression->initrd)[builder]: Remove code now moved above. Use 'build-initrd'. --- gnu/build/linux-initrd.scm | 77 ++++++++++++++++++++++++++++++++++++- gnu/system/linux-initrd.scm | 63 ++++-------------------------- 2 files changed, 84 insertions(+), 56 deletions(-) diff --git a/gnu/build/linux-initrd.scm b/gnu/build/linux-initrd.scm index bf60137e8f..2c0acb200e 100644 --- a/gnu/build/linux-initrd.scm +++ b/gnu/build/linux-initrd.scm @@ -17,9 +17,15 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu build linux-initrd) + #:use-module (guix build utils) + #:use-module (guix build store-copy) + #:use-module (system base compile) + #:use-module (rnrs bytevectors) + #:use-module ((system foreign) #:select (sizeof)) #:use-module (ice-9 popen) #:use-module (ice-9 ftw) - #:export (write-cpio-archive)) + #:export (write-cpio-archive + build-initrd)) ;;; Commentary: ;;; @@ -69,4 +75,73 @@ COMPRESS? is true, compress it using GZIP. On success, return OUTPUT." output)) output)))) +(define (cache-compiled-file-name file) + "Return the file name of the in-cache .go file for FILE, relative to the +current directory. + +This is similar to what 'compiled-file-name' in (system base compile) does." + (let loop ((file file)) + (let ((target (false-if-exception (readlink file)))) + (if target + (loop target) + (format #f ".cache/guile/ccache/~a-~a-~a-~a/~a" + (effective-version) + (if (eq? (native-endianness) (endianness little)) + "LE" + "BE") + (sizeof '*) + (effective-version) + file))))) + +(define (compile-to-cache file) + "Compile FILE to the cache." + (let ((compiled-file (cache-compiled-file-name file))) + (mkdir-p (dirname compiled-file)) + (compile-file file + #:opts %auto-compilation-options + #:output-file compiled-file))) + +(define* (build-initrd output + #:key + guile init + linux-module-directory + (references-graphs '()) + (cpio "cpio") + (gzip "gzip")) + "Write an initial RAM disk (initrd) to OUTPUT. The initrd starts the script +at INIT, running GUILE. It contains all the items referred to by +REFERENCES-GRAPHS, plus the Linux modules from LINUX-MODULE-DIRECTORY." + (mkdir "contents") + + ;; Copy the closures of all the items referenced in REFERENCES-GRAPHS. + (populate-store references-graphs "contents") + + (with-directory-excursion "contents" + ;; Copy Linux modules. + (mkdir "modules") + (copy-recursively linux-module-directory "modules") + + ;; Make '/init'. + (symlink init "init") + + ;; Compile it. + (compile-to-cache "init") + + ;; Allow Guile to find out where it is (XXX). See + ;; 'guile-relocatable.patch'. + (mkdir-p "proc/self") + (symlink (string-append guile "/bin/guile") "proc/self/exe") + (readlink "proc/self/exe") + + ;; Reset the timestamps of all the files that will make it in the initrd. + (for-each (lambda (file) + (unless (eq? 'symlink (stat:type (lstat file))) + (utime file 0 0 0 0))) + (find-files "." ".*")) + + (write-cpio-archive output "." + #:cpio cpio #:gzip gzip)) + + (delete-file-recursively "contents")) + ;;; linux-initrd.scm ends here diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index b05cfc5bcd..c2c8722ebb 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -81,64 +81,17 @@ initrd." (length to-copy))) (define builder - ;; TODO: Move most of this code to (gnu build linux-initrd). #~(begin - (use-modules (gnu build linux-initrd) - (guix build utils) - (guix build store-copy) - (system base compile) - (rnrs bytevectors) - ((system foreign) #:select (sizeof))) + (use-modules (gnu build linux-initrd)) (mkdir #$output) - (mkdir "contents") - - (with-directory-excursion "contents" - ;; Copy Linux modules. - (mkdir "modules") - (copy-recursively #$module-dir "modules") - - ;; Populate the initrd's store. - (with-directory-excursion ".." - (populate-store '#$graph-files "contents")) - - ;; Make '/init'. - (symlink #$init "init") - - ;; Compile it. - (let* ((init (readlink "init")) - (scm-dir (string-append "share/guile/" (effective-version))) - (go-dir (format #f ".cache/guile/ccache/~a-~a-~a-~a/~a" - (effective-version) - (if (eq? (native-endianness) (endianness little)) - "LE" - "BE") - (sizeof '*) - (effective-version) - (dirname init)))) - (mkdir-p go-dir) - (compile-file init - #:opts %auto-compilation-options - #:output-file (string-append go-dir "/" - (basename init) - ".go"))) - - ;; This hack allows Guile to find out where it is. See - ;; 'guile-relocatable.patch'. - (mkdir-p "proc/self") - (symlink (string-append #$guile "/bin/guile") "proc/self/exe") - (readlink "proc/self/exe") - - ;; Reset the timestamps of all the files that will make it in the - ;; initrd. - (for-each (lambda (file) - (unless (eq? 'symlink (stat:type (lstat file))) - (utime file 0 0 0 0))) - (find-files "." ".*")) - - (write-cpio-archive (string-append #$output "/initrd") "." - #:cpio (string-append #$cpio "/bin/cpio") - #:gzip (string-append #$gzip "/bin/gzip"))))) + (build-initrd (string-append #$output "/initrd") + #:guile #$guile + #:init #$init + #:references-graphs '#$graph-files + #:linux-module-directory #$module-dir + #:cpio (string-append #$cpio "/bin/cpio") + #:gzip (string-append #$gzip "/bin/gzip")))) (gexp->derivation name builder #:modules '((guix build utils) From df650fa84e15bfd65245adcd454c0433ad8c6121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 8 Sep 2014 23:27:40 +0200 Subject: [PATCH 10/44] linux-initrd: Remove #:to-copy argument of 'expression->initrd'. * gnu/system/linux-initrd.scm (expression->initrd): Remove #:to-copy parameter. Remove 'graph-files', and adjust #:references-graphs arguments to just list INIT. (base-initrd): Remove #:to-copy argument. * doc/guix.texi (Initial RAM Disk): Adjust accordingly. --- doc/guix.texi | 10 +++++----- gnu/system/linux-initrd.scm | 19 +++++-------------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index e0251f5ffd..1e8a55e9a5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3616,16 +3616,16 @@ program to run in that initrd. @deffn {Monadic Procedure} expression->initrd @var{exp} @ [#:guile %guile-static-stripped] [#:name "guile-initrd"] @ - [#:modules '()] [#:to-copy '()] [#:linux #f] @ + [#:modules '()] [#:linux #f] @ [#:linux-modules '()] Return a derivation that builds a Linux initrd (a gzipped cpio archive) containing @var{guile} and that evaluates @var{exp}, a G-expression, -upon booting. +upon booting. All the derivations referenced by @var{exp} are +automatically copied to the initrd. @var{linux-modules} is a list of @file{.ko} file names to be copied from -@var{linux} into the initrd. @var{to-copy} is a list of additional -derivations or packages to copy to the initrd. @var{modules} is a list -of Guile module names to be embedded in the initrd. +@var{linux} into the initrd. @var{modules} is a list of Guile module +names to be embedded in the initrd. @end deffn @node Invoking guix system diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index c2c8722ebb..03ac24d450 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -54,15 +54,14 @@ (name "guile-initrd") (system (%current-system)) (modules '()) - (to-copy '()) (linux #f) (linux-modules '())) "Return a derivation that builds a Linux initrd (a gzipped cpio archive) -containing GUILE and that evaluates EXP, a G-expression, upon booting. +containing GUILE and that evaluates EXP, a G-expression, upon booting. All +the derivations referenced by EXP are automatically copied to the initrd. LINUX-MODULES is a list of '.ko' file names to be copied from LINUX into the -initrd. TO-COPY is a list of additional derivations or packages to copy to -the initrd. MODULES is a list of Guile module names to be embedded in the +initrd. MODULES is a list of Guile module names to be embedded in the initrd." ;; General Linux overview in `Documentation/early-userspace/README' and @@ -71,15 +70,8 @@ initrd." (mlet* %store-monad ((init (gexp->script "init" exp #:modules modules #:guile guile)) - (to-copy -> (cons init to-copy)) (module-dir (flat-linux-module-directory linux linux-modules))) - (define graph-files - (unfold-right zero? - number->string - 1- - (length to-copy))) - (define builder #~(begin (use-modules (gnu build linux-initrd)) @@ -88,7 +80,7 @@ initrd." (build-initrd (string-append #$output "/initrd") #:guile #$guile #:init #$init - #:references-graphs '#$graph-files + #:references-graphs '("closure") #:linux-module-directory #$module-dir #:cpio (string-append #$cpio "/bin/cpio") #:gzip (string-append #$gzip "/bin/gzip")))) @@ -97,7 +89,7 @@ initrd." #:modules '((guix build utils) (guix build store-copy) (gnu build linux-initrd)) - #:references-graphs (zip graph-files to-copy)))) + #:references-graphs `(("closure" ,init))))) (define (flat-linux-module-directory linux modules) "Return a flat directory containing the Linux kernel modules listed in @@ -229,7 +221,6 @@ exception and backtrace!)." #:modules '((guix build utils) (gnu build linux-boot) (gnu build file-systems)) - #:to-copy helper-packages #:linux linux-libre #:linux-modules linux-modules)) From 42d10464bedb43a9211d8bc187e668fe33272368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 8 Sep 2014 23:46:48 +0200 Subject: [PATCH 11/44] linux-initrd: Store Linux modules in a normal store directory. * gnu/system/linux-initrd.scm (expression->initrd): Remove #:linux and #:linux-modules parameters. Remove call to 'float-linux-module-directory'. (base-initrd): Add call to 'float-linux-module-directory'. Use it in #:linux-modules argument in the gexp. Remove #:linux and #:linux-modules arguments to 'expression->initrd'. * gnu/build/linux-initrd.scm (build-initrd): Remove #:linux-module-directory parameter. Don't create 'modules' sub-directory. * gnu/build/linux-boot.scm (boot-system): Mentin that LINUX-MODULES is a list of absolute file names. Don't prepend "/modules/" to LINUX-MODULES. * doc/guix.texi (Initial RAM Disk): Adjust accordingly. --- doc/guix.texi | 8 ++--- gnu/build/linux-boot.scm | 13 ++++---- gnu/build/linux-initrd.scm | 7 +---- gnu/system/linux-initrd.scm | 61 ++++++++++++++++++------------------- 4 files changed, 39 insertions(+), 50 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 1e8a55e9a5..e3b0cf61f0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3616,16 +3616,14 @@ program to run in that initrd. @deffn {Monadic Procedure} expression->initrd @var{exp} @ [#:guile %guile-static-stripped] [#:name "guile-initrd"] @ - [#:modules '()] [#:linux #f] @ - [#:linux-modules '()] + [#:modules '()] Return a derivation that builds a Linux initrd (a gzipped cpio archive) containing @var{guile} and that evaluates @var{exp}, a G-expression, upon booting. All the derivations referenced by @var{exp} are automatically copied to the initrd. -@var{linux-modules} is a list of @file{.ko} file names to be copied from -@var{linux} into the initrd. @var{modules} is a list of Guile module -names to be embedded in the initrd. +@var{modules} is a list of Guile module names to be embedded in the +initrd. @end deffn @node Invoking guix system diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 1312da6bbd..fbc683c798 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -343,10 +343,11 @@ bailing out.~%root contents: ~s~%" (scandir "/")) volatile-root? (mounts '())) "This procedure is meant to be called from an initrd. Boot a system by -first loading LINUX-MODULES, then setting up QEMU guest networking if -QEMU-GUEST-NETWORKING? is true, mounting the file systems specified in MOUNTS, -and finally booting into the new root if any. The initrd supports kernel -command-line options '--load', '--root', and '--repl'. +first loading LINUX-MODULES (a list of absolute file names of '.ko' files), +then setting up QEMU guest networking if QEMU-GUEST-NETWORKING? is true, +mounting the file systems specified in MOUNTS, and finally booting into the +new root if any. The initrd supports kernel command-line options '--load', +'--root', and '--repl'. Mount the root file system, specified by the '--root' command-line argument, if any. @@ -384,9 +385,7 @@ to it are lost." (start-repl)) (display "loading kernel modules...\n") - (for-each (compose load-linux-module* - (cut string-append "/modules/" <>)) - linux-modules) + (for-each load-linux-module* linux-modules) (when qemu-guest-networking? (unless (configure-qemu-networking) diff --git a/gnu/build/linux-initrd.scm b/gnu/build/linux-initrd.scm index 2c0acb200e..54639bd319 100644 --- a/gnu/build/linux-initrd.scm +++ b/gnu/build/linux-initrd.scm @@ -104,23 +104,18 @@ This is similar to what 'compiled-file-name' in (system base compile) does." (define* (build-initrd output #:key guile init - linux-module-directory (references-graphs '()) (cpio "cpio") (gzip "gzip")) "Write an initial RAM disk (initrd) to OUTPUT. The initrd starts the script at INIT, running GUILE. It contains all the items referred to by -REFERENCES-GRAPHS, plus the Linux modules from LINUX-MODULE-DIRECTORY." +REFERENCES-GRAPHS." (mkdir "contents") ;; Copy the closures of all the items referenced in REFERENCES-GRAPHS. (populate-store references-graphs "contents") (with-directory-excursion "contents" - ;; Copy Linux modules. - (mkdir "modules") - (copy-recursively linux-module-directory "modules") - ;; Make '/init'. (symlink init "init") diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index 03ac24d450..e83a9a5b23 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -34,6 +34,7 @@ #:use-module (ice-9 match) #:use-module (ice-9 regex) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:export (expression->initrd base-initrd)) @@ -53,25 +54,19 @@ (gzip gzip) (name "guile-initrd") (system (%current-system)) - (modules '()) - (linux #f) - (linux-modules '())) + (modules '())) "Return a derivation that builds a Linux initrd (a gzipped cpio archive) containing GUILE and that evaluates EXP, a G-expression, upon booting. All the derivations referenced by EXP are automatically copied to the initrd. -LINUX-MODULES is a list of '.ko' file names to be copied from LINUX into the -initrd. MODULES is a list of Guile module names to be embedded in the -initrd." +MODULES is a list of Guile module names to be embedded in the initrd." ;; General Linux overview in `Documentation/early-userspace/README' and ;; `Documentation/filesystems/ramfs-rootfs-initramfs.txt'. - (mlet* %store-monad ((init (gexp->script "init" exp - #:modules modules - #:guile guile)) - (module-dir (flat-linux-module-directory linux - linux-modules))) + (mlet %store-monad ((init (gexp->script "init" exp + #:modules modules + #:guile guile))) (define builder #~(begin (use-modules (gnu build linux-initrd)) @@ -80,8 +75,8 @@ initrd." (build-initrd (string-append #$output "/initrd") #:guile #$guile #:init #$init + ;; Copy everything INIT refers to into the initrd. #:references-graphs '("closure") - #:linux-module-directory #$module-dir #:cpio (string-append #$cpio "/bin/cpio") #:gzip (string-append #$gzip "/bin/gzip")))) @@ -201,27 +196,29 @@ exception and backtrace!)." (list unionfs-fuse/static) '()))) - (expression->initrd - #~(begin - (use-modules (gnu build linux-boot) - (guix build utils) - (srfi srfi-26)) + (mlet %store-monad ((kodir (flat-linux-module-directory linux-libre + linux-modules))) + (expression->initrd + #~(begin + (use-modules (gnu build linux-boot) + (guix build utils) + (srfi srfi-26)) - (with-output-to-port (%make-void-port "w") - (lambda () - (set-path-environment-variable "PATH" '("bin" "sbin") - '#$helper-packages))) + (with-output-to-port (%make-void-port "w") + (lambda () + (set-path-environment-variable "PATH" '("bin" "sbin") + '#$helper-packages))) - (boot-system #:mounts '#$(map file-system->spec file-systems) - #:linux-modules '#$linux-modules - #:qemu-guest-networking? #$qemu-networking? - #:guile-modules-in-chroot? '#$guile-modules-in-chroot? - #:volatile-root? '#$volatile-root?)) - #:name "base-initrd" - #:modules '((guix build utils) - (gnu build linux-boot) - (gnu build file-systems)) - #:linux linux-libre - #:linux-modules linux-modules)) + (boot-system #:mounts '#$(map file-system->spec file-systems) + #:linux-modules (map (lambda (file) + (string-append #$kodir "/" file)) + '#$linux-modules) + #:qemu-guest-networking? #$qemu-networking? + #:guile-modules-in-chroot? '#$guile-modules-in-chroot? + #:volatile-root? '#$volatile-root?)) + #:name "base-initrd" + #:modules '((guix build utils) + (gnu build linux-boot) + (gnu build file-systems))))) ;;; linux-initrd.scm ends here From cf31157fb2ae955f5a996b8831283cb9dcc0cd15 Mon Sep 17 00:00:00 2001 From: Kevin Lemonnier Date: Mon, 8 Sep 2014 21:06:31 +0200 Subject: [PATCH 12/44] gnu: Add zsh. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/zsh.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. Signed-off-by: Ludovic Courtès --- gnu-system.am | 1 + gnu/packages/zsh.scm | 73 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 gnu/packages/zsh.scm diff --git a/gnu-system.am b/gnu-system.am index b3d6123468..86b18b5b8f 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -256,6 +256,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/yasm.scm \ gnu/packages/zile.scm \ gnu/packages/zip.scm \ + gnu/packages/zsh.scm \ \ gnu/services.scm \ gnu/services/avahi.scm \ diff --git a/gnu/packages/zsh.scm b/gnu/packages/zsh.scm new file mode 100644 index 0000000000..778085c3c2 --- /dev/null +++ b/gnu/packages/zsh.scm @@ -0,0 +1,73 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Kevin Lemonnier +;;; +;;; 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 . + +(define-module (gnu packages zsh) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages perl) + #:use-module (gnu packages pcre) + #:use-module (gnu packages autotools) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (guix licenses)) + +(define-public zsh + (package + (name "zsh") + (version "5.0.6") + (source (origin + (method url-fetch) + (uri (string-append "http://www.zsh.org/pub/zsh-" version + ".tar.gz")) + (sha256 + (base32 "0f9y2lkv6xs5nxgj7ld7sbncy454sgamz21fm4109mxqlqa32fph")))) + (build-system gnu-build-system) + (arguments `(#:configure-flags '("--with-tcsetpgrp" "--enable-pcre") + #:phases (alist-cons-before + 'configure 'fix-sh + (lambda _ + (substitute* + '("configure" + "configure.ac" + "Src/exec.c" + "Src/mkmakemod.sh" + "Config/installfns.sh" + "Config/defs.mk.in" + "Test/E01options.ztst" + "Test/A05execution.ztst" + "Test/A01grammar.ztst" + "Test/B02typeset.ztst" + "Completion/Unix/Command/_init_d" + "Util/preconfig") + (("/bin/sh") (which "sh")))) + %standard-phases))) + (native-inputs `(("autoconf", autoconf))) + (inputs `(("ncurses", ncurses) + ("pcre", pcre) + ("perl", perl))) + (synopsis "Powerful shell for interactive use and scripting") + (description "The Z shell (zsh) is a Unix shell that can be used +as an interactive login shell and as a powerful command interpreter +for shell scripting. Zsh can be thought of as an extended Bourne shell +with a large number of improvements, including some features of bash, +ksh, and tcsh.") + (home-page "http://www.zsh.org/") + + ;; The whole thing is under an MIT/X11-style license, but there's one + ;; command, 'Completion/Unix/Command/_darcs', which is under GPLv2+. + (license gpl2+))) From b005157c9b3a927431b9170b71d828a96507e136 Mon Sep 17 00:00:00 2001 From: Marek Benc Date: Tue, 9 Sep 2014 11:39:12 +0200 Subject: [PATCH 13/44] gnu: Add GNU FriBidi. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/fribidi.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. Signed-off-by: Ludovic Courtès --- gnu-system.am | 1 + gnu/packages/fribidi.scm | 45 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 gnu/packages/fribidi.scm diff --git a/gnu-system.am b/gnu-system.am index 86b18b5b8f..8787b76518 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -86,6 +86,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/fontutils.scm \ gnu/packages/freeipmi.scm \ gnu/packages/ftp.scm \ + gnu/packages/fribidi.scm \ gnu/packages/games.scm \ gnu/packages/gawk.scm \ gnu/packages/gcal.scm \ diff --git a/gnu/packages/fribidi.scm b/gnu/packages/fribidi.scm new file mode 100644 index 0000000000..eb13aa1c6d --- /dev/null +++ b/gnu/packages/fribidi.scm @@ -0,0 +1,45 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Marek Benc +;;; +;;; 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 . + +(define-module (gnu packages fribidi) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (guix licenses)) + +(define-public fribidi + (package + (name "fribidi") + (version "0.19.6") + (source + (origin + (method url-fetch) + (uri + (string-append "http://fribidi.org/download/" name "-" version + ".tar.bz2")) + (sha256 + (base32 "0zg1hpaml34ny74fif97j7ngrshlkl3wk3nja3gmlzl17i1bga6b")))) + + (build-system gnu-build-system) + (synopsis "Implementation of the Unicode bidirectional algorithm") + (description + "GNU FriBidi is an implementation of the Unicode Bidirectional +Algorithm. This algorithm is used to properly display text in left-to-right +or right-to-left ordering as necessary.") + (home-page "http://fribidi.org/") + (license lgpl2.1+))) From efa77baf26621277c57b42af1b11078c8a814340 Mon Sep 17 00:00:00 2001 From: Marek Benc Date: Tue, 9 Sep 2014 11:48:44 +0200 Subject: [PATCH 14/44] gnu: Add libwmf. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/image.scm (libwmf): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/image.scm | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 014266cbb0..6a81143bda 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -20,6 +20,9 @@ #:use-module (gnu packages) #:use-module (gnu packages compression) #:use-module (gnu packages file) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages xml) #:use-module ((guix licenses) #:renamer (symbol-prefix-proc 'license:)) #:use-module (guix packages) #:use-module (guix download) @@ -120,3 +123,39 @@ collection of tools for doing simple manipulations of TIFF images.") (license (license:bsd-style "file://COPYRIGHT" "See COPYRIGHT in the distribution.")) (home-page "http://www.libtiff.org/"))) + +(define-public libwmf + (package + (name "libwmf") + (version "0.2.8.4") + (source + (origin + (method url-fetch) + (uri + (string-append + "http://sourceforge.net/projects/wvware/files/" name "/" version + "/" name "-" version ".tar.gz/download")) + (file-name + (string-append name "-" version ".tar.gz")) + (sha256 + (base32 "1y3wba4q8pl7kr51212jwrsz1x6nslsx1gsjml1x0i8549lmqd2v")))) + + (build-system gnu-build-system) + (inputs + `(("freetype" ,freetype) + ("libjpeg" ,libjpeg) + ("libpng",libpng) + ("libxml2" ,libxml2) + ("zlib" ,zlib))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (synopsis "Library for reading images in the Microsoft WMF format") + (description + "libwmf is a library for reading vector images in Microsoft's native +Windows Metafile Format (WMF) and for either (a) displaying them in, e.g., an X +window; or (b) converting them to more standard/free file formats such as, e.g., +the W3C's XML-based Scaleable Vector Graphic (SVG) format.") + (home-page "http://wvware.sourceforge.net/libwmf.html") + + ;; 'COPYING' is the GPLv2, but file headers say LGPLv2.0+. + (license license:lgpl2.0+))) From 9ffbe2b7d5097aa376c1ea6fc461af47e71a64d1 Mon Sep 17 00:00:00 2001 From: Marek Benc Date: Tue, 9 Sep 2014 11:54:18 +0200 Subject: [PATCH 15/44] gnu: Add wv. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/wv.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. Signed-off-by: Ludovic Courtès --- gnu-system.am | 1 + gnu/packages/wv.scm | 68 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 gnu/packages/wv.scm diff --git a/gnu-system.am b/gnu-system.am index 8787b76518..4e07c5ab37 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -249,6 +249,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/wget.scm \ gnu/packages/which.scm \ gnu/packages/wordnet.scm \ + gnu/packages/wv.scm \ gnu/packages/xiph.scm \ gnu/packages/xlockmore.scm \ gnu/packages/xml.scm \ diff --git a/gnu/packages/wv.scm b/gnu/packages/wv.scm new file mode 100644 index 0000000000..31afd8608d --- /dev/null +++ b/gnu/packages/wv.scm @@ -0,0 +1,68 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Marek Benc +;;; +;;; 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 . + +(define-module (gnu packages wv) + #:use-module (gnu packages) + #:use-module (gnu packages compression) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages image) + #:use-module (gnu packages pkg-config) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) #:renamer (symbol-prefix-proc 'license:))) + +(define-public wv + (package + (name "wv") + (version "1.2.4") + (source + (origin + (method url-fetch) + (uri + (string-append + "http://sourceforge.net/projects/" name "/files/wv/" version + "/wv-" version ".tar.gz/download")) + (file-name (string-append "wv-" version ".tar.gz")) + (sha256 + (base32 "1mn2ax6qjy3pvixlnvbkn6ymy6y4l2wxrr4brjaczm121s8hjcb7")))) + + (build-system gnu-build-system) + (arguments + `(#:configure-flags '("--with-libwmf"))) + (inputs + `(("glib" ,glib) + ("libgsf" ,libgsf) + ("libjpeg" ,libjpeg) + ("libpng" ,libpng) + ("libwmf" ,libwmf) + ("zlib" ,zlib))) + (native-inputs + `(("glib" ,glib "bin") + ("pkg-config" ,pkg-config))) + (synopsis "Microsoft Word conversion library and utilities") + (description + "wv converts Word 2,6,7,8,9 files to HTML and LaTeX. The Word 2 +conversion is still incomplete (no formatting), but it will do a passable job +extracting the text, which is what you probably want anyway. + +libwv can be used as a library by third party programs, AbiWord uses it as its +word importer, and KWord may use it in the future.") + (home-page "http://wvware.sourceforge.net/") + (license license:gpl2+))) From 1deac3440cc06060494bc821b2325cdf326b5696 Mon Sep 17 00:00:00 2001 From: Marek Benc Date: Tue, 9 Sep 2014 13:34:22 +0200 Subject: [PATCH 16/44] gnu: Add Enchant. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/enchant.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. Signed-off-by: Ludovic Courtès --- gnu-system.am | 1 + gnu/packages/enchant.scm | 61 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 gnu/packages/enchant.scm diff --git a/gnu-system.am b/gnu-system.am index 4e07c5ab37..4adc90cd3b 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -78,6 +78,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/ed.scm \ gnu/packages/elf.scm \ gnu/packages/emacs.scm \ + gnu/packages/enchant.scm \ gnu/packages/file.scm \ gnu/packages/fish.scm \ gnu/packages/flex.scm \ diff --git a/gnu/packages/enchant.scm b/gnu/packages/enchant.scm new file mode 100644 index 0000000000..c9e49d9551 --- /dev/null +++ b/gnu/packages/enchant.scm @@ -0,0 +1,61 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Marek Benc +;;; +;;; 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 . + +(define-module (gnu packages enchant) + #:use-module (gnu packages) + #:use-module (gnu packages aspell) + #:use-module (gnu packages glib) + #:use-module (gnu packages pkg-config) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (guix licenses)) + +(define-public enchant + (package + (name "enchant") + (version "1.6.0") + (source + (origin + (method url-fetch) + (uri + (string-append "http://www.abisource.com/downloads/" name "/" version + "/" name "-" version ".tar.gz")) + (sha256 + (base32 "0zq9yw1xzk8k9s6x83n1f9srzcwdavzazn3haln4nhp9wxxrxb1g")))) + + (build-system gnu-build-system) + (inputs + `(("aspell" ,aspell) ;; Currently, the only supported backend in Guix + ("glib" ,glib))) ;; is aspell. (This information might be old) + (native-inputs + `(("glib:bin" ,glib "bin") + ("pkg-config" ,pkg-config))) + + (synopsis "Multi-backend spell-checking library wrapper") + (description + "On the surface, Enchant appears to be a generic spell checking library. +Looking closer, you'll see the Enchant is more-or-less a fancy wrapper around +the dlopen() system call. + +Enchant steps in to provide uniformity and conformity on top of these libraries, +and implement certain features that may be lacking in any individual provider +library. Everything should \"just work\" for any and every definition of \"just +working.\"") + (home-page "http://www.abisource.com/projects/enchant") + (license lgpl2.1+))) From 52910ded6c36580d0d1f2be5a686f7cb1f9623b9 Mon Sep 17 00:00:00 2001 From: Marek Benc Date: Tue, 9 Sep 2014 13:39:55 +0200 Subject: [PATCH 17/44] gnu: Add ots. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/ots-no-include-missing-file.patch: New file. * gnu/packages/ots.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add ots.scm. (dist_patch_DATA): Add ots-no-include-missing-file.patch. Signed-off-by: Ludovic Courtès --- gnu-system.am | 2 + gnu/packages/ots.scm | 68 +++++++++++++++++++ .../patches/ots-no-include-missing-file.patch | 14 ++++ 3 files changed, 84 insertions(+) create mode 100644 gnu/packages/ots.scm create mode 100644 gnu/packages/patches/ots-no-include-missing-file.patch diff --git a/gnu-system.am b/gnu-system.am index 4adc90cd3b..d610aeae11 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -188,6 +188,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/openldap.scm \ gnu/packages/openssl.scm \ gnu/packages/orpheus.scm \ + gnu/packages/ots.scm \ gnu/packages/package-management.scm \ gnu/packages/parallel.scm \ gnu/packages/patchutils.scm \ @@ -363,6 +364,7 @@ dist_patch_DATA = \ gnu/packages/patches/module-init-tools-moduledir.patch \ gnu/packages/patches/nvi-assume-preserve-path.patch \ gnu/packages/patches/orpheus-cast-errors-and-includes.patch \ + gnu/packages/patches/ots-no-include-missing-file.patch \ gnu/packages/patches/patchelf-page-size.patch \ gnu/packages/patches/patchutils-xfail-gendiff-tests.patch \ gnu/packages/patches/perl-no-sys-dirs.patch \ diff --git a/gnu/packages/ots.scm b/gnu/packages/ots.scm new file mode 100644 index 0000000000..cd2bf8585b --- /dev/null +++ b/gnu/packages/ots.scm @@ -0,0 +1,68 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Marek Benc +;;; +;;; 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 . + +(define-module (gnu packages ots) + #:use-module (gnu packages) + #:use-module (gnu packages compression) + #:use-module (gnu packages glib) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages popt) + #:use-module (gnu packages xml) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) + #:renamer (symbol-prefix-proc 'license:))) + +(define-public ots + (package + (name "ots") + (version "0.5.0") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/libots/libots/" + name "-" version "/" name "-" version + ".tar.gz")) + (sha256 + (base32 "0dz1ccd7ymzk4swz1aly4im0k3pascnshmgg1whd2rk14li8v47a")) + (patches + (list (search-patch "ots-no-include-missing-file.patch"))))) + + (build-system gnu-build-system) + (inputs + `(("glib" ,glib) + ("popt" ,popt) + ("libxml2" ,libxml2) + ("zlib" ,zlib))) + (native-inputs + `(("glib:bin" ,glib "bin") + ("pkg-config" ,pkg-config))) + (synopsis "Tool for summarizing texts") + (description + "The Open Text Summarizer is a library and command-line tool for +summarizing texts. The program reads a text and decides which sentences are +important and which are not. OTS will create a short summary or will +highlight the main ideas in the text. + +The program can either print the summarized text as plain text or HTML. If in +HTML, the important sentences are highlighted. + +The program is multi lingual and works with UTF-8 encoding.") + (home-page "http://libots.sourceforge.net/") + (license license:gpl2+))) diff --git a/gnu/packages/patches/ots-no-include-missing-file.patch b/gnu/packages/patches/ots-no-include-missing-file.patch new file mode 100644 index 0000000000..c23c7c36a1 --- /dev/null +++ b/gnu/packages/patches/ots-no-include-missing-file.patch @@ -0,0 +1,14 @@ +The file $(top_srcdir)/gtk-doc.make doesn't exist, so don't include it. + +--- a/doc/Makefile.in 2007-04-08 20:17:25.000000000 +0200 ++++ b/doc/Makefile.in 2014-09-06 23:19:41.413397662 +0200 +@@ -240,9 +240,6 @@ + distclean-generic clean-generic maintainer-clean-generic clean \ + mostlyclean distclean maintainer-clean + +- +-include $(top_srcdir)/gtk-doc.make +- + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: From 698d228001a27017ced5a69abdfe3b977b116705 Mon Sep 17 00:00:00 2001 From: Marek Benc Date: Tue, 9 Sep 2014 13:54:38 +0200 Subject: [PATCH 18/44] gnu: Add AbiWord. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/abiword-explictly-cast-bools.patch New file. * gnu/packages/patches/abiword-link-plugins-against-backend.patch: New file. * gnu/packages/patches/abiword-no-include-glib-internal-headers.patch: New file. * gnu/packages/patches/abiword-pass-no-undefined-to-linker.patch * gnu/packages/patches/abiword-use-proper-png-api.patch: New file. * gnu/packages/patches/abiword-wmf-version-lookup-fix.patch: New file. * gnu/packages/abiword.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add abiword.scm. (dist_patch_DATA): Add the 6 patches for abiword. Signed-off-by: Ludovic Courtès --- gnu-system.am | 7 + gnu/packages/abiword.scm | 107 +++ .../abiword-explictly-cast-bools.patch | 93 +++ ...abiword-link-plugins-against-backend.patch | 639 ++++++++++++++++++ ...ord-no-include-glib-internal-headers.patch | 13 + .../abiword-pass-no-undefined-to-linker.patch | 608 +++++++++++++++++ .../patches/abiword-use-proper-png-api.patch | 175 +++++ .../abiword-wmf-version-lookup-fix.patch | 28 + 8 files changed, 1670 insertions(+) create mode 100644 gnu/packages/abiword.scm create mode 100644 gnu/packages/patches/abiword-explictly-cast-bools.patch create mode 100644 gnu/packages/patches/abiword-link-plugins-against-backend.patch create mode 100644 gnu/packages/patches/abiword-no-include-glib-internal-headers.patch create mode 100644 gnu/packages/patches/abiword-pass-no-undefined-to-linker.patch create mode 100644 gnu/packages/patches/abiword-use-proper-png-api.patch create mode 100644 gnu/packages/patches/abiword-wmf-version-lookup-fix.patch diff --git a/gnu-system.am b/gnu-system.am index d610aeae11..f09b4d64b9 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -24,6 +24,7 @@ GNU_SYSTEM_MODULES = \ gnu.scm \ gnu/packages.scm \ + gnu/packages/abiword.scm \ gnu/packages/acct.scm \ gnu/packages/acl.scm \ gnu/packages/admin.scm \ @@ -290,6 +291,12 @@ GNU_SYSTEM_MODULES = \ patchdir = $(guilemoduledir)/gnu/packages/patches dist_patch_DATA = \ + gnu/packages/patches/abiword-explictly-cast-bools.patch \ + gnu/packages/patches/abiword-link-plugins-against-backend.patch \ + gnu/packages/patches/abiword-no-include-glib-internal-headers.patch \ + gnu/packages/patches/abiword-pass-no-undefined-to-linker.patch \ + gnu/packages/patches/abiword-use-proper-png-api.patch \ + gnu/packages/patches/abiword-wmf-version-lookup-fix.patch \ gnu/packages/patches/alsa-lib-mips-atomic-fix.patch \ gnu/packages/patches/apr-skip-getservbyname-test.patch \ gnu/packages/patches/automake-skip-amhello-tests.patch \ diff --git a/gnu/packages/abiword.scm b/gnu/packages/abiword.scm new file mode 100644 index 0000000000..7d9b82b78d --- /dev/null +++ b/gnu/packages/abiword.scm @@ -0,0 +1,107 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Marek Benc +;;; +;;; 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 . + +(define-module (gnu packages abiword) + #:use-module ((guix licenses) + #:renamer (symbol-prefix-proc 'license:)) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages boost) + #:use-module (gnu packages compression) + #:use-module (gnu packages enchant) + #:use-module (gnu packages fribidi) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gtk) + #:use-module (gnu packages image) + #:use-module (gnu packages ots) + #:use-module (gnu packages popt) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages readline) + #:use-module (gnu packages wvware) + #:use-module (gnu packages xml)) + +(define-public abiword + (package + (name "abiword") + (version "2.8.6") + (source + (origin + (method url-fetch) + (uri + (string-append "http://abisource.org/downloads/" name "/" version + "/source/" name "-" version ".tar.gz")) + (sha256 + (base32 "059sd2apxdmcacc4pll880i7vm18h0kyjsq299m1mz3c7ak8k46r")) + (patches + (list + (search-patch "abiword-wmf-version-lookup-fix.patch") + (search-patch "abiword-no-include-glib-internal-headers.patch") + (search-patch "abiword-explictly-cast-bools.patch") + (search-patch "abiword-use-proper-png-api.patch") + (search-patch "abiword-pass-no-undefined-to-linker.patch") + (search-patch "abiword-link-plugins-against-backend.patch"))))) + + (build-system gnu-build-system) + (arguments ;; NOTE: rsvg is disabled, since Abiword + `(#:configure-flags ;; supports it directly, and its BS is broken. + (list + "--enable-clipart" ;; TODO: The following plugins have unresolved + "--enable-templates" ;; dependencies: aiksaurus, grammar, wpg, gda, + (string-append ;; wordperfect, psion, mathview, goffice. + "--enable-plugins=" + "applix " "babelfish " "bmp " "clarisworks " "collab " "command " + "docbook " "eml " "freetranslation " "garble " "gdict " "gimp " + "google " "hancom " "hrtext " "iscii " "kword " "latex " + "loadbindings " "mht " "mif " "mswrite " "opendocument " + "openwriter " "openxml " "opml " "ots " "paint " "passepartout " + "pdb " "pdf " "presentation " "s5 " "sdw " "t602 " "urldict " + "wikipedia " "wmf " "wml " "xslfo")))) + (inputs + `(("boost" ,boost) + ("enchant" ,enchant) + ("fontconfig" ,fontconfig) + ("fribidi" ,fribidi) + ("glib" ,glib) + ("gtk+" ,gtk+-2) + ("libglade" ,libglade) + ("libgsf" ,libgsf) + ("libjpeg" ,libjpeg) + ("libpng" ,libpng) + ("librsvg" ,librsvg) + ("libwmf" ,libwmf) + ("libxml2" ,libxml2) + ("ots" ,ots) + ("popt" ,popt) + ("readline" ,readline) + ("wvware" ,wvware) + ("zlib" ,zlib))) + (native-inputs + `(("intltool" ,intltool) + ("glib:bin" ,glib "bin") + ("pkg-config" ,pkg-config))) + (home-page "http://abisource.org/") + (synopsis "Word processing program") + (description + "AbiWord is a word processing program. It is rapidly becoming a state +of the art word processor, with lots of features useful for your daily work, +personal needs, or for just some good old typing fun.") + (license license:gpl2+))) diff --git a/gnu/packages/patches/abiword-explictly-cast-bools.patch b/gnu/packages/patches/abiword-explictly-cast-bools.patch new file mode 100644 index 0000000000..7927a180ba --- /dev/null +++ b/gnu/packages/patches/abiword-explictly-cast-bools.patch @@ -0,0 +1,93 @@ +As of JPEG-9, the type 'boolean' is an enumeration, but since glib defines +TRUE and FALSE as numeric constants and this is C++, they need to be explicitly +casted. + +--- a/src/af/util/xp/ut_jpeg.cpp 2009-07-08 19:33:53.000000000 +0200 ++++ b/src/af/util/xp/ut_jpeg.cpp 2014-09-06 19:55:55.876997404 +0200 +@@ -102,7 +102,7 @@ + src->pub.next_input_byte = src->sourceBuf->getPointer (src->pos); + src->pub.bytes_in_buffer = src->sourceBuf->getLength (); + +- return TRUE; ++ return (boolean)TRUE; + } + + /* +@@ -161,7 +161,7 @@ + /* set the data source */ + _JPEG_ByteBufSrc (&cinfo, pBB); + +- jpeg_read_header(&cinfo, TRUE); ++ jpeg_read_header(&cinfo, (boolean)TRUE); + jpeg_start_decompress(&cinfo); + iImageWidth = cinfo.output_width; + iImageHeight = cinfo.output_height; +@@ -189,7 +189,7 @@ + /* set the data source */ + _JPEG_ByteBufSrc (&cinfo, pBB); + +- jpeg_read_header(&cinfo, TRUE); ++ jpeg_read_header(&cinfo, (boolean)TRUE); + jpeg_start_decompress(&cinfo); + + int row_stride = cinfo.output_width * cinfo.output_components; + + +In the following file, we also need to reverse header include order: JPEG needs +to be included before Glib, which is included by "abiword-garble.h" for this fix +to work. + +The JPEG header needs the types FILE and size_t, we can get them from cstdio. + +--- a/plugins/garble/xp/abiword-garble-jpeg.cpp 2009-09-05 17:49:53.000000000 +0200 ++++ b/plugins/garble/xp/abiword-garble-jpeg.cpp 2014-09-07 21:28:49.364008571 +0200 +@@ -20,12 +20,14 @@ + * 02111-1307, USA. + */ + +-#include "abiword-garble.h" ++#include + + extern "C" { + #include + } + ++#include "abiword-garble.h" ++ + //----------------------------------------------------------------------------- + typedef struct { + struct jpeg_destination_mgr pub; +@@ -49,7 +51,7 @@ + mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest; + dest->pub.next_output_byte = dest->buf; + dest->pub.free_in_buffer = dest->bufsize; +- return FALSE; ++ return (boolean)FALSE; + } + + //----------------------------------------------------------------------------- +@@ -96,7 +98,7 @@ + cinfo.image_width = (JDIMENSION) w; + cinfo.image_height = (JDIMENSION) h; + jpeg_set_defaults (&cinfo); +- jpeg_set_quality ( &cinfo, 50, TRUE ); ++ jpeg_set_quality ( &cinfo, 50, (boolean)TRUE ); + cinfo.dest = (struct jpeg_destination_mgr *) (*cinfo.mem->alloc_small)((j_common_ptr)&cinfo, JPOOL_PERMANENT, sizeof(mem_destination_mgr)); + dest = (mem_dest_ptr) cinfo.dest; + dest->pub.init_destination = _jpeg_init_destination; +@@ -105,7 +107,7 @@ + dest->buf = (JOCTET*)data; + dest->bufsize = length; + dest->jpegsize = 0; +- jpeg_start_compress (&cinfo, TRUE); ++ jpeg_start_compress (&cinfo, (boolean)TRUE); + + // write data + for (int i=0; i ++#include + + G_BEGIN_DECLS + diff --git a/gnu/packages/patches/abiword-pass-no-undefined-to-linker.patch b/gnu/packages/patches/abiword-pass-no-undefined-to-linker.patch new file mode 100644 index 0000000000..a17d465edb --- /dev/null +++ b/gnu/packages/patches/abiword-pass-no-undefined-to-linker.patch @@ -0,0 +1,608 @@ +gcc/g++ chokes on --no-undefined, so instead pass it directly to the linker. + +--- a/plugins/loadbindings/Makefile.in 2010-06-13 23:17:48.000000000 +0200 ++++ b/plugins/loadbindings/Makefile.in 2014-09-06 11:03:21.151951221 +0200 +@@ -433,7 +433,7 @@ + $(LOADBINDINGS_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + loadbindings_la_SOURCES = + nodist_EXTRA_loadbindings_la_SOURCES = dummy.cpp + +--- a/plugins/pdf/Makefile.in 2010-06-13 23:17:53.000000000 +0200 ++++ b/plugins/pdf/Makefile.in 2014-09-06 11:03:21.207951223 +0200 +@@ -431,7 +431,7 @@ + $(PDF_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + pdf_la_SOURCES = + nodist_EXTRA_pdf_la_SOURCES = dummy.cpp + +--- a/plugins/xslfo/Makefile.in 2010-06-13 23:17:55.000000000 +0200 ++++ b/plugins/xslfo/Makefile.in 2014-09-06 11:03:21.227951224 +0200 +@@ -431,7 +431,7 @@ + $(XSLFO_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + xslfo_la_SOURCES = + nodist_EXTRA_xslfo_la_SOURCES = dummy.cpp + +--- a/plugins/gda/Makefile.in 2010-06-13 23:17:45.000000000 +0200 ++++ b/plugins/gda/Makefile.in 2014-09-06 11:03:21.251951225 +0200 +@@ -425,7 +425,7 @@ + $(GDA_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + gda_la_SOURCES = + EXTRA_DIST = \ + +--- a/plugins/wikipedia/Makefile.in 2010-06-13 23:17:54.000000000 +0200 ++++ b/plugins/wikipedia/Makefile.in 2014-09-06 11:03:21.271951225 +0200 +@@ -431,7 +431,7 @@ + $(WIKIPEDIA_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + wikipedia_la_SOURCES = + nodist_EXTRA_wikipedia_la_SOURCES = dummy.cpp + +--- a/plugins/collab/Makefile.in 2010-06-13 23:17:41.000000000 +0200 ++++ b/plugins/collab/Makefile.in 2014-09-06 11:03:21.291951226 +0200 +@@ -435,7 +435,7 @@ + @TOOLKIT_COCOA_FALSE@ $(SYSTEM_LIBS) \ + @TOOLKIT_COCOA_FALSE@ -avoid-version \ + @TOOLKIT_COCOA_FALSE@ -module \ +-@TOOLKIT_COCOA_FALSE@ -no-undefined ++@TOOLKIT_COCOA_FALSE@ -Wl,--no-undefined + + @TOOLKIT_COCOA_FALSE@collab_la_SOURCES = + @TOOLKIT_COCOA_FALSE@nodist_EXTRA_collab_la_SOURCES = dummy.cpp + +--- a/plugins/paint/Makefile.in 2010-06-13 23:17:52.000000000 +0200 ++++ b/plugins/paint/Makefile.in 2014-09-06 11:03:21.315951227 +0200 +@@ -432,7 +432,7 @@ + $(PAINT_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + paint_la_SOURCES = + nodist_EXTRA_paint_la_SOURCES = dummy.cpp + +--- a/plugins/garble/Makefile.in 2010-06-13 23:17:45.000000000 +0200 ++++ b/plugins/garble/Makefile.in 2014-09-06 11:03:21.335951227 +0200 +@@ -433,7 +433,7 @@ + @TOOLKIT_COCOA_FALSE@ $(GARBLE_LIBS) \ + @TOOLKIT_COCOA_FALSE@ -avoid-version \ + @TOOLKIT_COCOA_FALSE@ -module \ +-@TOOLKIT_COCOA_FALSE@ -no-undefined ++@TOOLKIT_COCOA_FALSE@ -Wl,--no-undefined + + @TOOLKIT_COCOA_FALSE@garble_la_SOURCES = + @TOOLKIT_COCOA_FALSE@nodist_EXTRA_garble_la_SOURCES = dummy.cpp + +--- a/plugins/latex/Makefile.in 2010-06-13 23:17:48.000000000 +0200 ++++ b/plugins/latex/Makefile.in 2014-09-06 11:03:21.359951228 +0200 +@@ -432,7 +432,7 @@ + $(LATEX_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + latex_la_SOURCES = + nodist_EXTRA_latex_la_SOURCES = dummy.cpp + +--- a/plugins/mht/Makefile.in 2010-06-13 23:17:49.000000000 +0200 ++++ b/plugins/mht/Makefile.in 2014-09-06 11:03:21.379951229 +0200 +@@ -428,7 +428,7 @@ + $(MHT_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + mht_la_SOURCES = + nodist_EXTRA_mht_la_SOURCES = dummy.cpp + +--- a/plugins/google/Makefile.in 2010-06-13 23:17:46.000000000 +0200 ++++ b/plugins/google/Makefile.in 2014-09-06 11:03:21.399951230 +0200 +@@ -431,7 +431,7 @@ + $(GOOGLE_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + google_la_SOURCES = + nodist_EXTRA_google_la_SOURCES = dummy.cpp + +--- a/plugins/babelfish/Makefile.in 2010-06-13 23:17:40.000000000 +0200 ++++ b/plugins/babelfish/Makefile.in 2014-09-06 11:03:21.419951230 +0200 +@@ -431,7 +431,7 @@ + $(BABELFISH_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + babelfish_la_SOURCES = + nodist_EXTRA_babelfish_la_SOURCES = dummy.cpp + +--- a/plugins/opendocument/Makefile.in 2010-06-13 23:17:50.000000000 +0200 ++++ b/plugins/opendocument/Makefile.in 2014-09-06 11:03:21.443951231 +0200 +@@ -436,7 +436,7 @@ + $(OPENDOCUMENT_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + opendocument_la_SOURCES = + +--- a/plugins/opml/Makefile.in 2010-06-13 23:17:51.000000000 +0200 ++++ b/plugins/opml/Makefile.in 2014-09-06 11:03:21.463951232 +0200 +@@ -431,7 +431,7 @@ + $(OPML_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + opml_la_SOURCES = + nodist_EXTRA_opml_la_SOURCES = dummy.cpp + +--- a/plugins/gimp/Makefile.in 2010-06-13 23:17:46.000000000 +0200 ++++ b/plugins/gimp/Makefile.in 2014-09-06 11:03:21.483951232 +0200 +@@ -431,7 +431,7 @@ + $(GIMP_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + gimp_la_SOURCES = + nodist_EXTRA_gimp_la_SOURCES = dummy.cpp + +--- a/plugins/mswrite/Makefile.in 2010-06-13 23:17:49.000000000 +0200 ++++ b/plugins/mswrite/Makefile.in 2014-09-06 11:03:21.507951233 +0200 +@@ -431,7 +431,7 @@ + $(MSWRITE_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + mswrite_la_SOURCES = + nodist_EXTRA_mswrite_la_SOURCES = dummy.cpp + +--- a/plugins/wordperfect/Makefile.in 2010-06-13 23:17:55.000000000 +0200 ++++ b/plugins/wordperfect/Makefile.in 2014-09-06 11:03:21.527951234 +0200 +@@ -429,7 +429,7 @@ + $(WORDPERFECT_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + wordperfect_la_SOURCES = + nodist_EXTRA_wordperfect_la_SOURCES = dummy.cpp + +--- a/plugins/pdb/Makefile.in 2010-06-13 23:17:53.000000000 +0200 ++++ b/plugins/pdb/Makefile.in 2014-09-06 11:03:21.547951234 +0200 +@@ -431,7 +431,7 @@ + $(PDB_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + pdb_la_SOURCES = + nodist_EXTRA_pdb_la_SOURCES = dummy.cpp + +--- a/plugins/ots/Makefile.in 2010-06-13 23:17:52.000000000 +0200 ++++ b/plugins/ots/Makefile.in 2014-09-06 11:03:21.571951235 +0200 +@@ -425,7 +425,7 @@ + $(OTS_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + ots_la_SOURCES = + EXTRA_DIST = \ + +--- a/plugins/wml/Makefile.in 2010-06-13 23:17:55.000000000 +0200 ++++ b/plugins/wml/Makefile.in 2014-09-06 11:03:21.591951236 +0200 +@@ -431,7 +431,7 @@ + $(WML_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + wml_la_SOURCES = + nodist_EXTRA_wml_la_SOURCES = dummy.cpp + +--- a/plugins/bmp/Makefile.in 2010-06-13 23:17:40.000000000 +0200 ++++ b/plugins/bmp/Makefile.in 2014-09-06 11:03:21.615951237 +0200 +@@ -431,7 +431,7 @@ + $(BMP_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + bmp_la_SOURCES = + nodist_EXTRA_bmp_la_SOURCES = dummy.cpp + +--- a/plugins/applix/Makefile.in 2010-06-13 23:17:40.000000000 +0200 ++++ b/plugins/applix/Makefile.in 2014-09-06 11:03:21.635951237 +0200 +@@ -431,7 +431,7 @@ + $(APPLIX_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + applix_la_SOURCES = + +--- a/plugins/iscii/Makefile.in 2010-06-13 23:17:47.000000000 +0200 ++++ b/plugins/iscii/Makefile.in 2014-09-06 11:03:21.659951238 +0200 +@@ -431,7 +431,7 @@ + $(ISCII_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + iscii_la_SOURCES = + nodist_EXTRA_iscii_la_SOURCES = dummy.cpp + +--- a/plugins/gdict/Makefile.in 2010-06-13 23:17:46.000000000 +0200 ++++ b/plugins/gdict/Makefile.in 2014-09-06 11:03:21.679951239 +0200 +@@ -429,7 +429,7 @@ + @TOOLKIT_GTK_TRUE@ $(GDICT_LIBS) \ + @TOOLKIT_GTK_TRUE@ -avoid-version \ + @TOOLKIT_GTK_TRUE@ -module \ +-@TOOLKIT_GTK_TRUE@ -no-undefined ++@TOOLKIT_GTK_TRUE@ -Wl,--no-undefined + + @TOOLKIT_GTK_TRUE@gdict_la_SOURCES = + @TOOLKIT_GTK_TRUE@EXTRA_DIST = \ + +--- a/plugins/openwriter/Makefile.in 2010-06-13 23:17:50.000000000 +0200 ++++ b/plugins/openwriter/Makefile.in 2014-09-06 11:03:21.699951239 +0200 +@@ -432,7 +432,7 @@ + $(OPENWRITER_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + openwriter_la_SOURCES = + nodist_EXTRA_openwriter_la_SOURCES = dummy.cpp + +--- a/plugins/sdw/Makefile.in 2010-06-13 23:17:54.000000000 +0200 ++++ b/plugins/sdw/Makefile.in 2014-09-06 11:03:21.723951240 +0200 +@@ -431,7 +431,7 @@ + $(SDW_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + sdw_la_SOURCES = + nodist_EXTRA_sdw_la_SOURCES = dummy.cpp + +--- a/plugins/grammar/Makefile.in 2010-06-13 23:17:47.000000000 +0200 ++++ b/plugins/grammar/Makefile.in 2014-09-06 11:03:21.747951241 +0200 +@@ -430,7 +430,7 @@ + $(GRAMMAR_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + nodist_EXTRA_grammar_la_SOURCES = dummy.cpp + grammar_la_SOURCES = + +--- a/plugins/urldict/Makefile.in 2010-06-13 23:17:54.000000000 +0200 ++++ b/plugins/urldict/Makefile.in 2014-09-06 11:03:21.779951242 +0200 +@@ -431,7 +431,7 @@ + $(URLDICT_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + urldict_la_SOURCES = + nodist_EXTRA_urldict_la_SOURCES = dummy.cpp + +--- a/plugins/wmf/Makefile.in 2010-06-13 23:17:55.000000000 +0200 ++++ b/plugins/wmf/Makefile.in 2014-09-06 11:03:21.799951243 +0200 +@@ -428,7 +428,7 @@ + $(WMF_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + wmf_la_SOURCES = + nodist_EXTRA_wmf_la_SOURCES = dummy.cpp + +--- a/plugins/mif/Makefile.in 2010-06-13 23:17:49.000000000 +0200 ++++ b/plugins/mif/Makefile.in 2014-09-06 11:03:21.819951243 +0200 +@@ -431,7 +431,7 @@ + $(MIF_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + mif_la_SOURCES = + nodist_EXTRA_mif_la_SOURCES = dummy.cpp + +--- a/plugins/eml/Makefile.in 2010-06-13 23:17:45.000000000 +0200 ++++ b/plugins/eml/Makefile.in 2014-09-06 11:03:21.843951244 +0200 +@@ -431,7 +431,7 @@ + $(EML_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + eml_la_SOURCES = + nodist_EXTRA_eml_la_SOURCES = dummy.cpp + +--- a/plugins/openxml/Makefile.in 2010-06-13 23:17:51.000000000 +0200 ++++ b/plugins/openxml/Makefile.in 2014-09-06 11:03:21.863951245 +0200 +@@ -434,7 +434,7 @@ + $(OPENXML_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + openxml_la_SOURCES = + nodist_EXTRA_openxml_la_SOURCES = dummy.cpp + +--- a/plugins/goffice/Makefile.in 2010-06-13 23:17:46.000000000 +0200 ++++ b/plugins/goffice/Makefile.in 2014-09-06 11:03:21.883951245 +0200 +@@ -425,7 +425,7 @@ + $(GOFFICE_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + goffice_la_SOURCES = + EXTRA_DIST = \ + +--- a/plugins/passepartout/Makefile.in 2010-06-13 23:17:52.000000000 +0200 ++++ b/plugins/passepartout/Makefile.in 2014-09-06 11:03:21.907951246 +0200 +@@ -433,7 +433,7 @@ + $(PASSEPARTOUT_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + passepartout_la_SOURCES = + nodist_EXTRA_passepartout_la_SOURCES = dummy.cpp + +--- a/plugins/clarisworks/Makefile.in 2010-06-13 23:17:41.000000000 +0200 ++++ b/plugins/clarisworks/Makefile.in 2014-09-06 11:03:21.927951247 +0200 +@@ -433,7 +433,7 @@ + $(CLARISWORKS_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + clarisworks_la_SOURCES = + nodist_EXTRA_clarisworks_la_SOURCES = dummy.cpp + +--- a/plugins/command/Makefile.in 2010-06-13 23:17:44.000000000 +0200 ++++ b/plugins/command/Makefile.in 2014-09-06 11:03:21.947951247 +0200 +@@ -426,7 +426,7 @@ + @TOOLKIT_COCOA_FALSE@ $(COMMAND_LIBS) \ + @TOOLKIT_COCOA_FALSE@ -avoid-version \ + @TOOLKIT_COCOA_FALSE@ -module \ +-@TOOLKIT_COCOA_FALSE@ -no-undefined ++@TOOLKIT_COCOA_FALSE@ -Wl,--no-undefined + + @TOOLKIT_COCOA_FALSE@command_la_SOURCES = + all: all-recursive + +--- a/plugins/presentation/Makefile.in 2010-06-13 23:17:53.000000000 +0200 ++++ b/plugins/presentation/Makefile.in 2014-09-06 11:03:21.971951248 +0200 +@@ -433,7 +433,7 @@ + $(PRESENTATION_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + presentation_la_SOURCES = + nodist_EXTRA_presentation_la_SOURCES = dummy.cpp + +--- a/plugins/psion/Makefile.in 2010-06-13 23:17:53.000000000 +0200 ++++ b/plugins/psion/Makefile.in 2014-09-06 11:03:21.991951249 +0200 +@@ -427,7 +427,7 @@ + $(PSION_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + psion_la_SOURCES = + EXTRA_DIST = \ + +--- a/plugins/rsvg/Makefile.in 2010-06-13 23:17:53.000000000 +0200 ++++ b/plugins/rsvg/Makefile.in 2014-09-06 11:03:22.011951250 +0200 +@@ -430,7 +430,7 @@ + rsvg_la_LDFLAGS = \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + rsvg_la_SOURCES = + nodist_EXTRA_rsvg_la_SOURCES = dummy.cpp + +--- a/plugins/wpg/Makefile.in 2010-06-13 23:17:55.000000000 +0200 ++++ b/plugins/wpg/Makefile.in 2014-09-06 11:03:22.035951250 +0200 +@@ -428,7 +428,7 @@ + $(WPG_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + wpg_la_SOURCES = + nodist_EXTRA_wpg_la_SOURCES = dummy.cpp + +--- a/plugins/t602/Makefile.in 2010-06-13 23:17:54.000000000 +0200 ++++ b/plugins/t602/Makefile.in 2014-09-06 11:03:22.055951251 +0200 +@@ -431,7 +431,7 @@ + $(T602_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + t602_la_SOURCES = + nodist_EXTRA_t602_la_SOURCES = dummy.cpp + +--- a/plugins/docbook/Makefile.in 2010-06-13 23:17:44.000000000 +0200 ++++ b/plugins/docbook/Makefile.in 2014-09-06 11:03:22.075951252 +0200 +@@ -431,7 +431,7 @@ + $(DOCBOOK_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + docbook_la_SOURCES = + nodist_EXTRA_docbook_la_SOURCES = dummy.cpp + +--- a/plugins/hrtext/Makefile.in 2010-06-13 23:17:47.000000000 +0200 ++++ b/plugins/hrtext/Makefile.in 2014-09-06 11:03:22.099951252 +0200 +@@ -431,7 +431,7 @@ + $(HRTEXT_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + hrtext_la_SOURCES = + nodist_EXTRA_hrtext_la_SOURCES = dummy.cpp + +--- a/plugins/s5/Makefile.in 2010-06-13 23:17:54.000000000 +0200 ++++ b/plugins/s5/Makefile.in 2014-09-06 11:03:22.119951253 +0200 +@@ -431,7 +431,7 @@ + $(S5_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + s5_la_SOURCES = + nodist_EXTRA_s5_la_SOURCES = dummy.cpp + +--- a/plugins/hancom/Makefile.in 2010-06-13 23:17:47.000000000 +0200 ++++ b/plugins/hancom/Makefile.in 2014-09-06 11:03:22.143951254 +0200 +@@ -431,7 +431,7 @@ + $(HANCOM_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + hancom_la_SOURCES = + nodist_EXTRA_hancom_la_SOURCES = dummy.cpp + +--- a/plugins/aiksaurus/Makefile.in 2010-06-13 23:17:40.000000000 +0200 ++++ b/plugins/aiksaurus/Makefile.in 2014-09-06 11:03:22.163951255 +0200 +@@ -428,7 +428,7 @@ + $(AIKSAURUS_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + aiksaurus_la_SOURCES = + all: all-recursive + +--- a/plugins/kword/Makefile.in 2010-06-13 23:17:48.000000000 +0200 ++++ b/plugins/kword/Makefile.in 2014-09-06 11:03:22.183951255 +0200 +@@ -431,7 +431,7 @@ + $(KWORD_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + kword_la_SOURCES = + nodist_EXTRA_kword_la_SOURCES = dummy.cpp + +--- a/plugins/freetranslation/Makefile.in 2010-06-13 23:17:45.000000000 +0200 ++++ b/plugins/freetranslation/Makefile.in 2014-09-06 11:03:22.207951256 +0200 +@@ -433,7 +433,7 @@ + $(FREETRANSLATION_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + freetranslation_la_SOURCES = + nodist_EXTRA_freetranslation_la_SOURCES = dummy.cpp + +--- a/plugins/mathview/Makefile.in 2010-06-13 23:17:48.000000000 +0200 ++++ b/plugins/mathview/Makefile.in 2014-09-06 11:03:22.227951257 +0200 +@@ -429,7 +429,7 @@ + $(MATHVIEW_LIBS) \ + -avoid-version \ + -module \ +- -no-undefined ++ -Wl,--no-undefined + + nodist_EXTRA_mathview_la_SOURCES = dummy.cpp + mathview_la_SOURCES = + +--- a/src/Makefile.in 2014-09-06 08:42:45.000000000 +0200 ++++ b/src/Makefile.in 2014-09-06 11:17:48.287979611 +0200 +@@ -538,7 +538,7 @@ + + @TOOLKIT_COCOA_TRUE@AbiWord_LDFLAGS = \ + @TOOLKIT_COCOA_TRUE@ $(DEPS_LIBS) \ +-@TOOLKIT_COCOA_TRUE@ --no-undefined \ ++@TOOLKIT_COCOA_TRUE@ -Wl,--no-undefined \ + @TOOLKIT_COCOA_TRUE@ -avoid-version \ + @TOOLKIT_COCOA_TRUE@ -export-dynamic \ + @TOOLKIT_COCOA_TRUE@ -headerpad_max_install_names +@@ -554,7 +554,7 @@ + + @TOOLKIT_COCOA_FALSE@abiword_LDFLAGS = \ + @TOOLKIT_COCOA_FALSE@ $(platform_ldflags) \ +-@TOOLKIT_COCOA_FALSE@ --no-undefined \ ++@TOOLKIT_COCOA_FALSE@ -Wl,--no-undefined \ + @TOOLKIT_COCOA_FALSE@ -avoid-version \ + @TOOLKIT_COCOA_FALSE@ -export-dynamic + diff --git a/gnu/packages/patches/abiword-use-proper-png-api.patch b/gnu/packages/patches/abiword-use-proper-png-api.patch new file mode 100644 index 0000000000..e8ce02899d --- /dev/null +++ b/gnu/packages/patches/abiword-use-proper-png-api.patch @@ -0,0 +1,175 @@ +Do not directly access the fields of png_struct and png_info. + +--- a/plugins/mswrite/xp/ie_imp_MSWrite.cpp 2010-05-30 21:20:53.000000000 +0200 ++++ b/plugins/mswrite/xp/ie_imp_MSWrite.cpp 2014-09-07 06:58:04.162298089 +0200 +@@ -891,7 +891,7 @@ + info_ptr = png_create_info_struct (png_ptr); + if (!info_ptr) goto err; + +- if (setjmp (png_ptr->jmpbuf) ) { ++ if (setjmp (png_jmpbuf(png_ptr)) ) { + png_destroy_write_struct (&png_ptr, &info_ptr); + goto err; + } + +--- a/src/af/gr/win/gr_Win32Image.cpp 2009-07-08 19:33:53.000000000 +0200 ++++ b/src/af/gr/win/gr_Win32Image.cpp 2014-09-07 06:58:04.198298090 +0200 +@@ -148,7 +148,7 @@ + info_ptr = png_create_info_struct(png_ptr); + + // libpng will longjmp back to here if a fatal error occurs +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + /* If we get here, we had a problem reading the file */ + png_destroy_write_struct(&png_ptr, (png_infopp)NULL); +@@ -547,7 +547,7 @@ + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in the png_create_read_struct() earlier. + */ +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + /* Free all of the memory associated with the png_ptr and info_ptr */ + png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); + +--- a/src/af/util/xp/ut_png.cpp 2008-02-24 04:33:07.000000000 +0100 ++++ b/src/af/util/xp/ut_png.cpp 2014-09-07 06:58:04.230298091 +0200 +@@ -71,7 +71,7 @@ + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in the png_create_read_struct() earlier. + */ +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + /* Free all of the memory associated with the png_ptr and info_ptr */ + png_destroy_read_struct(&png_ptr, &info_ptr, static_cast(NULL)); + +--- a/plugins/bmp/xp/ie_impGraphic_BMP.cpp 2009-06-25 06:02:06.000000000 +0200 ++++ b/plugins/bmp/xp/ie_impGraphic_BMP.cpp 2014-09-07 06:59:08.814300205 +0200 +@@ -313,7 +313,7 @@ + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in the png_create_read_struct() earlier. + */ +- if (setjmp(m_pPNG->jmpbuf)) ++ if (setjmp(png_jmpbuf(m_pPNG))) + { + /* Free all of the memory associated with the png_ptr and info_ptr */ + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); +@@ -332,7 +332,7 @@ + UT_Error IE_ImpGraphic_BMP::Convert_BMP_Pallet(UT_ByteBuf* pBB) + { + /* Reset error handling for libpng */ +- if (setjmp(m_pPNG->jmpbuf)) ++ if (setjmp(png_jmpbuf(m_pPNG))) + { + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); + return UT_ERROR; +@@ -372,7 +372,7 @@ + UT_Error IE_ImpGraphic_BMP::Convert_BMP(UT_ByteBuf* pBB) + { + /* Reset error handling for libpng */ +- if (setjmp(m_pPNG->jmpbuf)) ++ if (setjmp(png_jmpbuf(m_pPNG))) + { + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); + return UT_ERROR; + +--- a/plugins/rsvg/xp/AbiRSVG.cpp 2009-06-25 06:02:06.000000000 +0200 ++++ b/plugins/rsvg/xp/AbiRSVG.cpp 2014-09-07 06:59:08.914300209 +0200 +@@ -145,7 +145,7 @@ + return error; + } + +- if (setjmp(m_pPNG->jmpbuf)) ++ if (setjmp(png_jmpbuf(m_pPNG))) + { + g_object_unref(G_OBJECT(pixbuf)); + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); +@@ -234,7 +234,7 @@ + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in the png_create_read_struct() earlier. + */ +- if (setjmp(m_pPNG->jmpbuf)) ++ if (setjmp(png_jmpbuf(m_pPNG))) + { + /* Free all of the memory associated with the png_ptr and info_ptr */ + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); + +--- a/src/wp/impexp/win/ie_impGraphic_Win32Native.cpp 2009-07-07 18:50:18.000000000 +0200 ++++ b/src/wp/impexp/win/ie_impGraphic_Win32Native.cpp 2014-09-07 06:59:09.018300212 +0200 +@@ -501,7 +501,7 @@ + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in the png_create_read_struct() earlier. + */ +- if (setjmp(m_pPNG->jmpbuf)) ++ if (setjmp(png_jmpbuf(m_pPNG))) + { + /* Free all of the memory associated with the png_ptr and info_ptr */ + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); +@@ -520,7 +520,7 @@ + UT_Error IE_ImpGraphic_Win32Native::Convert_BMP_Palette(UT_ByteBuf* pBB) + { + /* Reset error handling for libpng */ +- if (setjmp(m_pPNG->jmpbuf)) ++ if (setjmp(png_jmpbuf(m_pPNG))) + { + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); + return UT_ERROR; +@@ -560,7 +560,7 @@ + UT_Error IE_ImpGraphic_Win32Native::Convert_BMP(UT_ByteBuf* pBB) + { + /* Reset error handling for libpng */ +- if (setjmp(m_pPNG->jmpbuf)) ++ if (setjmp(png_jmpbuf(m_pPNG))) + { + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); + return UT_ERROR; + +--- a/src/wp/impexp/gtk/ie_impGraphic_GdkPixbuf.cpp 2009-07-01 06:02:04.000000000 +0200 ++++ b/src/wp/impexp/gtk/ie_impGraphic_GdkPixbuf.cpp 2014-09-07 06:59:09.138300216 +0200 +@@ -185,7 +185,7 @@ + /** needed for the stejmp context */ + UT_Error IE_ImpGraphic_GdkPixbuf::_png_write(GdkPixbuf * pixbuf) + { +- if (setjmp(m_pPNG->jmpbuf)) ++ if (setjmp(png_jmpbuf(m_pPNG))) + { + DELETEP(m_pPngBB); + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); +@@ -446,7 +446,7 @@ + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in the png_create_read_struct() earlier. + */ +- if (setjmp(m_pPNG->jmpbuf)) ++ if (setjmp(png_jmpbuf(m_pPNG))) + { + /* Free all of the memory associated with the png_ptr and info_ptr */ + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); + +--- a/plugins/bmp/xp/ie_impGraphic_BMP.cpp 2014-09-07 07:03:02.000000000 +0200 ++++ b/plugins/bmp/xp/ie_impGraphic_BMP.cpp 2014-09-07 12:35:33.306961036 +0200 +@@ -191,7 +191,11 @@ + + /* Clean Up Memory Used */ + +- FREEP(m_pPNGInfo->palette); ++ ++ png_colorp palette; ++ int ignored_placeholder; ++ png_get_PLTE(m_pPNG, m_pPNGInfo, &palette, &ignored_placeholder); ++ FREEP(palette); + DELETEP(pBB); + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); + +--- a/plugins/garble/xp/abiword-garble-png.cpp 2009-09-05 17:34:44.000000000 +0200 ++++ b/plugins/garble/xp/abiword-garble-png.cpp 2014-09-08 00:15:04.508335153 +0200 +@@ -79,7 +79,7 @@ + png_set_strip_alpha( png_ptr ); + png_set_interlace_handling( png_ptr ); + png_set_bgr( png_ptr ); +- rowbytes = info_ptr->rowbytes; ++ rowbytes = png_get_rowbytes( png_ptr, info_ptr ); + png_destroy_read_struct( &png_ptr, &info_ptr, NULL ); + } + diff --git a/gnu/packages/patches/abiword-wmf-version-lookup-fix.patch b/gnu/packages/patches/abiword-wmf-version-lookup-fix.patch new file mode 100644 index 0000000000..f27f32f30b --- /dev/null +++ b/gnu/packages/patches/abiword-wmf-version-lookup-fix.patch @@ -0,0 +1,28 @@ +The way the configure script determines the version of libwmf is by temporarily +making dots separator characters, but since the file name of the program which +returns the version contains dots in Guix (the version in the store entry name), +doing it this way will always fail. + +This is a simple guix-specific fix for the problem. + +--- a/configure 2010-06-13 23:17:37.000000000 +0200 ++++ b/configure 2014-09-08 17:31:52.102371800 +0200 +@@ -21140,13 +21140,11 @@ + $as_echo "$as_me: WARNING: wmf plugin: program libwmf-config not found in path" >&2;} + fi + else +- IFS_old="$IFS" +- IFS='.' +- set -- `$libwmfconfig --version` +- libwmf_major_found="${1}" +- libwmf_minor_found="${2}" +- libwmf_micro_found="${3}" +- IFS="$IFS_old" ++ libwmf_fullver_found=`$libwmfconfig --version` ++ libwmf_major_found=$(echo $libwmf_fullver_found | cut -d . -f 1) ++ libwmf_minor_found=$(echo $libwmf_fullver_found | cut -d . -f 2) ++ libwmf_micro_found=$(echo $libwmf_fullver_found | cut -d . -f 3) ++ + if test "$libwmf_major_found" -gt "$libwmf_major_req"; then + wmf_deps="yes" + elif test "$libwmf_major_found" -eq "$libwmf_major_req" && From a3c4aa1b70c7affc72a58fdd94c36b8ed22e6878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 9 Sep 2014 15:33:57 +0200 Subject: [PATCH 19/44] gnu: abiword: Use 'wv', not 'wvware'. * gnu/packages/abiword.scm: Change 'wvware' to 'wv'. --- gnu/packages/abiword.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/abiword.scm b/gnu/packages/abiword.scm index 7d9b82b78d..82a289e712 100644 --- a/gnu/packages/abiword.scm +++ b/gnu/packages/abiword.scm @@ -36,7 +36,7 @@ #:use-module (gnu packages popt) #:use-module (gnu packages pkg-config) #:use-module (gnu packages readline) - #:use-module (gnu packages wvware) + #:use-module (gnu packages wv) #:use-module (gnu packages xml)) (define-public abiword @@ -92,7 +92,7 @@ ("ots" ,ots) ("popt" ,popt) ("readline" ,readline) - ("wvware" ,wvware) + ("wv" ,wv) ("zlib" ,zlib))) (native-inputs `(("intltool" ,intltool) From 757d5ff3067260d1e4562cfc2532d729f9491234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 9 Sep 2014 15:35:00 +0200 Subject: [PATCH 20/44] gnu: libwmf: Use a mirror:// URL. * gnu/packages/image.scm (libwmf): Use a mirror://sourceforge URL. --- gnu/packages/image.scm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 6a81143bda..1536378d4f 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -131,12 +131,9 @@ collection of tools for doing simple manipulations of TIFF images.") (source (origin (method url-fetch) - (uri - (string-append - "http://sourceforge.net/projects/wvware/files/" name "/" version - "/" name "-" version ".tar.gz/download")) - (file-name - (string-append name "-" version ".tar.gz")) + (uri (string-append "mirror://sourceforge/wvware/" + name "/" version + "/" name "-" version ".tar.gz")) (sha256 (base32 "1y3wba4q8pl7kr51212jwrsz1x6nslsx1gsjml1x0i8549lmqd2v")))) From df5ce088f2a0b7373eaa06ead9de580a86690180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 9 Sep 2014 17:12:33 +0200 Subject: [PATCH 21/44] system: Export '%setuid-programs'. * gnu/system.scm: Export '%setuid-programs', as documented in the manual. --- gnu/system.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/gnu/system.scm b/gnu/system.scm index ea7fdf1cb7..067f4e1634 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -70,6 +70,7 @@ operating-system-profile operating-system-grub.cfg + %setuid-programs %base-packages)) ;;; Commentary: From bde7eb8f0ae6a58b0195434ed15210acdda309aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 9 Sep 2014 17:13:43 +0200 Subject: [PATCH 22/44] Have (gnu) re-export (guix gexp). * gnu.scm (%public-modules): Add '(guix gexp)'. --- gnu.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu.scm b/gnu.scm index e573de6531..eb0bf71ab1 100644 --- a/gnu.scm +++ b/gnu.scm @@ -36,7 +36,8 @@ (gnu services) (gnu services base) (gnu packages) - (gnu packages base))) + (gnu packages base) + (guix gexp))) ; so gexps can be used (for-each (let ((i (module-public-interface (current-module)))) (lambda (m) From 6bb08d056ecec2c452f8bb4558e4192b0a9422f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 9 Sep 2014 17:17:46 +0200 Subject: [PATCH 23/44] gnu: wv: Fix URL. Reported by Marek Benc. * gnu/packages/wv.scm (wv): Change URL to mirror://. Also replace one NAME occurrence in the URL with 'wvware'. --- gnu/packages/wv.scm | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/gnu/packages/wv.scm b/gnu/packages/wv.scm index 31afd8608d..af8412cbc4 100644 --- a/gnu/packages/wv.scm +++ b/gnu/packages/wv.scm @@ -32,16 +32,13 @@ (package (name "wv") (version "1.2.4") - (source - (origin - (method url-fetch) - (uri - (string-append - "http://sourceforge.net/projects/" name "/files/wv/" version - "/wv-" version ".tar.gz/download")) - (file-name (string-append "wv-" version ".tar.gz")) - (sha256 - (base32 "1mn2ax6qjy3pvixlnvbkn6ymy6y4l2wxrr4brjaczm121s8hjcb7")))) + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/wvware/wv/" version + "/wv-" version ".tar.gz")) + (sha256 + (base32 + "1mn2ax6qjy3pvixlnvbkn6ymy6y4l2wxrr4brjaczm121s8hjcb7")))) (build-system gnu-build-system) (arguments From 6e4532e8fec5b31fad38be82ada46b5a70952b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 10 Sep 2014 15:44:51 +0200 Subject: [PATCH 24/44] Add Marek to 'AUTHORS'. --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 1ba9798e7e..4e3d0aa001 100644 --- a/AUTHORS +++ b/AUTHORS @@ -10,6 +10,7 @@ alphabetical order): Eric Bavier Taylan Ulrich Bayirli/Kammer + Marek Benc Ludovic Courtès John Darrington Andreas Enge From a4888e2e0fb010836930f09a3822580a04fd7e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 10 Sep 2014 21:39:47 +0200 Subject: [PATCH 25/44] install: Gracefully handle corner cases with 'guix system init foo /'. * gnu/build/install.scm (evaluate-populate-directive): Wrap body in "catch 'system-error", and report clear errors. In the symlink case, retry up EEXIST. (populate-root-file-system): Remove /var/guix/profiles/system-1-link before attempting to create it. --- gnu/build/install.scm | 45 +++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/gnu/build/install.scm b/gnu/build/install.scm index e16896f8b8..7c4a7b7753 100644 --- a/gnu/build/install.scm +++ b/gnu/build/install.scm @@ -56,18 +56,38 @@ MOUNT-POINT." "Evaluate DIRECTIVE, an sexp describing a file or directory to create under directory TARGET." (let loop ((directive directive)) - (match directive - (('directory name) - (mkdir-p (string-append target name))) - (('directory name uid gid) - (let ((dir (string-append target name))) - (mkdir-p dir) - (chown dir uid gid))) - (('directory name uid gid mode) - (loop `(directory ,name ,uid ,gid)) - (chmod (string-append target name) mode)) - ((new '-> old) - (symlink old (string-append target new)))))) + (catch 'system-error + (lambda () + (match directive + (('directory name) + (mkdir-p (string-append target name))) + (('directory name uid gid) + (let ((dir (string-append target name))) + (mkdir-p dir) + (chown dir uid gid))) + (('directory name uid gid mode) + (loop `(directory ,name ,uid ,gid)) + (chmod (string-append target name) mode)) + ((new '-> old) + (let try () + (catch 'system-error + (lambda () + (symlink old (string-append target new))) + (lambda args + ;; When doing 'guix system init' on the current '/', some + ;; symlinks may already exists. Override them. + (if (= EEXIST (system-error-errno args)) + (begin + (delete-file (string-append target new)) + (try)) + (apply throw args)))))))) + (lambda args + ;; Usually we can only get here when installing to an existing root, + ;; as with 'guix system init foo.scm /'. + (format (current-error-port) + "error: failed to evaluate directive: ~s~%" + directive) + (apply throw args))))) (define (directives store) "Return a list of directives to populate the root file system that will host @@ -106,6 +126,7 @@ includes /etc, /var, /run, /bin/sh, etc., and all the symlinks to SYSTEM." (directives (%store-directory))) ;; Add system generation 1. + (false-if-exception (delete-file "/var/guix/profiles/system-1-link")) (symlink system (string-append target "/var/guix/profiles/system-1-link"))) From f2817d4303bb21059a6b7980b8aa5b4671d2748f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 10 Sep 2014 22:59:27 +0200 Subject: [PATCH 26/44] gnu: lvm2: Programs such as 'dmsetup' now have a correct RUNPATH. * gnu/packages/linux.scm (alsa-utils): Add comment. (lvm2): Add LDFLAGS as a configure flag. --- gnu/packages/linux.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index fbf70cca55..7be0d076ec 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -613,6 +613,9 @@ MIDI functionality to the Linux-based operating system.") (arguments ;; XXX: Disable man page creation until we have DocBook. '(#:configure-flags (list "--disable-xmlto" + + ;; The udev rule is responsible for restoring + ;; the volume. (string-append "--with-udev-rules-dir=" (assoc-ref %outputs "out") "/lib/udev/rules.d")) @@ -1397,7 +1400,13 @@ time.") (assoc-ref %outputs "out") "/etc/lvm") "--enable-udev_sync" - "--enable-udev_rules") + "--enable-udev_rules" + + ;; Make sure programs such as 'dmsetup' can + ;; find libdevmapper.so. + (string-append "LDFLAGS=-Wl,-rpath=" + (assoc-ref %outputs "out") + "/lib")) ;; The tests use 'mknod', which requires root access. #:tests? #f)) From c4634dfa260fd927a777f7d98f2425c32e20848a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 10 Sep 2014 23:33:30 +0200 Subject: [PATCH 27/44] profiles: Adjust for compatibility with Guile 2.0.5. Reported by Andreas Enge . * guix/profiles.scm (right-arrow): Use 'set-port-conversion-strategy!' instead of '%default-port-conversion-strategy'. The latter is only available in Guile 2.0.5. --- guix/profiles.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guix/profiles.scm b/guix/profiles.scm index 9dc9ab43b9..aa88b849e1 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -321,10 +321,10 @@ replacement if PORT is not Unicode-capable." (let ((arrow "→")) (catch 'encoding-error (lambda () - (with-fluids ((%default-port-conversion-strategy 'error)) - (with-output-to-string - (lambda () - (display arrow))))) + (call-with-output-string + (lambda (port) + (set-port-conversion-strategy! port 'error) + (display arrow port)))) (lambda (key . args) "->"))))) From 275a77113c4b878b49a4604d13198501adfb0e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Sep 2014 09:51:39 +0200 Subject: [PATCH 28/44] gnu: lzip: Update to 1.16. * gnu/packages/compression.scm (lzip): Update to 1.16. --- gnu/packages/compression.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index 6887ba6167..11e8d2bc17 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014 Ludovic Courtès ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2014 Mark H Weaver ;;; @@ -264,14 +264,14 @@ some compression ratio).") (define-public lzip (package (name "lzip") - (version "1.15") + (version "1.16") (source (origin (method url-fetch) (uri (string-append "mirror://savannah/lzip/lzip-" version ".tar.gz")) (sha256 (base32 - "1dh5vmj5apizfawnsm50y7z064yx7cz3313przph16gwd3dgrlvw")))) + "0l9724rw1l3hg2ldr3n7ihqich4m9nc6y7l302bvdj4jmxdw530j")))) (build-system gnu-build-system) (home-page "http://www.nongnu.org/lzip/lzip.html") (synopsis "Lossless data compressor based on the LZMA algorithm") From 00d908db1eac4c87734af36bd5e14bfd3d32f702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Sep 2014 09:52:14 +0200 Subject: [PATCH 29/44] nls: Adjust reference to stale file. * po/packages/POTFILES.in: Replace recutils.scm with databases.scm. --- po/packages/POTFILES.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/packages/POTFILES.in b/po/packages/POTFILES.in index 43db1b2719..7f287f6816 100644 --- a/po/packages/POTFILES.in +++ b/po/packages/POTFILES.in @@ -3,4 +3,4 @@ gnu/packages/base.scm gnu/packages/guile.scm gnu/packages/lout.scm -gnu/packages/recutils.scm +gnu/packages/databases.scm From c361d075d34afe4260267b3608861b4360a49447 Mon Sep 17 00:00:00 2001 From: Kevin Lemonnier Date: Thu, 11 Sep 2014 03:12:39 +0200 Subject: [PATCH 30/44] gnu: Have lua-5.1 compile a .so MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/lua51-liblua-so.patch: New file * gnu/packages/lua.scm: Use of lua51-liblua-so.patch in lua-5.1 Signed-off-by: Ludovic Courtès --- gnu/packages/lua.scm | 3 +- gnu/packages/patches/lua51-liblua-so.patch | 65 ++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/lua51-liblua-so.patch diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index a85c120469..92ffc22c14 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm @@ -75,7 +75,8 @@ for configuration, scripting, and rapid prototyping.") (uri (string-append "http://www.lua.org/ftp/lua-" version ".tar.gz")) (sha256 - (base32 "0cskd4w0g6rdm2q8q3i4n1h3j8kylhs3rq8mxwl9vwlmlxbgqh16")))))) + (base32 "0cskd4w0g6rdm2q8q3i4n1h3j8kylhs3rq8mxwl9vwlmlxbgqh16")) + (patches (list (search-patch "lua51-liblua-so.patch"))))))) (define-public luajit (package diff --git a/gnu/packages/patches/lua51-liblua-so.patch b/gnu/packages/patches/lua51-liblua-so.patch new file mode 100644 index 0000000000..6795f10ac7 --- /dev/null +++ b/gnu/packages/patches/lua51-liblua-so.patch @@ -0,0 +1,65 @@ + +Patch the two Makefile to also create liblua.so +Original patch by Allan McRae +for Archlinux + + +diff -ruN lua-5.1.5/Makefile lua-5.1.5-new/Makefile +--- lua-5.1.5/Makefile 2012-02-10 10:50:23.000000000 +0100 ++++ lua-5.1.5-new/Makefile 2014-09-10 20:17:28.913951433 +0200 +@@ -43,7 +43,7 @@ + # What to install. + TO_BIN= lua luac + TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp +-TO_LIB= liblua.a ++TO_LIB= liblua.a liblua.so liblua.so.${V} + TO_MAN= lua.1 luac.1 + + # Lua version and release. +@@ -53,7 +53,7 @@ + all: $(PLAT) + + $(PLATS) clean: +- cd src && $(MAKE) $@ ++ cd src && $(MAKE) $@ V=$(V) R=$(R) + + test: dummy + src/lua test/hello.lua +diff -ruN lua-5.1.5/src/Makefile lua-5.1.5-new/src/Makefile +--- lua-5.1.5/src/Makefile 2012-02-13 21:41:22.000000000 +0100 ++++ lua-5.1.5-new/src/Makefile 2014-09-10 20:16:09.982952152 +0200 +@@ -8,7 +8,7 @@ + PLAT= none + + CC= gcc +-CFLAGS= -O2 -Wall $(MYCFLAGS) ++CFLAGS= -O2 -Wall $(MYCFLAGS) -fPIC + AR= ar rcu + RANLIB= ranlib + RM= rm -f +@@ -34,9 +34,10 @@ + + LUAC_T= luac + LUAC_O= luac.o print.o ++LUA_SO= liblua.so + + ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O) +-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) ++ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) + ALL_A= $(LUA_A) + + default: $(PLAT) +@@ -57,6 +58,13 @@ + $(LUAC_T): $(LUAC_O) $(LUA_A) + $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) + ++$(LUA_SO): $(CORE_O) $(LIB_O) ++ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS) ++ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) ++ ln -sf $(LUA_SO).$(R) $(LUA_SO) ++ ++ ++ + clean: + $(RM) $(ALL_T) $(ALL_O) + From d5b888fa2d8a1ab4a7d38246930891a111121380 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 11 Sep 2014 15:25:46 +0200 Subject: [PATCH 31/44] gnu: freeipmi: Update to 1.4.5. * gnu/packages/freeipmi.scm (freeipmi): Update to 1.4.5. --- gnu/packages/freeipmi.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/freeipmi.scm b/gnu/packages/freeipmi.scm index 46240123c1..5ce87ae842 100644 --- a/gnu/packages/freeipmi.scm +++ b/gnu/packages/freeipmi.scm @@ -27,14 +27,14 @@ (define-public freeipmi (package (name "freeipmi") - (version "1.4.1") + (version "1.4.5") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/freeipmi/freeipmi-" version ".tar.gz")) (sha256 (base32 - "1qpr4h46zmbk82w4fpijimzsdpgyr0fdnsinpsp5cvxy5pcikbd6")))) + "033zakrk3kvi4y41kslicr90b3yb2kj052cl6nbja7ybn70y9nkz")))) (build-system gnu-build-system) (inputs `(("readline" ,readline) ("libgcrypt" ,libgcrypt))) From 9493176ad7f5cd8a37ea38d84a9cf5403fcc4dd1 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 11 Sep 2014 15:32:09 +0200 Subject: [PATCH 32/44] gnu: global: Update to 6.3.2. * gnu/packages/global.scm (global): Update to 6.3.2. --- gnu/packages/global.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/global.scm b/gnu/packages/global.scm index e50a57f2e6..d43caf4f54 100644 --- a/gnu/packages/global.scm +++ b/gnu/packages/global.scm @@ -28,14 +28,14 @@ (define-public global ; a global variable (package (name "global") - (version "6.3") + (version "6.3.2") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/global/global-" version ".tar.gz")) (sha256 (base32 - "1nzqqcry3mfha53n8j1grdg2dflp9gpg54qwlsrzq9sspwg78769")))) + "07iifpz00ch3drlscvk5v12j7bckwv6pk8040y81s1x14b0gf220")))) (build-system gnu-build-system) (inputs `(("ncurses" ,ncurses) ("libtool" ,libtool))) From 66fdf545874ff5303deb27dbed664ad037f991dd Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 11 Sep 2014 16:43:08 +0200 Subject: [PATCH 33/44] gnu: glpk: Update to 4.55. * gnu/packages/maths.scm (glpk): Update to 4.55. --- gnu/packages/maths.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 813480616e..774686310f 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -123,7 +123,7 @@ numbers.") (define-public glpk (package (name "glpk") - (version "4.54") + (version "4.55") (source (origin (method url-fetch) @@ -131,7 +131,7 @@ numbers.") version ".tar.gz")) (sha256 (base32 - "18gr2anv8gyps6j9f22k7li6w07glvww666sdqblvlq2hh3whwmb")))) + "1rqx5fzj1mhkifilip5mkxybpj2wkniq5qcn8h1w2vkr2rzhs29p")))) (build-system gnu-build-system) (inputs `(("gmp" ,gmp))) From f489668723113b0802b81c1e7fc2d9d2932961c3 Mon Sep 17 00:00:00 2001 From: Kevin Lemonnier Date: Fri, 12 Sep 2014 01:49:22 +0200 Subject: [PATCH 34/44] gnu: Add weechat * gnu/packages/weechat.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. Signed-off-by: Eric Bavier --- gnu-system.am | 1 + gnu/packages/weechat.scm | 101 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 gnu/packages/weechat.scm diff --git a/gnu-system.am b/gnu-system.am index f09b4d64b9..44cdd2738a 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -249,6 +249,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/w3m.scm \ gnu/packages/wdiff.scm \ gnu/packages/web.scm \ + gnu/packages/weechat.scm \ gnu/packages/wget.scm \ gnu/packages/which.scm \ gnu/packages/wordnet.scm \ diff --git a/gnu/packages/weechat.scm b/gnu/packages/weechat.scm new file mode 100644 index 0000000000..5555601d47 --- /dev/null +++ b/gnu/packages/weechat.scm @@ -0,0 +1,101 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Kevin Lemonnier +;;; +;;; 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 . + +;; TODO: Add ruby + +(define-module (gnu packages weechat) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages base) + #:use-module (gnu packages gettext) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages file) + #:use-module (gnu packages compression) + #:use-module (gnu packages lua) + #:use-module (gnu packages python) + #:use-module (gnu packages perl) + #:use-module (gnu packages tcl) + #:use-module (gnu packages aspell) + #:use-module (gnu packages curl) + #:use-module (gnu packages gnutls) + #:use-module (gnu packages guile) + #:use-module (gnu packages openssl) + #:use-module (gnu packages cyrus-sasl) + #:use-module (gnu packages autogen) + #:use-module (gnu packages autotools) + #:use-module (gnu packages pkg-config) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) #:select (gpl3))) + +(define-public weechat + (package + (name "weechat") + (version "1.0") + (source (origin + (method url-fetch) + (uri (string-append "http://weechat.org/files/src/weechat-" + version ".tar.gz")) + (sha256 + (base32 "1z17wyrl5fp697qp44srpmzk79w37f5hm1r0krffbmga6sbzdj3x")))) + (build-system gnu-build-system) + (native-inputs `(("autoconf" ,autoconf) + ("pkg-config" ,pkg-config) + ("file" ,file) + ("autogen" ,autogen) + ("automake" ,automake))) + (inputs `(("ncurses" ,ncurses) + ("diffutils" ,diffutils) + ("gettext" ,gnu-gettext) + ("libtool" ,libtool "bin") + ("libtool" ,libtool "out") + ("libgcrypt" ,libgcrypt "out") + ("zlib" ,zlib) + ("aspell" ,aspell) + ("curl" ,curl) + ("gnutls" ,gnutls) + ("guile" ,guile-2.0) + ("openssl" ,openssl) + ("cyrus-sasl" ,cyrus-sasl) + ("lua" ,lua-5.1) + ("python" ,python-2) + ("perl" ,perl) + ("tcl" ,tcl))) + (arguments `(#:configure-flags (list + (string-append + "--with-tclconfig=" + (assoc-ref %build-inputs "tcl") "/lib")) + #:phases (alist-cons-after + 'autogen 'fix-file + (lambda _ + (substitute* "configure" + (("/usr/bin/file") (which "file")))) + (alist-cons-before + 'configure 'autogen + (lambda _ + (zero? (system* "./autogen.sh"))) + %standard-phases)))) + (synopsis "Extensible chat client") + (description "WeeChat (Wee Enhanced Environment for Chat) is an +Internet Relay Chat client, which is designed to be light and fast. +The client uses a curses frontend, and there are remote interfaces +for Web, Qt, Android and Emacs. In WeeChat everything can be done +with a keyboard, though it also supports mouse. It is customizable +and extensible with plugins and scripts.") + (home-page "http://www.weechat.org/") + (license gpl3))) From 095f4deb4b78c45ab284e47c1f427f9812b5a67b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Sep 2014 21:25:58 +0200 Subject: [PATCH 35/44] activation: Factorize the link-or-copy trick. * gnu/build/activation.scm (link-or-copy): New procedure. (activate-setuid-programs): Use it. --- gnu/build/activation.scm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index 362669cbf9..d17bb7943f 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -175,19 +175,24 @@ numeric gid or #f." ;; Place where setuid programs are stored. "/run/setuid-programs") +(define (link-or-copy source target) + "Attempt to make TARGET a hard link to SOURCE; if it fails, fall back to +copy SOURCE to TARGET." + (catch 'system-error + (lambda () + (link source target)) + (lambda args + ;; Perhaps SOURCE and TARGET live in a different file system, so copy + ;; SOURCE. + (copy-file source target)))) + (define (activate-setuid-programs programs) "Turn PROGRAMS, a list of file names, into setuid programs stored under %SETUID-DIRECTORY." (define (make-setuid-program prog) (let ((target (string-append %setuid-directory "/" (basename prog)))) - (catch 'system-error - (lambda () - (link prog target)) - (lambda args - ;; Perhaps PROG and TARGET live in a different file system, so copy - ;; PROG. - (copy-file prog target))) + (link-or-copy prog target) (chown target 0 0) (chmod target #o6555))) From 286cacaded85f44bb39290253e73a36972f9e343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Sep 2014 21:27:19 +0200 Subject: [PATCH 36/44] activation: Remove outdated comment. * gnu/build/activation.scm (activate-etc): Remove outdated comment. --- gnu/build/activation.scm | 2 -- 1 file changed, 2 deletions(-) diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index d17bb7943f..03c1d24126 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -152,8 +152,6 @@ numeric gid or #f." (rm-f "/etc/static") (symlink etc "/etc/static") (for-each (lambda (file) - ;; TODO: Handle 'shadow' specially so that changed - ;; password aren't lost. (let ((target (string-append "/etc/" file)) (source (string-append "/etc/static/" file))) (rm-f target) From c6a0536d08e225c6c67647b17f6f0a60b2314752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Sep 2014 21:34:30 +0200 Subject: [PATCH 37/44] activation: Make sure /etc/sudoers & co. are regular files. Before that, 'sudo' would exit with: sudo: /etc/sudoers is not a regular file sudo: no valid sudoers sources found, quitting * gnu/build/activation.scm (activate-etc): Check if SOURCE matches 'file-is-directory?'. If not, use 'copy-file' instead of 'symlink'. --- gnu/build/activation.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index 03c1d24126..009c1fff0a 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -155,7 +155,14 @@ numeric gid or #f." (let ((target (string-append "/etc/" file)) (source (string-append "/etc/static/" file))) (rm-f target) - (symlink source target))) + + ;; Things such as /etc/sudoers must be regular files, not + ;; symlinks; furthermore, they could be modified behind our + ;; back---e.g., with 'visudo'. Thus, make a copy instead of + ;; symlinking them. + (if (file-is-directory? source) + (symlink source target) + (copy-file source target)))) (scandir etc (lambda (file) (not (member file '("." "..")))) From f9d53de1054961208b153081a82037619419f25a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Sep 2014 21:53:20 +0200 Subject: [PATCH 38/44] system: Add default PAM entries for xlock and xscreensaver. * gnu/system/linux.scm (base-pam-services): Add "xlock" and "xscreensaver". --- gnu/system/linux.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/system/linux.scm b/gnu/system/linux.scm index 524ad01261..8cddedf28e 100644 --- a/gnu/system/linux.scm +++ b/gnu/system/linux.scm @@ -175,7 +175,8 @@ authenticate to run COMMAND." ;; These programs are setuid-root. (map (cut unix-pam-service <> #:allow-empty-passwords? allow-empty-passwords?) - '("su" "passwd" "sudo")) + '("su" "passwd" "sudo" + "xlock" "xscreensaver")) ;; These programs are not setuid-root, and we want root to be able ;; to run them without having to authenticate (notably because From c65e1834032d7f6e1bc4ebbc8157389a922f1e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Sep 2014 22:03:24 +0200 Subject: [PATCH 39/44] system: Add 'hosts-file' field. * gnu/system.scm ()[hosts-file]: New field. (default-/etc/hosts): New procedure. (etc-directory): Add #:hosts-file parameter and honor it. (operating-system-etc-directory): Build /etc/hosts, and pass it as #:hosts-file to 'etc-directory'. --- gnu/system.scm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gnu/system.scm b/gnu/system.scm index 067f4e1634..20fe1d0a8f 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -55,6 +55,7 @@ operating-system-user-services operating-system-packages operating-system-host-name + operating-system-hosts-file operating-system-kernel operating-system-initrd operating-system-users @@ -92,6 +93,8 @@ (default base-initrd)) (host-name operating-system-host-name) ; string + (hosts-file operating-system-hosts-file ; M item | #f + (default #f)) (file-systems operating-system-file-systems) ; list of fs @@ -221,12 +224,19 @@ explicitly appear in OS." " This is the GNU system. Welcome.\n") +(define (default-/etc/hosts host-name) + "Return the default /etc/hosts file." + (text-file "hosts" + (string-append "localhost 127.0.0.1\n" + host-name " 127.0.0.1\n"))) + (define* (etc-directory #:key (locale "C") (timezone "Europe/Paris") (issue "Hello!\n") (skeletons '()) (pam-services '()) (profile "/run/current-system/profile") + hosts-file (sudoers "")) "Return a derivation that builds the static part of the /etc directory." (mlet* %store-monad @@ -269,6 +279,7 @@ alias ll='ls -l' ("skel" ,#~#$skel) ("shells" ,#~#$shells) ("profile" ,#~#$bashrc) + ("hosts" ,#~#$hosts-file) ("localtime" ,#~(string-append #$tzdata "/share/zoneinfo/" #$timezone)) ("sudoers" ,#~#$sudoers))))) @@ -311,12 +322,15 @@ alias ll='ls -l' (append (operating-system-pam-services os) (append-map service-pam-services services)))) (profile-drv (operating-system-profile os)) - (skeletons (operating-system-skeletons os))) + (skeletons (operating-system-skeletons os)) + (/etc/hosts (or (operating-system-hosts-file os) + (default-/etc/hosts (operating-system-host-name os))))) (etc-directory #:pam-services pam-services #:skeletons skeletons #:issue (operating-system-issue os) #:locale (operating-system-locale os) #:timezone (operating-system-timezone os) + #:hosts-file /etc/hosts #:sudoers (operating-system-sudoers os) #:profile profile-drv))) From ecd06ca9faa7b87fb7be770f563c8a0760a64709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Sep 2014 22:13:37 +0200 Subject: [PATCH 40/44] services: udev: Allow for additional udev rules. * gnu/services/base.scm (udev-rules-union): New procedure. (udev-service): Add #:rules parameter. Call 'udev-rules-union' and create udev.conf. Set $UDEV_CONFIG_FILE before spawning udevd. --- gnu/services/base.scm | 47 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index b5b49d1a01..bf5af8369e 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -25,7 +25,7 @@ #:use-module (gnu system linux) ; 'pam-service', etc. #:use-module (gnu packages admin) #:use-module ((gnu packages linux) - #:select (udev kbd e2fsprogs)) + #:select (udev kbd e2fsprogs lvm2)) #:use-module ((gnu packages base) #:select (canonical-package glibc)) #:use-module (gnu packages package-management) @@ -479,9 +479,41 @@ passed to @command{guix-daemon}." (id 30000)))) (activate activate))))) -(define* (udev-service #:key (udev udev)) - "Run @var{udev}, which populates the @file{/dev} directory dynamically." - (with-monad %store-monad +(define (udev-rules-union packages) + "Return the union of the @code{lib/udev/rules.d} directories found in each +item of @var{packages}." + (define build + #~(begin + (use-modules (guix build union) + (guix build utils) + (srfi srfi-1) + (srfi srfi-26)) + + (define %standard-locations + '("/lib/udev/rules.d" "/libexec/udev/rules.d")) + + (define (rules-sub-directory directory) + ;; Return the sub-directory of DIRECTORY containing udev rules, or + ;; #f if none was found. + (find directory-exists? + (map (cut string-append directory <>) %standard-locations))) + + (mkdir-p (string-append #$output "/lib/udev")) + (union-build (string-append #$output "/lib/udev/rules.d") + (filter-map rules-sub-directory '#$packages)))) + + (gexp->derivation "udev-rules" build + #:modules '((guix build union) + (guix build utils)) + #:local-build? #t)) + +(define* (udev-service #:key (udev udev) (rules '())) + "Run @var{udev}, which populates the @file{/dev} directory dynamically. Get +extra rules from the packages listed in @var{rules}." + (mlet* %store-monad ((rules (udev-rules-union (cons udev rules))) + (udev.conf (text-file* "udev.conf" + "udev_rules=\"" rules + "/lib/udev/rules.d\"\n"))) (return (service (provision '(udev)) @@ -513,6 +545,8 @@ passed to @command{guix-daemon}." (setenv "LINUX_MODULE_DIRECTORY" "/run/booted-system/kernel/lib/modules") + (setenv "UDEV_CONFIG_FILE" #$udev.conf) + (let ((pid (primitive-fork))) (case pid ((0) @@ -555,6 +589,9 @@ This is the GNU operating system, welcome!\n\n"))) (syslog-service) (guix-service) (nscd-service) - (udev-service)))) + + ;; By default, enable the udev rules of LVM2. They are needed as + ;; soon as LVM2 or the device-mapper is used. + (udev-service #:rules (list lvm2))))) ;;; base.scm ends here From ee248b6a7043f308eaaa2b1deb708b52d4923659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Sep 2014 22:18:52 +0200 Subject: [PATCH 41/44] activation: Make the /bin/sh symlink at activation time. * gnu/build/install.scm (directives): Remove "/bin/sh". * gnu/build/activation.scm (activate-/bin/sh): New procedure. * gnu/system.scm (operating-system-activation-script): Use it. --- gnu/build/activation.scm | 6 ++++++ gnu/build/install.scm | 1 - gnu/system.scm | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index 009c1fff0a..ee82a078b9 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -26,6 +26,7 @@ #:export (activate-users+groups activate-etc activate-setuid-programs + activate-/bin/sh activate-current-system)) ;;; Commentary: @@ -214,6 +215,11 @@ copy SOURCE to TARGET." (for-each make-setuid-program programs)) +(define (activate-/bin/sh shell) + "Change /bin/sh to point to SHELL." + (symlink shell "/bin/sh.new") + (rename-file "/bin/sh.new" "/bin/sh")) + (define %current-system ;; The system that is current (a symlink.) This is not necessarily the same ;; as the system we booted (aka. /run/booted-system) because we can re-build diff --git a/gnu/build/install.scm b/gnu/build/install.scm index 7c4a7b7753..a472259a4a 100644 --- a/gnu/build/install.scm +++ b/gnu/build/install.scm @@ -113,7 +113,6 @@ STORE." ("/var/guix/gcroots/current-system" -> "/run/current-system") (directory "/bin") - ("/bin/sh" -> "/run/current-system/profile/bin/bash") (directory "/tmp" 0 0 #o1777) ; sticky bit (directory "/root" 0 0) ; an exception diff --git a/gnu/system.scm b/gnu/system.scm index 20fe1d0a8f..abdd80bd6d 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -417,6 +417,11 @@ etc." (use-modules (gnu build activation)) + ;; Make sure /bin/sh is valid and current. + (activate-/bin/sh + (string-append #$(canonical-package bash) + "/bin/sh")) + ;; Populate /etc. (activate-etc #$etc) From c851400bee4f42d9ef582820a1badaa96ba72934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Sep 2014 23:21:42 +0200 Subject: [PATCH 42/44] system: Add '\w' to the default PS1. * gnu/system.scm (etc-directory)[bashrc]: Add '\w' to PS1. --- gnu/system.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/system.scm b/gnu/system.scm index abdd80bd6d..8a3f4f6ba8 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -252,7 +252,7 @@ This is the GNU system. Welcome.\n") ;; TODO: Generate bashrc from packages' search-paths. (bashrc (text-file* "bashrc" " -export PS1='\\u@\\h\\$ ' +export PS1='\\u@\\h \\w\\$ ' export LC_ALL=\"" locale "\" export TZ=\"" timezone "\" From ee7bae3bbd2030d5f2cdb88e484e1c67a063e2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Sep 2014 23:23:07 +0200 Subject: [PATCH 43/44] activation: Set the permissions of /etc/sudoers to 440. * gnu/build/activation.scm (activate-etc): Move 'rm-f' to a local 'define'. When TARGET is "sudoers", make it 440. --- gnu/build/activation.scm | 56 ++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index ee82a078b9..04dd19f3e1 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -147,35 +147,41 @@ numeric gid or #f." ;; /etc is a mixture of static and dynamic settings. Here is where we ;; initialize it from the static part. + (define (rm-f file) + (false-if-exception (delete-file file))) + (format #t "populating /etc from ~a...~%" etc) - (let ((rm-f (lambda (f) - (false-if-exception (delete-file f))))) - (rm-f "/etc/static") - (symlink etc "/etc/static") - (for-each (lambda (file) - (let ((target (string-append "/etc/" file)) - (source (string-append "/etc/static/" file))) - (rm-f target) - ;; Things such as /etc/sudoers must be regular files, not - ;; symlinks; furthermore, they could be modified behind our - ;; back---e.g., with 'visudo'. Thus, make a copy instead of - ;; symlinking them. - (if (file-is-directory? source) - (symlink source target) - (copy-file source target)))) - (scandir etc - (lambda (file) - (not (member file '("." "..")))) + (rm-f "/etc/static") + (symlink etc "/etc/static") + (for-each (lambda (file) + (let ((target (string-append "/etc/" file)) + (source (string-append "/etc/static/" file))) + (rm-f target) - ;; The default is 'string-locale Date: Thu, 11 Sep 2014 23:39:15 +0200 Subject: [PATCH 44/44] system: Add support for Linux-style mapped devices. * gnu/system/file-systems.scm (): New record type. * gnu/system.scm ()[mapped-devices]: New field. (luks-device-mapping): New procedure. (other-file-system-services)[device-mappings, requirements]: New procedures. Pass #:requirements to 'file-system-service'. (device-mapping-services): New procedure. (essential-services): Use it. Append its result to the return value. (operating-system-initrd-file): Add comment. * gnu/services/base.scm (file-system-service): Add #:requirements parameter and honor it. (device-mapping-service): New procedure. * gnu/system/linux-initrd.scm (base-initrd): Add comment. --- gnu/services/base.scm | 24 +++++++++++-- gnu/system.scm | 67 ++++++++++++++++++++++++++++++------- gnu/system/file-systems.scm | 21 +++++++++++- gnu/system/linux-initrd.scm | 1 + 4 files changed, 97 insertions(+), 16 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index bf5af8369e..014eef053b 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -38,6 +38,7 @@ #:use-module (ice-9 format) #:export (root-file-system-service file-system-service + device-mapping-service user-processes-service host-name-service console-font-service @@ -99,18 +100,20 @@ This service must be the root of the service dependency graph so that its (define* (file-system-service device target type #:key (flags '()) (check? #t) - create-mount-point? options (title 'any)) + create-mount-point? options (title 'any) + (requirements '())) "Return a service that mounts DEVICE on TARGET as a file system TYPE with OPTIONS. TITLE is a symbol specifying what kind of name DEVICE is: 'label for a partition label, 'device for a device file name, or 'any. When CHECK? is true, check the file system before mounting it. When CREATE-MOUNT-POINT? is true, create TARGET if it does not exist yet. FLAGS is a list of symbols, -such as 'read-only' etc." +such as 'read-only' etc. Optionally, REQUIREMENTS may be a list of service +names such as device-mapping services." (with-monad %store-monad (return (service (provision (list (symbol-append 'file-system- (string->symbol target)))) - (requirement '(root-file-system)) + (requirement `(root-file-system ,@requirements)) (documentation "Check, mount, and unmount the given file system.") (start #~(lambda args (let ((device (canonicalize-device-spec #$device '#$title))) @@ -567,6 +570,21 @@ extra rules from the packages listed in @var{rules}." pid))))) (stop #~(make-kill-destructor)))))) +(define (device-mapping-service target command) + "Return a service that maps device @var{target}, a string such as +@code{\"home\"} (meaning @code{/dev/mapper/home}), by executing @var{command}, +a gexp." + (with-monad %store-monad + (return (service + (provision (list (symbol-append 'device-mapping- + (string->symbol target)))) + (requirement '(udev)) + (documentation "Map a device node using Linux's device mapper.") + (start #~(lambda () + #$command)) + (stop #~(const #f)) + (respawn? #f))))) + (define %base-services ;; Convenience variable holding the basic services. (let ((motd (text-file "motd" " diff --git a/gnu/system.scm b/gnu/system.scm index 8a3f4f6ba8..9bdf227eca 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -44,6 +44,7 @@ #:use-module (gnu system linux) #:use-module (gnu system linux-initrd) #:use-module (gnu system file-systems) + #:autoload (gnu packages cryptsetup) (cryptsetup) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) @@ -64,6 +65,7 @@ operating-system-packages operating-system-timezone operating-system-locale + operating-system-mapped-devices operating-system-file-systems operating-system-activation-script @@ -72,7 +74,9 @@ operating-system-grub.cfg %setuid-programs - %base-packages)) + %base-packages + + luks-device-mapping)) ;;; Commentary: ;;; @@ -96,6 +100,8 @@ (hosts-file operating-system-hosts-file ; M item | #f (default #f)) + (mapped-devices operating-system-mapped-devices ; list of + (default '())) (file-systems operating-system-file-systems) ; list of fs (users operating-system-users ; list of user accounts @@ -152,6 +158,13 @@ file." ;;; Services. ;;; +(define (luks-device-mapping source target) + "Return a gexp that maps SOURCE to TARGET as a LUKS device, using +'cryptsetup'." + #~(zero? (system* (string-append #$cryptsetup "/sbin/cryptsetup") + "open" "--type" "luks" + #$source #$target))) + (define (other-file-system-services os) "Return file system services for the file systems of OS that are not marked as 'needed-for-boot'." @@ -161,30 +174,58 @@ as 'needed-for-boot'." (string=? "/" (file-system-mount-point fs)))) (operating-system-file-systems os))) + (define (device-mappings fs) + (filter (lambda (md) + (string=? (string-append "/dev/mapper/" + (mapped-device-target md)) + (file-system-device fs))) + (operating-system-mapped-devices os))) + + (define (requirements fs) + (map (lambda (md) + (symbol-append 'device-mapping- + (string->symbol (mapped-device-target md)))) + (device-mappings fs))) + (sequence %store-monad - (map (match-lambda - (($ device title target type flags opts - #f check? create?) - (file-system-service device target type - #:title title - #:check? check? - #:create-mount-point? create? - #:options opts - #:flags flags))) + (map (lambda (fs) + (match fs + (($ device title target type flags opts + #f check? create?) + (file-system-service device target type + #:title title + #:requirements (requirements fs) + #:check? check? + #:create-mount-point? create? + #:options opts + #:flags flags)))) file-systems))) +(define (device-mapping-services os) + "Return the list of device-mapping services for OS as a monadic list." + (sequence %store-monad + (map (lambda (md) + (let ((source (mapped-device-source md)) + (target (mapped-device-target md)) + (command (mapped-device-command md))) + (device-mapping-service target + (command source target)))) + (operating-system-mapped-devices os)))) + (define (essential-services os) "Return the list of essential services for OS. These are special services that implement part of what's declared in OS are responsible for low-level bookkeeping." - (mlet* %store-monad ((root-fs (root-file-system-service)) + (mlet* %store-monad ((mappings (device-mapping-services os)) + (root-fs (root-file-system-service)) (other-fs (other-file-system-services os)) (procs (user-processes-service (map (compose first service-provision) other-fs))) (host-name (host-name-service (operating-system-host-name os)))) - (return (cons* host-name procs root-fs other-fs)))) + (return (cons* host-name procs root-fs + (append other-fs mappings))))) (define (operating-system-services os) "Return all the services of OS, including \"internal\" services that do not @@ -490,6 +531,8 @@ we're running in the final root." boot?)) (operating-system-file-systems os))) + ;; TODO: Pass the mapped devices required by boot-time file systems to the + ;; initrd. (mlet %store-monad ((initrd ((operating-system-initrd os) boot-file-systems))) (return #~(string-append #$initrd "/initrd")))) diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index 48c4fc7e77..90e2b0c796 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -37,7 +37,13 @@ %pseudo-terminal-file-system %devtmpfs-file-system - %base-file-systems)) + %base-file-systems + + mapped-device + mapped-device? + mapped-device-source + mapped-device-target + mapped-device-command)) ;;; Commentary: ;;; @@ -128,4 +134,17 @@ %pseudo-terminal-file-system %shared-memory-file-system)) + + +;;; +;;; Mapped devices, for Linux's device-mapper. +;;; + +(define-record-type* mapped-device + make-mapped-device + mapped-device? + (source mapped-device-source) ;string + (target mapped-device-target) ;string + (command mapped-device-command)) ;source target -> gexp + ;;; file-systems.scm ends here diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm index e83a9a5b23..93f751b757 100644 --- a/gnu/system/linux-initrd.scm +++ b/gnu/system/linux-initrd.scm @@ -131,6 +131,7 @@ initrd code." volatile-root? (extra-modules '()) guile-modules-in-chroot?) + ;; TODO: Support boot-time device mappings. "Return a monadic derivation that builds a generic initrd. FILE-SYSTEMS is a list of file-systems to be mounted by the initrd, possibly in addition to the root file system specified on the kernel command line via '--root'.