diff options
117 files changed, 2647 insertions, 823 deletions
diff --git a/Makefile.am b/Makefile.am index 6cbc6af997..aa412bda2b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,6 +75,7 @@ MODULES = \ guix/build/python-build-system.scm \ guix/build/ruby-build-system.scm \ guix/build/waf-build-system.scm \ + guix/build/haskell-build-system.scm \ guix/build/store-copy.scm \ guix/build/utils.scm \ guix/build/union.scm \ diff --git a/build-aux/hydra/gnu-system.scm b/build-aux/hydra/gnu-system.scm index f07b8589a9..01e2859f1a 100644 --- a/build-aux/hydra/gnu-system.scm +++ b/build-aux/hydra/gnu-system.scm @@ -159,7 +159,7 @@ system.") (set-guile-for-build (default-guile)) (system-disk-image installation-os #:disk-image-size - (* 800 MiB)))))) + (* 850 MiB)))))) '())) (define (tarball-jobs store system) diff --git a/doc/guix.texi b/doc/guix.texi index 07ef96627a..ad572365a8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -3365,7 +3365,7 @@ In addition, @command{guix refresh} can be passed one or more package names, as in this example: @example -guix refresh -u emacs idutils +guix refresh -u emacs idutils gcc-4.8.4 @end example @noindent @@ -4912,6 +4912,37 @@ Finally, @var{extra-options} is a list of additional command-line options passed to @command{lircd}. @end deffn +@code{(gnu services upower)} provides a power-management daemon: + +@deffn {Monadic Procedure} upower-service [#:upower @var{upower}] @ + [#:watts-up-pro? #f] @ + [#:poll-batteries? #t] @ + [#:ignore-lid? #f] @ + [#:use-percentage-for-policy? #f] @ + [#:percentage-low 10] @ + [#:percentage-critical 3] @ + [#:percentage-action 2] @ + [#:time-low 1200] @ + [#:time-critical 300] @ + [#:time-action 120] @ + [#:critical-power-action 'hybrid-sleep] +Return a service that runs @uref{http://upower.freedesktop.org/, +@command{upowerd}}, a system-wide monitor for power consumption and battery +levels, with the given configuration settings. It implements the +@code{org.freedesktop.UPower} D-Bus interface, and is notably used by +GNOME. +@end deffn + +@code{(gnu services colord)} provides a color management service: + +@deffn {Monadic Procedure} colord-service [#:colord @var{colord}] +Return a service that runs @command{colord}, a system service with a D-Bus +interface to manage the color profiles of input and output devices such as +screens and scanners. It is notably used by the GNOME Color Manager graphical +tool. See @uref{http://www.freedesktop.org/software/colord/, the colord web +site} for more information. +@end deffn + @node Setuid Programs @subsection Setuid Programs diff --git a/gnu-system.am b/gnu-system.am index c581d799d4..a3ad603ab5 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -163,7 +163,6 @@ GNU_SYSTEM_MODULES = \ gnu/packages/kde.scm \ gnu/packages/key-mon.scm \ gnu/packages/language.scm \ - gnu/packages/ld-wrapper.scm \ gnu/packages/less.scm \ gnu/packages/lesstif.scm \ gnu/packages/libcanberra.scm \ @@ -325,11 +324,13 @@ GNU_SYSTEM_MODULES = \ gnu/services.scm \ gnu/services/avahi.scm \ gnu/services/base.scm \ + gnu/services/colord.scm \ gnu/services/dbus.scm \ gnu/services/dmd.scm \ gnu/services/lirc.scm \ gnu/services/networking.scm \ gnu/services/ssh.scm \ + gnu/services/upower.scm \ gnu/services/xorg.scm \ \ gnu/system.scm \ @@ -398,8 +399,9 @@ dist_patch_DATA = \ gnu/packages/patches/cssc-gets-undeclared.patch \ gnu/packages/patches/cssc-missing-include.patch \ gnu/packages/patches/clucene-contribs-lib.patch \ - gnu/packages/patches/curl-gss-api-fix.patch \ gnu/packages/patches/cursynth-wave-rand.patch \ + gnu/packages/patches/curl-support-capath-on-gnutls.patch \ + gnu/packages/patches/curl-support-capath-on-gnutls-conf.patch \ gnu/packages/patches/dbus-localstatedir.patch \ gnu/packages/patches/diffutils-gets-undeclared.patch \ gnu/packages/patches/dfu-programmer-fix-libusb.patch \ @@ -407,13 +409,17 @@ dist_patch_DATA = \ gnu/packages/patches/doxygen-tmake.patch \ gnu/packages/patches/duplicity-piped-password.patch \ gnu/packages/patches/duplicity-test_selection-tmp.patch \ + gnu/packages/patches/elfutils-tests-ptrace.patch \ gnu/packages/patches/emacs-exec-path.patch \ gnu/packages/patches/eudev-rules-directory.patch \ gnu/packages/patches/findutils-absolute-paths.patch \ gnu/packages/patches/flashrom-use-libftdi1.patch \ gnu/packages/patches/flex-bison-tests.patch \ gnu/packages/patches/gawk-shell.patch \ + gnu/packages/patches/gcc-arm-link-spec-fix.patch \ gnu/packages/patches/gcc-cross-environment-variables.patch \ + gnu/packages/patches/geoclue-config.patch \ + gnu/packages/patches/ghostscript-runpath.patch \ gnu/packages/patches/glib-tests-desktop.patch \ gnu/packages/patches/glib-tests-homedir.patch \ gnu/packages/patches/glib-tests-prlimit.patch \ @@ -423,6 +429,7 @@ dist_patch_DATA = \ gnu/packages/patches/glibc-ldd-x86_64.patch \ gnu/packages/patches/glibc-locales.patch \ gnu/packages/patches/gmp-arm-asm-nothumb.patch \ + gnu/packages/patches/gnutls-fix-duplicate-manpages.patch \ gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch \ gnu/packages/patches/gobject-introspection-cc.patch \ gnu/packages/patches/gobject-introspection-girepository.patch \ @@ -454,6 +461,7 @@ dist_patch_DATA = \ gnu/packages/patches/libmad-mips-newgcc.patch \ gnu/packages/patches/libtheora-config-guess.patch \ gnu/packages/patches/libtool-skip-tests.patch \ + gnu/packages/patches/libtool-skip-tests2.patch \ gnu/packages/patches/libssh-CVE-2014-0017.patch \ gnu/packages/patches/libvpx-fix-armhf-link.patch \ gnu/packages/patches/libvpx-fix-ssse3-quantize.patch \ @@ -485,6 +493,7 @@ dist_patch_DATA = \ gnu/packages/patches/nvi-dbpagesize-binpower.patch \ gnu/packages/patches/nvi-db4.patch \ gnu/packages/patches/openexr-missing-samples.patch \ + gnu/packages/patches/openssl-runpath.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 \ @@ -511,7 +520,9 @@ dist_patch_DATA = \ gnu/packages/patches/python2-rdflib-drop-sparqlwrapper.patch \ gnu/packages/patches/python2-sqlite-3.8.4-test-fix.patch \ gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \ + gnu/packages/patches/qt4-ldflags.patch \ gnu/packages/patches/qt4-tests.patch \ + gnu/packages/patches/qt5-runpath.patch \ gnu/packages/patches/ratpoison-shell.patch \ gnu/packages/patches/readline-link-ncurses.patch \ gnu/packages/patches/ripperx-libm.patch \ @@ -532,6 +543,7 @@ dist_patch_DATA = \ gnu/packages/patches/unzip-CVE-2014-8140.patch \ gnu/packages/patches/unzip-CVE-2014-8141.patch \ gnu/packages/patches/util-linux-tests.patch \ + gnu/packages/patches/upower-builddir.patch \ gnu/packages/patches/valgrind-glibc-2.21.patch \ gnu/packages/patches/vpnc-script.patch \ gnu/packages/patches/vtk-mesa-10.patch \ @@ -562,6 +574,10 @@ dist_patch_DATA = \ gnu/packages/patches/xmodmap-asprintf.patch \ gnu/packages/patches/zathura-plugindir-environment-variable.patch +MISC_DISTRO_FILES = \ + gnu/packages/ld-wrapper.in \ + gnu/packages/ld-wrapper2.in + bootstrapdir = $(guilemoduledir)/gnu/packages/bootstrap bootstrap_x86_64_linuxdir = $(bootstrapdir)/x86_64-linux bootstrap_i686_linuxdir = $(bootstrapdir)/i686-linux diff --git a/gnu/packages.scm b/gnu/packages.scm index 13f2d9c803..6ef0fb6de7 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -160,9 +160,15 @@ Optionally, narrow the search to SUB-DIRECTORY." (string-length directory)) (filter-map (lambda (file) - (let ((file (substring file prefix-len))) - (false-if-exception - (resolve-interface (file-name->module-name file))))) + (let* ((file (substring file prefix-len)) + (module (file-name->module-name file))) + (catch #t + (lambda () + (resolve-interface module)) + (lambda args + ;; Report the error, but keep going. + (warn-about-load-error module args) + #f)))) (scheme-files (if sub-directory (string-append directory "/" sub-directory) directory)))) diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm index 4b5cbb6dfd..bc2b20ed46 100644 --- a/gnu/packages/autotools.scm +++ b/gnu/packages/autotools.scm @@ -248,7 +248,7 @@ Makefile, simplifying the entire process for the developer.") (base32 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw")) (patches - (list (search-patch "libtool-skip-tests.patch"))))) + (list (search-patch "libtool-skip-tests2.patch"))))) (build-system gnu-build-system) (propagated-inputs `(("m4" ,m4))) (native-inputs `(("m4" ,m4) @@ -304,6 +304,9 @@ complexity of working with shared libraries across platforms.") (sha256 (base32 "0vxj52zm709125gwv9qqlw02silj8bnjnh4y07arrz60r31ai1vw")) + + ;; FIXME: We don't need this patch here, we just keep it to + ;; avoid a rebuild today. (patches (list (search-patch "libtool-skip-tests.patch"))))) (build-system gnu-build-system) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index ac059870e2..361436157d 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -151,14 +151,14 @@ standard utility.") (define-public patch (package (name "patch") - (version "2.7.4") + (version "2.7.5") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/patch/patch-" version ".tar.xz")) (sha256 (base32 - "02gikxjvcxysr4l65c8vivgz62xmalp0av5ypzff8vqhrq3vpb0f")))) + "16d2r9kpivaak948mxzc0bai45mqfw73m113wrkmbffnalv1b5gx")))) (build-system gnu-build-system) (native-inputs `(("ed", ed))) (synopsis "Apply differences to originals, with optional backups") @@ -358,6 +358,72 @@ included.") (license gpl3+) (home-page "http://www.gnu.org/software/binutils/"))) +(define* (make-ld-wrapper name #:key binutils + (guile (canonical-package guile-2.0)) + (bash (canonical-package bash)) target + (guile-for-build guile)) + "Return a package called NAME that contains a wrapper for the 'ld' program +of BINUTILS, which adds '-rpath' flags to the actual 'ld' command line. When +TARGET is not #f, make a wrapper for the cross-linker for TARGET, called +'TARGET-ld'. The wrapper uses GUILE and BASH." + (package + (name name) + (version "0") + (source #f) + (build-system trivial-build-system) + (inputs `(("binutils" ,binutils) + ("guile" ,guile) + ("bash" ,bash) + ("wrapper" ,(search-path %load-path + "gnu/packages/ld-wrapper.in")))) + (arguments + `(#:guile ,guile-for-build + #:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils) + (system base compile)) + + (let* ((out (assoc-ref %outputs "out")) + (bin (string-append out "/bin")) + (ld ,(if target + `(string-append bin "/" ,target "-ld") + '(string-append bin "/ld"))) + (go (string-append ld ".go"))) + + (setvbuf (current-output-port) _IOLBF) + (format #t "building ~s/bin/ld wrapper in ~s~%" + (assoc-ref %build-inputs "binutils") + out) + + (mkdir-p bin) + (copy-file (assoc-ref %build-inputs "wrapper") ld) + (substitute* ld + (("@SELF@") + ld) + (("@GUILE@") + (string-append (assoc-ref %build-inputs "guile") + "/bin/guile")) + (("@BASH@") + (string-append (assoc-ref %build-inputs "bash") + "/bin/bash")) + (("@LD@") + (string-append (assoc-ref %build-inputs "binutils") + ,(if target + (string-append "/bin/" + target "-ld") + "/bin/ld")))) + (chmod ld #o555) + (compile-file ld #:output-file go))))) + (synopsis "The linker wrapper") + (description + "The linker wrapper (or 'ld-wrapper') wraps the linker to add any +missing '-rpath' flags, and to detect any misuse of libraries outside of the +store.") + (home-page "http://www.gnu.org/software/guix/") + (license gpl3+))) + +(export make-ld-wrapper) + (define-public glibc (package (name "glibc") @@ -393,6 +459,12 @@ included.") ;; <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00709.html>. #:parallel-build? #f + ;; The libraries have an empty RUNPATH, but some, such as the versioned + ;; libraries (libdl-2.21.so, etc.) have ld.so marked as NEEDED. Since + ;; these libraries are always going to be found anyway, just skip + ;; RUNPATH checks. + #:validate-runpath? #f + #:configure-flags (list "--enable-add-ons" "--sysconfdir=/etc" @@ -431,7 +503,8 @@ included.") #:tests? #f ; XXX #:phases (alist-cons-before 'configure 'pre-configure - (lambda* (#:key inputs outputs #:allow-other-keys) + (lambda* (#:key inputs native-inputs outputs + #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin"))) ;; Use `pwd', not `/bin/pwd'. @@ -455,8 +528,13 @@ included.") ;; Copy a statically-linked Bash in the output, with ;; no references to other store paths. + ;; FIXME: Normally we would look it up only in INPUTS but + ;; cross-base uses it as a native input. (mkdir-p bin) - (copy-file (string-append (assoc-ref inputs "static-bash") + (copy-file (string-append (or (assoc-ref inputs + "static-bash") + (assoc-ref native-inputs + "static-bash")) "/bin/bash") (string-append bin "/bash")) (remove-store-references (string-append bin "/bash")) @@ -611,7 +689,7 @@ command.") (define-public tzdata (package (name "tzdata") - (version "2014j") + (version "2015b") (source (origin (method url-fetch) (uri (string-append @@ -619,7 +697,7 @@ command.") version ".tar.gz")) (sha256 (base32 - "038fvj6zf51k6z9sbbxbj87ajaf69l3whal2vwshbm4l0qr71n52")))) + "0qmdr1yqqn94b5a54axwszfzimyxg27i6xsfmp0sswd3nfjw2sjm")))) (build-system gnu-build-system) (arguments '(#:tests? #f @@ -666,7 +744,7 @@ command.") version ".tar.gz")) (sha256 (base32 - "1qpd12imy7q5hb5fhk48mfw65s0xlrkmms0zr2gk0mj88qjn3m3z")))))) + "0xjxlgzva13y8qi3vfbb3nq5pii8ax9wi4yc7vj9134rbciz2s76")))))) (home-page "http://www.iana.org/time-zones") (synopsis "Database of current and historical time zones") (description "The Time Zone Database (often called tz or zoneinfo) diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm index 361eb475d6..02cb45c955 100644 --- a/gnu/packages/bash.scm +++ b/gnu/packages/bash.scm @@ -128,6 +128,26 @@ number/base32-hash tuples, directly usable in the 'patch-series' form." (let ((out (assoc-ref outputs "out"))) (with-directory-excursion (string-append out "/bin") (symlink "bash" "sh"))))) + (install-headers-phase + '(lambda* (#:key outputs #:allow-other-keys) + ;; Install Bash headers so that packages that provide extensions + ;; can use them. We install them in include/bash; that's what + ;; Debian does and what Bash extensions like recutils or + ;; guile-bash expect. + (let ((include (string-append (assoc-ref outputs "include") + "/include/bash")) + (headers "^\\./(builtins/|lib/glob/|lib/tilde/|)[^/]+\\.h$")) + (mkdir-p include) + (for-each (lambda (file) + (when ((@ (ice-9 regex) string-match) headers file) + (let ((directory (string-append include "/" + (dirname file)))) + (mkdir-p directory) + (copy-file file + (string-append directory "/" + (basename file)))))) + (find-files "." "\\.h$")) + #t))) (version "4.3")) (package (name "bash") @@ -148,6 +168,9 @@ number/base32-hash tuples, directly usable in the 'patch-series' form." (version (string-append version "." (number->string (length %patch-series-4.3)))) (build-system gnu-build-system) + + (outputs '("out" + "include")) ;headers used by extensions (native-inputs `(("bison" ,bison))) ;to rebuild the parser (inputs `(("readline" ,readline) ("ncurses" ,ncurses))) ;TODO: add texinfo @@ -169,9 +192,10 @@ number/base32-hash tuples, directly usable in the 'patch-series' form." ;; for now. #:tests? #f - #:phases (alist-cons-after 'install 'post-install - ,post-install-phase - %standard-phases))) + #:phases (modify-phases %standard-phases + (add-after 'install 'post-install ,post-install-phase) + (add-after 'install 'install-headers + ,install-headers-phase)))) (synopsis "The GNU Bourne-Again SHell") (description "Bash is the shell, or command-line interpreter, of the GNU system. It diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm index 24fc53d0b8..10c88f3f2a 100644 --- a/gnu/packages/boost.scm +++ b/gnu/packages/boost.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2014 John Darrington <jmd@gnu.org> ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> +;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -51,6 +52,11 @@ (arguments (let ((build-flags `("threading=multi" "link=shared" + + ;; Set the RUNPATH to $libdir so that the libs find each other. + (string-append "linkflags=-Wl,-rpath=" + (assoc-ref outputs "out") "/lib") + ;; Boost's 'context' library is not yet supported on mips64, so ;; we disable it. The 'coroutine' library depends on 'context', ;; so we disable that too. @@ -58,7 +64,8 @@ (%current-system))) '("--without-context" "--without-coroutine") '())))) - `(#:phases + `(#:tests? #f + #:phases (alist-replace 'configure (lambda* (#:key outputs #:allow-other-keys) @@ -79,18 +86,14 @@ "--with-toolset=gcc")))) (alist-replace 'build - (lambda _ + (lambda* (#:key outputs #:allow-other-keys) (zero? (system* "./b2" ,@build-flags))) (alist-replace - 'check - (lambda _ #t) - - (alist-replace - 'install - (lambda _ - (zero? (system* "./b2" "install" ,@build-flags))) - %standard-phases))))))) + 'install + (lambda* (#:key outputs #:allow-other-keys) + (zero? (system* "./b2" "install" ,@build-flags))) + %standard-phases)))))) (home-page "http://boost.org") (synopsis "Peer-reviewed portable C++ source libraries") diff --git a/gnu/packages/bootstrap/i686-linux/bash b/gnu/packages/bootstrap/i686-linux/bash Binary files differindex 9882d4adc7..4b99d7eb4a 100755 --- a/gnu/packages/bootstrap/i686-linux/bash +++ b/gnu/packages/bootstrap/i686-linux/bash diff --git a/gnu/packages/bootstrap/i686-linux/mkdir b/gnu/packages/bootstrap/i686-linux/mkdir Binary files differindex 0ddab232b7..6623a38404 100755 --- a/gnu/packages/bootstrap/i686-linux/mkdir +++ b/gnu/packages/bootstrap/i686-linux/mkdir diff --git a/gnu/packages/bootstrap/i686-linux/tar b/gnu/packages/bootstrap/i686-linux/tar Binary files differindex 6bee702cf5..d33cd391f1 100755 --- a/gnu/packages/bootstrap/i686-linux/tar +++ b/gnu/packages/bootstrap/i686-linux/tar diff --git a/gnu/packages/bootstrap/i686-linux/xz b/gnu/packages/bootstrap/i686-linux/xz Binary files differindex 5a126e4fc5..f94dbde77c 100755 --- a/gnu/packages/bootstrap/i686-linux/xz +++ b/gnu/packages/bootstrap/i686-linux/xz diff --git a/gnu/packages/bootstrap/x86_64-linux/bash b/gnu/packages/bootstrap/x86_64-linux/bash Binary files differindex 3b0227fbb1..b9c410b7cf 100755 --- a/gnu/packages/bootstrap/x86_64-linux/bash +++ b/gnu/packages/bootstrap/x86_64-linux/bash diff --git a/gnu/packages/bootstrap/x86_64-linux/mkdir b/gnu/packages/bootstrap/x86_64-linux/mkdir Binary files differindex 7207ad8a46..f8250ae693 100755 --- a/gnu/packages/bootstrap/x86_64-linux/mkdir +++ b/gnu/packages/bootstrap/x86_64-linux/mkdir diff --git a/gnu/packages/bootstrap/x86_64-linux/tar b/gnu/packages/bootstrap/x86_64-linux/tar Binary files differindex 9104da7b53..90e492f89d 100755 --- a/gnu/packages/bootstrap/x86_64-linux/tar +++ b/gnu/packages/bootstrap/x86_64-linux/tar diff --git a/gnu/packages/bootstrap/x86_64-linux/xz b/gnu/packages/bootstrap/x86_64-linux/xz Binary files differindex 488e319b37..6bfe3c6d96 100755 --- a/gnu/packages/bootstrap/x86_64-linux/xz +++ b/gnu/packages/bootstrap/x86_64-linux/xz diff --git a/gnu/packages/cdrom.scm b/gnu/packages/cdrom.scm index 9af0ea7b09..3383fb653d 100644 --- a/gnu/packages/cdrom.scm +++ b/gnu/packages/cdrom.scm @@ -159,30 +159,17 @@ files.") (sha256 (base32 "1pv4zrajm46za0f6lv162iqffih57a8ly4pc69f7y0gfyigb8p80")) - (patches (list (search-patch "cdparanoia-fpic.patch"))))) + (patches (list (search-patch "cdparanoia-fpic.patch"))) + (modules '((guix build utils))) + (snippet + ;; Make libraries respect LDFLAGS. + '(substitute* '("paranoia/Makefile.in" "interface/Makefile.in") + (("-Wl,-soname") "$(LDFLAGS) -Wl,-soname"))))) (build-system gnu-build-system) - (inputs - `(("patchelf" ,patchelf))) (arguments `(#:tests? #f ; there is no check target - #:modules ((guix build gnu-build-system) - (guix build utils) - (guix build rpath) - (srfi srfi-26)) - #:imported-modules ((guix build gnu-build-system) - (guix build utils) - (guix build rpath)) - #:phases - (alist-cons-after - 'strip 'add-lib-to-runpath - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib"))) - ;; Add LIB to the RUNPATH of all the executables. - (with-directory-excursion out - (for-each (cut augment-rpath <> lib) - (find-files "bin" ".*"))))) - %standard-phases))) + #:configure-flags ; Add $libdir to the RUNPATH of all the executables. + (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")))) (home-page "http://www.xiph.org/paranoia/") (synopsis "Audio CD reading utility") (description "Cdparanoia retrieves audio tracks from CDDA capable CDROM diff --git a/gnu/packages/certs.scm b/gnu/packages/certs.scm index db89466328..947d2b53f1 100644 --- a/gnu/packages/certs.scm +++ b/gnu/packages/certs.scm @@ -85,8 +85,6 @@ (rnrs io ports) (srfi srfi-26) (ice-9 regex)) - #:imported-modules ((guix build gnu-build-system) - (guix build utils)) #:phases (alist-cons-after 'unpack 'install diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm index ed9ba0e31f..9d2bde829d 100644 --- a/gnu/packages/code.scm +++ b/gnu/packages/code.scm @@ -142,8 +142,8 @@ a large, deeply nested project.") (build-system gnu-build-system) (arguments '(#:phases (modify-phases %standard-phases - (delete configure) - (add-before build make-dotl-files-older + (delete 'configure) + (add-before 'build 'make-dotl-files-older (lambda _ ;; Make the '.l' files as old as the '.c' ;; files to avoid triggering the rule that @@ -155,7 +155,7 @@ a large, deeply nested project.") (set-file-time file ref)) (find-files "." "\\.[chl]$")) #t)) - (add-before install make-target-directories + (add-before 'install 'make-target-directories (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (mkdir-p (string-append out "/bin")) @@ -163,7 +163,7 @@ a large, deeply nested project.") "/share/man/man1")) (mkdir-p (string-append out "/share/doc"))))) - (replace check + (replace 'check (lambda _ (setenv "HOME" (getcwd)) (setenv "PATH" diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 11d370905c..22da2e0fb3 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -157,6 +157,8 @@ (srfi srfi-1) (srfi srfi-26)) ,@(substitute-keyword-arguments (package-arguments gcc-4.8) + ((#:validate-runpath? _) + #t) ((#:configure-flags flags) `(append (list ,(string-append "--target=" (boot-triplet)) @@ -523,6 +525,11 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" "/lib") flag)) ,flags))) + ((#:validate-runpath? _) + ;; Things like libasan.so and libstdc++.so NEED ld.so and/or + ;; libgcc_s.so but RUNPATH is empty. This is a false positive, so + ;; turn it off. + #f) ((#:phases phases) `(alist-delete 'symlink-libgcc_eh ,phases))))) @@ -539,54 +546,10 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" (define ld-wrapper-boot3 ;; A linker wrapper that uses the bootstrap Guile. - (package - (name "ld-wrapper-boot3") - (version "0") - (source #f) - (build-system trivial-build-system) - (inputs `(("binutils" ,binutils-final) - ("guile" ,%bootstrap-guile) - ("bash" ,@(assoc-ref %boot2-inputs "bash")) - ("wrapper" ,(search-path %load-path - "gnu/packages/ld-wrapper.scm")))) - (arguments - `(#:guile ,%bootstrap-guile - #:modules ((guix build utils)) - #:builder (begin - (use-modules (guix build utils) - (system base compile)) - - (let* ((out (assoc-ref %outputs "out")) - (bin (string-append out "/bin")) - (ld (string-append bin "/ld")) - (go (string-append bin "/ld.go"))) - - (setvbuf (current-output-port) _IOLBF) - (format #t "building ~s/bin/ld wrapper in ~s~%" - (assoc-ref %build-inputs "binutils") - out) - - (mkdir-p bin) - (copy-file (assoc-ref %build-inputs "wrapper") ld) - (substitute* ld - (("@GUILE@") - (string-append (assoc-ref %build-inputs "guile") - "/bin/guile")) - (("@BASH@") - (string-append (assoc-ref %build-inputs "bash") - "/bin/bash")) - (("@LD@") - (string-append (assoc-ref %build-inputs "binutils") - "/bin/ld"))) - (chmod ld #o555) - (compile-file ld #:output-file go))))) - (synopsis "The linker wrapper") - (description - "The linker wrapper (or `ld-wrapper') wraps the linker to add any -missing `-rpath' flags, and to detect any misuse of libraries outside of the -store.") - (home-page #f) - (license gpl3+))) + (make-ld-wrapper "ld-wrapper-boot3" + #:binutils binutils-final + #:guile %bootstrap-guile + #:bash (car (assoc-ref %boot2-inputs "bash")))) (define %boot3-inputs ;; 4th stage inputs. @@ -615,7 +578,7 @@ store.") (current-source-location) #:guile %bootstrap-guile))) -(define glibc-utf8-locales-final +(define-public glibc-utf8-locales-final ;; Now that we have GUILE-FINAL, build the UTF-8 locales. They are needed ;; by the build processes afterwards so their 'scm_to_locale_string' works ;; with the full range of Unicode codepoints (remember @@ -745,6 +708,19 @@ COREUTILS-FINAL vs. COREUTILS, etc." ;;; GCC toolchain. ;;; +(define (fixed-ld-wrapper) + ;; FIXME: In this cycle, a bug was introduced in ld-wrapper: it would + ;; incorrectly flag ~/.guix-profile/lib/libfoo.so as "impure", due to a bug + ;; in its symlink resolution code. To work around that while avoiding a + ;; full rebuild, use an ld-wrapper with the bug-fix for 'gcc-toolchain'. + (let ((orig (car (assoc-ref %final-inputs "ld-wrapper")))) + (package + (inherit orig) + (location (source-properties->location (current-source-location))) + (inputs `(("wrapper" ,(search-path %load-path + "gnu/packages/ld-wrapper2.in")) + ,@(package-inputs orig)))))) + (define (gcc-toolchain gcc) "Return a complete toolchain for GCC." (package @@ -783,7 +759,7 @@ and binaries, plus debugging symbols in the 'debug' output), and Binutils.") ;; install everything that we need, and (2) to make sure ld-wrapper comes ;; before Binutils' ld in the user's profile. (inputs `(("gcc" ,gcc) - ("ld-wrapper" ,(car (assoc-ref %final-inputs "ld-wrapper"))) + ("ld-wrapper" ,(fixed-ld-wrapper)) ("binutils" ,binutils-final) ("libc" ,glibc-final) ("libc-debug" ,glibc-final "debug"))))) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 5a67d4b6ac..01cfdf73e8 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -130,12 +130,16 @@ may be either a libc package or #f.)" ,target)) (binutils (string-append (assoc-ref inputs "binutils-cross") - "/bin/" ,target "-"))) + "/bin/" ,target "-")) + (wrapper (string-append + (assoc-ref inputs "ld-wrapper-cross") + "/bin/" ,target "-ld"))) (for-each (lambda (file) (symlink (string-append binutils file) (string-append libexec "/" file))) - '("as" "ld" "nm")) + '("as" "nm")) + (symlink wrapper (string-append libexec "/ld")) #t)) ,phases))) (if libc @@ -171,6 +175,8 @@ may be either a libc package or #f.)" #t))) ,phases) phases))) + ((#:validate-runpath? _) + #t) ((#:strip-binaries? _) ;; Disable stripping as this can break binaries, with object files of ;; libgcc.a showing up as having an unknown architecture. See @@ -196,8 +202,10 @@ GCC that does not target a libc; otherwise, target that libc." target)) (source (origin (inherit (package-source gcc-4.8)) (patches - (cons (search-patch "gcc-cross-environment-variables.patch") - (cross-gcc-patches target))))) + (append + (origin-patches (package-source gcc-4.8)) + (cons (search-patch "gcc-cross-environment-variables.patch") + (cross-gcc-patches target)))))) ;; For simplicity, use a single output. Otherwise libgcc_s & co. are not ;; found by default, etc. @@ -214,7 +222,11 @@ GCC that does not target a libc; otherwise, target that libc." ,@(cross-gcc-arguments target libc))) (native-inputs - `(("binutils-cross" ,xbinutils) + `(("ld-wrapper-cross" ,(make-ld-wrapper + (string-append "ld-wrapper-" target) + #:target target + #:binutils xbinutils)) + ("binutils-cross" ,xbinutils) ;; Call it differently so that the builder can check whether the "libc" ;; input is #f. @@ -298,8 +310,13 @@ XBINUTILS and the cross tool chain." ;; "linux-headers" input to point to the right thing. (propagated-inputs `(("linux-headers" ,xlinux-headers))) + ;; FIXME: 'static-bash' should really be an input, not a native input, but + ;; to do that will require building an intermediate cross libc. + (inputs '()) + (native-inputs `(("cross-gcc" ,xgcc) ("cross-binutils" ,xbinutils) + ,@(package-inputs glibc) ;FIXME: static-bash ,@(package-native-inputs glibc))))) diff --git a/gnu/packages/curl.scm b/gnu/packages/curl.scm index 821a957615..526514b815 100644 --- a/gnu/packages/curl.scm +++ b/gnu/packages/curl.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> +;;; Copyright © 2015 Tomáš Čech <sleep_walker@suse.cz> ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,15 +38,17 @@ (define-public curl (package (name "curl") - (version "7.40.0") + (version "7.41.0") (source (origin (method url-fetch) (uri (string-append "http://curl.haxx.se/download/curl-" version ".tar.lzma")) (sha256 (base32 - "1a15fdc26b3vwwmchzzpd3l1hfyhx06dn7b6lkikqd7kgwvg5ps7")) - (patches (list (search-patch "curl-gss-api-fix.patch"))))) + "08n7vrhdfzziy3a7n93r7qjhzk8p26q464hxg8w9irdk3v60pi62")) + (patches + (list (search-patch "curl-support-capath-on-gnutls.patch") + (search-patch "curl-support-capath-on-gnutls-conf.patch"))))) (build-system gnu-build-system) (inputs `(("gnutls" ,gnutls) ("gss" ,gss) @@ -68,6 +71,10 @@ (lambda _ (substitute* "tests/runtests.pl" (("/bin/sh") (which "sh"))) + ;; Test #1135 requires extern-scan.pl, which is not part of the + ;; tarball due to a mistake. It has been fixed upstream. We can + ;; simply disable the test as it is specific to VMS and OS/400. + (delete-file "tests/data/test1135") ;; The top-level "make check" does "make -C tests quiet-test", which ;; is too quiet. Use the "test" target instead, which is more diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index ee97977777..6498091aaf 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -238,9 +238,12 @@ types are supported, as is encryption.") "04dl53iv5q0srv4jcgjfzsrdzkq6dg1sgmlmpw9lrd4xrmj6jmvl")))) (build-system gnu-build-system) (inputs `(("readline" ,readline))) - ;; Add -DSQLITE_SECURE_DELETE. GNU Icecat will refuse to use the system - ;; SQLite unless this option is enabled. - (arguments `(#:configure-flags '("CFLAGS=-O2 -DSQLITE_SECURE_DELETE"))) + (arguments + `(#:configure-flags + ;; Add -DSQLITE_SECURE_DELETE and -DSQLITE_ENABLE_UNLOCK_NOTIFY to + ;; CFLAGS. GNU Icecat will refuse to use the system SQLite unless these + ;; options are enabled. + '("CFLAGS=-O2 -DSQLITE_SECURE_DELETE -DSQLITE_ENABLE_UNLOCK_NOTIFY"))) (home-page "http://www.sqlite.org/") (synopsis "The SQLite database management system") (description diff --git a/gnu/packages/ed.scm b/gnu/packages/ed.scm index c2b19292f0..0d2b24cf8d 100644 --- a/gnu/packages/ed.scm +++ b/gnu/packages/ed.scm @@ -27,14 +27,14 @@ (define-public ed (package (name "ed") - (version "1.10") + (version "1.11") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/ed/ed-" version ".tar.lz")) (sha256 (base32 - "16kycdm5fcvpdr41hxb2da8da6jzs9dqznsg5552z6rh28n0jh4m")))) + "0d518yhs3kpdpv9fbpa1rhxk2fbry2yzcknrdaa20pi2bzg6w55x")))) (build-system gnu-build-system) (native-inputs `(("lzip" ,lzip))) (arguments diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm index 540478c075..cb456af195 100644 --- a/gnu/packages/elf.scm +++ b/gnu/packages/elf.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> ;;; @@ -38,7 +38,9 @@ version "/elfutils-" version ".tar.bz2")) (sha256 (base32 - "0w50szymyqvx8g0vkwrvnv17grqxva6x1z9dm9m3i99zg2hr232p")))) + "0w50szymyqvx8g0vkwrvnv17grqxva6x1z9dm9m3i99zg2hr232p")) + (patches + (list (search-patch "elfutils-tests-ptrace.patch"))))) (build-system gnu-build-system) ;; Separate programs because that's usually not what elfutils users want, @@ -46,6 +48,13 @@ (outputs '("out" ; libelf.so, elfutils/*.h, etc. "bin")) ; ld, nm, objdump, etc. + (arguments + ;; Programs don't have libelf.so in their RUNPATH and libraries don't + ;; know where to find each other. + `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath=" + (assoc-ref %outputs "out") + "/lib")))) + (native-inputs `(("m4" ,m4))) (inputs `(("zlib" ,zlib))) (home-page "https://fedorahosted.org/elfutils/") diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index c7f91843bd..8d3df368b1 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -250,8 +250,7 @@ when typing parentheses directly or commenting out code line by line.") `(#:modules ((guix build gnu-build-system) (guix build utils) (guix build emacs-utils)) - #:imported-modules ((guix build gnu-build-system) - (guix build utils) + #:imported-modules (,@%gnu-build-system-modules (guix build emacs-utils)) #:tests? #f ; no check target #:phases @@ -308,11 +307,10 @@ operations.") ("imagemagick" ,imagemagick) ("emacs" ,emacs-no-x))) (arguments - '(#:modules ((guix build gnu-build-system) + `(#:modules ((guix build gnu-build-system) (guix build utils) (guix build emacs-utils)) - #:imported-modules ((guix build gnu-build-system) - (guix build utils) + #:imported-modules (,@%gnu-build-system-modules (guix build emacs-utils)) #:configure-flags (let ((out (assoc-ref %outputs "out"))) @@ -376,11 +374,10 @@ operations.") (inputs `(("wget" ,wget) ("emacs" ,emacs-no-x))) (arguments - '(#:modules ((guix build gnu-build-system) + `(#:modules ((guix build gnu-build-system) (guix build utils) (guix build emacs-utils)) - #:imported-modules ((guix build gnu-build-system) - (guix build utils) + #:imported-modules (,@%gnu-build-system-modules (guix build emacs-utils)) #:tests? #f ; no check target #:phases @@ -444,11 +441,10 @@ operations.") (string-append "all: " rest " emms-print-metadata\n")))))) (build-system gnu-build-system) (arguments - '(#:modules ((guix build gnu-build-system) + `(#:modules ((guix build gnu-build-system) (guix build utils) (guix build emacs-utils)) - #:imported-modules ((guix build gnu-build-system) - (guix build utils) + #:imported-modules (,@%gnu-build-system-modules (guix build emacs-utils)) #:phases (alist-replace diff --git a/gnu/packages/fltk.scm b/gnu/packages/fltk.scm index 6aee41d31f..1ac1f2507e 100644 --- a/gnu/packages/fltk.scm +++ b/gnu/packages/fltk.scm @@ -27,7 +27,7 @@ (define-public fltk (package (name "fltk") - (version "1.3.2") + (version "1.3.3") (source (origin (method url-fetch) @@ -35,14 +35,16 @@ "/fltk-" version "-source.tar.gz")) (sha256 (base32 - "1974brlk723095vf8z72kazq1cbqr9a51kq6b0xda6zkjkgl8q0p")))) + "15qd7lkz5d5ynz70xhxhigpz3wns39v9xcf7ggkl0792syc8sfgq")))) (build-system gnu-build-system) (inputs `(("libx11" ,libx11) ("mesa" ,mesa))) (arguments `(#:tests? #f ;TODO: compile programs in "test" dir - #:configure-flags '("--enable-shared") + #:configure-flags + (list "--enable-shared" + (string-append "DSOFLAGS=-Wl,-rpath=" %output "/lib")) #:phases (alist-cons-before 'configure 'patch-makeinclude diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 27e40f2f66..2a3749fb5c 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -85,6 +85,14 @@ where the OS part is overloaded to denote a specific ABI---into GCC '("CC" "CXX" "LD" "AR" "NM" "RANLIB" "STRIP") '("gcc" "g++" "ld" "ar" "nm" "ranlib" "strip")) '())))) + (libdir + (let ((base '(or (assoc-ref outputs "lib") + (assoc-ref outputs "out")))) + (lambda () + ;; Return the directory that contains lib/libgcc_s.so et al. + (if (%current-target-system) + `(string-append ,base "/" ,(%current-target-system)) + base)))) (configure-flags (lambda () ;; This is terrible. Since we have two levels of quasiquotation, @@ -181,12 +189,16 @@ where the OS part is overloaded to denote a specific ABI---into GCC ,(if stripped? "-g0" "-g"))))) #:tests? #f + + ;; libstdc++.so NEEDs libgcc_s.so but somehow it doesn't get + ;; $(libdir) in its RUNPATH, so turn it off. + #:validate-runpath? #f + #:phases (alist-cons-before 'configure 'pre-configure (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((libdir (or (assoc-ref outputs "lib") - (assoc-ref outputs "out"))) + (let ((libdir ,(libdir)) (libc (assoc-ref inputs "libc"))) (when libc ;; The following is not performed for `--without-headers' @@ -297,7 +309,8 @@ Go. It also includes runtime support libraries for these languages.") version "/gcc-" version ".tar.bz2")) (sha256 (base32 - "15c6gwm6dzsaagamxkak5smdkf1rdfbqqjs9jdbrp3lbg4ism02a")))))) + "15c6gwm6dzsaagamxkak5smdkf1rdfbqqjs9jdbrp3lbg4ism02a")) + (patches (list (search-patch "gcc-arm-link-spec-fix.patch"))))))) (define-public gcc-4.9 (package (inherit gcc-4.7) @@ -308,7 +321,8 @@ Go. It also includes runtime support libraries for these languages.") version "/gcc-" version ".tar.bz2")) (sha256 (base32 - "1pbjp4blk2ycaa6r3jmw4ky5f1s9ji3klbqgv8zs2sl5jn1cj810")))))) + "1pbjp4blk2ycaa6r3jmw4ky5f1s9ji3klbqgv8zs2sl5jn1cj810")) + (patches (list (search-patch "gcc-arm-link-spec-fix.patch"))))))) (define* (custom-gcc gcc name languages #:key (separate-lib-output? #t)) "Return a custom version of GCC that supports LANGUAGES." diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm index 27b5fb5f55..3a96cd613c 100644 --- a/gnu/packages/gettext.scm +++ b/gnu/packages/gettext.scm @@ -70,7 +70,15 @@ (substitute* "gettext-tools/src/project-id" (("/bin/pwd") "pwd"))))) - %standard-phases) + (alist-cons-before + 'configure 'link-expat + (lambda _ + ;; Gettext defaults to opening expat via dlopen on + ;; "Linux". Change to link directly. + (substitute* "gettext-tools/configure" + (("LIBEXPAT=\"-ldl\"") "LIBEXPAT=\"-ldl -lexpat\"") + (("LTLIBEXPAT=\"-ldl\"") "LTLIBEXPAT=\"-ldl -lexpat\""))) + %standard-phases)) ;; When tests fail, we want to know the details. #:make-flags '("VERBOSE=yes"))) diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm index c63e0415b4..f9026704da 100644 --- a/gnu/packages/ghostscript.scm +++ b/gnu/packages/ghostscript.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> +;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -125,8 +126,10 @@ printing, and psresize, for adjusting page sizes.") (method url-fetch) (uri (string-append "mirror://gnu/ghostscript/gnu-ghostscript-" version ".tar.xz")) - (sha256 (base32 - "0q4jj41p0qbr4mgcc9q78f5zs8cm1g57wgryhsm2yq4lfslm3ib1")))) + (sha256 + (base32 + "0q4jj41p0qbr4mgcc9q78f5zs8cm1g57wgryhsm2yq4lfslm3ib1")) + (patches (list (search-patch "ghostscript-runpath.patch"))))) (build-system gnu-build-system) (inputs `(("freetype" ,freetype) ("lcms" ,lcms) @@ -142,20 +145,19 @@ printing, and psresize, for adjusting page sizes.") ("tcl" ,tcl))) (arguments `(#:phases - (alist-cons-after - 'configure 'patch-config-files - (lambda _ - (substitute* "base/all-arch.mak" - (("/bin/sh") (which "bash"))) - (substitute* "base/unixhead.mak" - (("/bin/sh") (which "bash")))) - (alist-cons-after - 'build 'build-so - (lambda _ (system* "make" "so")) - (alist-cons-after - 'install 'install-so - (lambda _ (system* "make" "install-so")) - %standard-phases))))) + (modify-phases %standard-phases + (add-after 'configure 'patch-config-files + (lambda _ + (substitute* "base/all-arch.mak" + (("/bin/sh") (which "bash"))) + (substitute* "base/unixhead.mak" + (("/bin/sh") (which "bash"))))) + (add-after 'build 'build-so + (lambda _ + (zero? (system* "make" "so")))) + (add-after 'install 'install-so + (lambda _ + (zero? (system* "make" "install-so"))))))) (synopsis "PostScript and PDF interpreter") (description "Ghostscript is an interpreter for the PostScript language and the PDF diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index dc90a1231d..e640f83756 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2013 Joshua Grant <tadni@riseup.net> ;;; Copyright © 2014 David Thompson <davet@gnu.org> -;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> +;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -149,7 +149,7 @@ Polygon meshes, and Extruded polygon meshes") (arguments '(#:phases (modify-phases %standard-phases - (add-after unpack autogen + (add-after 'unpack 'autogen (lambda _ (zero? (system* "sh" "autogen.sh"))))))) (home-page "https://github.com/divVerent/s2tc") @@ -282,10 +282,10 @@ emulation to complete hardware acceleration for modern GPUs.") (arguments '(#:phases (modify-phases %standard-phases - (delete configure) - (delete build) - (delete check) - (replace install + (delete 'configure) + (delete 'build) + (delete 'check) + (replace 'install (lambda* (#:key outputs #:allow-other-keys) (copy-recursively "include" (string-append (assoc-ref outputs "out") @@ -318,7 +318,7 @@ emulation to complete hardware acceleration for modern GPUs.") '(#:phases (modify-phases %standard-phases (replace - install + 'install (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (mkdir-p (string-append out "/bin")) @@ -418,3 +418,60 @@ extension functionality is exposed in a single header file.") "Guile-OpenGL is a library for Guile that provides bindings to the OpenGL graphics API.") (license l:lgpl3+))) + +(define-public libepoxy + (package + (name "libepoxy") + (version "1.2") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/anholt/libepoxy/archive/v" + version + ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1xp8g6b7xlbym2rj4vkbl6xpb7ijq7glpv656mc7k9b01x22ihs2")))) + (arguments + `(#:phases + (alist-cons-after + 'unpack 'autoreconf + (lambda _ + (zero? (system* "autoreconf" "-vif"))) + (alist-cons-before + 'configure 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + (let ((python (assoc-ref inputs "python")) + (mesa (assoc-ref inputs "mesa"))) + (substitute* "src/gen_dispatch.py" + (("/usr/bin/env python") python)) + (substitute* (find-files "." "\\.[ch]$") + (("libGL.so.1") (string-append mesa "/lib/libGL.so.1")) + (("libEGL.so.1") (string-append mesa "/lib/libEGL.so.1"))) + + ;; XXX On armhf systems, we must add "GLIBC_2.4" to the list of + ;; versions in test/dlwrap.c:dlwrap_real_dlsym. It would be + ;; better to make this a normal patch, but for now we do it here + ;; to prevent rebuilding on other platforms. + ,@(if (string-prefix? "arm" (or (%current-target-system) + (%current-system))) + '((substitute* '"test/dlwrap.c" + (("\"GLIBC_2\\.0\"") "\"GLIBC_2.0\", \"GLIBC_2.4\""))) + '()) + #t)) + %standard-phases)))) + (build-system gnu-build-system) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool) + ("pkg-config" ,pkg-config) + ("python" ,python))) + (inputs + `(("mesa" ,mesa))) + (home-page "http://github.com/anholt/libepoxy/") + (synopsis "A library for handling OpenGL function pointer management") + (description + "A library for handling OpenGL function pointer management.") + (license l:x11))) diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index 3c68d86c96..688c0b61d0 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> -;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> +;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -57,7 +57,7 @@ (define dbus (package (name "dbus") - (version "1.8.12") + (version "1.8.16") (source (origin (method url-fetch) (uri @@ -65,7 +65,7 @@ version ".tar.gz")) (sha256 (base32 - "07jhcalg00i2rx5zrgk73rg0vm7lzi5q5z2gscrbl999ipr2h569")) + "01rba8mp8kqvmy6ibdmi806kjr3m14swnskqk02gyhykxxl54ybz")) (patches (list (search-patch "dbus-localstatedir.patch"))))) (build-system gnu-build-system) (arguments @@ -119,7 +119,7 @@ shared NFS home directories.") (define glib (package (name "glib") - (version "2.42.1") + (version "2.44.0") (source (origin (method url-fetch) (uri (string-append "mirror://gnome/sources/" @@ -127,7 +127,7 @@ shared NFS home directories.") name "-" version ".tar.xz")) (sha256 (base32 - "16pqvikrps1fvwwqvk0qi4a13mfg7gw6w5qfhk7bhi8f51jhhgwg")) + "1fgmjv3yzxgbks31h42201x2izpw0sd84h8dfw0si3x00sqn5lzj")) (patches (list (search-patch "glib-tests-homedir.patch") (search-patch "glib-tests-desktop.patch") (search-patch "glib-tests-prlimit.patch") @@ -176,7 +176,7 @@ shared NFS home directories.") ;; Note: `--docdir' and `--htmldir' are not honored, so work around it. #:configure-flags (list (string-append "--with-html-dir=" (assoc-ref %outputs "doc") - "/share/gtk-doc")) + "/share/gtk-doc/html")) ;; In 'gio/tests', 'gdbus-test-codegen-generated.h' is #included in a ;; file that gets compiled possibly before it has been fully generated. @@ -189,7 +189,11 @@ shared NFS home directories.") ;; by 'glib-compile-schemas'. (list (search-path-specification (variable "XDG_DATA_DIRS") - (files '("share"))))) + (files '("share"))) + ;; To load extra gio modules from glib-networking, etc. + (search-path-specification + (variable "GIO_EXTRA_MODULES") + (files '("lib/gio/modules"))))) (search-paths native-search-paths) (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME") diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 19de30e159..487dd8dcd2 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -30,26 +30,35 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system glib-or-gtk) #:use-module (gnu packages) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) #:use-module (gnu packages bison) + #:use-module (gnu packages cups) #:use-module (gnu packages curl) #:use-module (gnu packages databases) #:use-module (gnu packages flex) + #:use-module (gnu packages databases) #:use-module (gnu packages docbook) #:use-module (gnu packages glib) #:use-module (gnu packages gnupg) + #:use-module (gnu packages gnuzilla) #:use-module (gnu packages gstreamer) #:use-module (gnu packages gtk) #:use-module (gnu packages pdf) + #:use-module (gnu packages polkit) #:use-module (gnu packages popt) #:use-module (gnu packages ghostscript) #:use-module (gnu packages gnutls) #:use-module (gnu packages iso-codes) #:use-module (gnu packages libcanberra) #:use-module (gnu packages linux) + #:use-module (gnu packages libusb) #:use-module (gnu packages image) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages pulseaudio) #:use-module (gnu packages python) + #:use-module (gnu packages scanner) #:use-module (gnu packages xml) #:use-module (gnu packages gl) #:use-module (gnu packages compression) @@ -98,7 +107,7 @@ features to enable users to create their discs easily and quickly.") (define-public gnome-desktop (package (name "gnome-desktop") - (version "3.10.0") + (version "3.16.0") (source (origin (method url-fetch) @@ -107,7 +116,7 @@ features to enable users to create their discs easily and quickly.") name "-" version ".tar.xz")) (sha256 (base32 - "0p5p6wvmy5zvcdnmp5h2biz7rjrcw99chq5kkwcnb68flcmkb1ry")))) + "05lvik5cdh51xqd332qingph09zdhiaa1kqy9k2sk1simz4pvf8m")))) (build-system gnu-build-system) (native-inputs `(("intltool" ,intltool) @@ -871,22 +880,22 @@ designed to be accessed through the MIME functions in GnomeVFS.") (version-major+minor version) "/" name "-" version ".tar.bz2")) (sha256 - (base32 "1ajg8jb8k3snxc7rrgczlh8daxkjidmcv3zr9w809sq4p2sn9pk2")))) + (base32 + "1ajg8jb8k3snxc7rrgczlh8daxkjidmcv3zr9w809sq4p2sn9pk2")))) (build-system gnu-build-system) (arguments - ;; The programmer kindly gives us a hook to turn off deprecation warnings ... - `(#:configure-flags '("DISABLE_DEPRECATED_CFLAGS=-DGLIB_DISABLE_DEPRECATION_WARNINGS") - ;; ... which they then completly ignore !! - #:phases - (alist-cons-before - 'configure 'ignore-deprecations - (lambda _ - (begin - (substitute* "libgnomevfs/Makefile.in" - (("-DG_DISABLE_DEPRECATED") "-DGLIB_DISABLE_DEPRECATION_WARNINGS")) - (substitute* "daemon/Makefile.in" - (("-DG_DISABLE_DEPRECATED") "-DGLIB_DISABLE_DEPRECATION_WARNINGS")))) - %standard-phases))) + `(;; XXX The 'test-async-cancel' test often fails. + #:make-flags '("XFAIL_TESTS=test-async-cancel") + + #:phases + (alist-cons-before + 'configure 'ignore-deprecations + (lambda _ + (substitute* '("libgnomevfs/Makefile.in" + "daemon/Makefile.in") + (("-DG_DISABLE_DEPRECATED") "-DGLIB_DISABLE_DEPRECATION_WARNINGS")) + #t) + %standard-phases))) (inputs `(("glib" ,glib) ("libxml2" ,libxml2) ("dbus-glib" ,dbus-glib) @@ -900,9 +909,10 @@ designed to be accessed through the MIME functions in GnomeVFS.") ("pkg-config" ,pkg-config))) (home-page "https://developer.gnome.org/gnome-vfs/") (synopsis "Access files and folders in GNOME applications") - (description "GnomeVFS is the core library used to access files and -folders in GNOME applications. It provides a file system abstraction which -allows applications to access local and remote files with a single consistent API.") + (description + "GnomeVFS is the core library used to access files and folders in GNOME +applications. It provides a file system abstraction which allows applications +to access local and remote files with a single consistent API.") (license license:lgpl2.0+))) @@ -1340,7 +1350,7 @@ engineering.") version ".tar.xz")) (sha256 (base32 - "0f2b3ypkfvrdsxcvp14ja9wqj382f1p46yrjvhhxkkjgagy6qb41")))) + "0kyrbfrgl6g6wm6zpllldz36fclvl8vwmn1snwk18kf7f6ncpsac")))) (build-system gnu-build-system) (inputs `(("gtk+" ,gtk+) @@ -1649,7 +1659,7 @@ library.") '("--with-ca-certificates=no") #:phases (modify-phases %standard-phases - (add-before configure patch-giomoduledir + (add-before 'configure 'patch-giomoduledir ;; Install GIO modules into $out/lib/gio/modules. (lambda _ (substitute* "configure" @@ -1697,14 +1707,14 @@ library.") "/lib/gio/modules")) #:phases (modify-phases %standard-phases - (add-before configure disable-unconnected-socket-test + (add-before 'configure 'disable-unconnected-socket-test ;; This test fails due to missing /etc/nsswitch.conf ;; in the build environment. (lambda _ (substitute* "tests/socket-test.c" ((".*/sockets/unconnected.*") "")) #t)) - (add-before check unset-LC_ALL + (add-before 'check 'unset-LC_ALL ;; The 'check-local' target runs 'env LANG=C sort -u', ;; unset 'LC_ALL' to make 'LANG' working. (lambda _ @@ -1799,11 +1809,11 @@ and other secrets. It communicates with the \"Secret Service\" using DBus.") (arguments '(#:phases (modify-phases %standard-phases - (add-before configure patch-/bin/true + (add-before 'configure 'patch-/bin/true (lambda _ (substitute* "configure" (("/bin/true") (which "true"))))) - (add-after install wrap-pixbuf + (add-after 'install 'wrap-pixbuf ;; Use librsvg's loaders.cache to support SVG files. (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -1847,7 +1857,7 @@ floating in an ocean using only your brain and a little bit of luck.") "--without-nautilus-extension") #:phases (modify-phases %standard-phases - (add-before configure patch-/bin/true + (add-before 'configure 'patch-/bin/true (lambda _ (substitute* "configure" (("/bin/true") (which "true")))))))) @@ -1874,3 +1884,312 @@ your system. It supports several profiles, multiple tabs and implements several keyboard shortcuts.") (license license:gpl3+))) + +(define-public colord + (package + (name "colord") + (version "1.1.8") + (source + (origin + (method url-fetch) + (uri (string-append "http://www.freedesktop.org/software/colord/releases/" + name "-" version ".tar.xz")) + (sha256 + (base32 + "01w97rgzk4qi6fp03scq5jyw0ayx11b479p7dkm2r77k84b9agph")))) + (build-system glib-or-gtk-build-system) + (arguments + '(;; The tests want to run valgrind. Punt for now. + #:tests? #f + #:configure-flags (list "--localstatedir=/var" + ;; GUSB not packaged yet. + "--disable-gusb" + ;; No dep on systemd. + "--disable-systemd-login" + ;; Wants to install to global completion dir; + ;; punt. + "--disable-bash-completion" + ;; colord-gtk not packaged yet. + "--disable-session-example" + "--with-daemon-user=colord" + "--enable-sane" + (string-append "--with-udevrulesdir=" + (assoc-ref %outputs "out") + "/lib/udev/rules.d")) + #:phases + (modify-phases %standard-phases + (add-before 'configure 'patch-/bin/true + (lambda _ + (substitute* "configure" + (("/bin/true") (which "true"))) + (substitute* "src/Makefile.in" + (("if test -w \\$\\(DESTDIR\\)\\$\\(prefix\\)/;") + "if test -w $(DESTDIR)$(localstatedir);")))) + (add-before 'build 'set-cc + (lambda _ + ;; Set $CC so that g-ir-scanner works. + (setenv "CC" "gcc") + #t))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("gobject-introspection" ,gobject-introspection) + ("libtool" ,libtool) + ("intltool" ,intltool))) + (inputs + `(("eudev" ,eudev) + ("dbus" ,dbus) + ("dbus-glib" ,dbus-glib) + ("libusb" ,libusb) + ("lcms" ,lcms) + ("sqlite" ,sqlite) + ("polkit" ,polkit) + ("sane-backends" ,sane-backends))) + (home-page "http://www.freedesktop.org/software/colord/") + (synopsis "Color management service") + (description "Colord is a system service that makes it easy to manage, +install and generate color profiles to accurately color manage input and +output devices.") + (license license:gpl2+))) + +(define-public geoclue + (package + (name "geoclue") + (version "2.1.10") + (source + (origin + (method url-fetch) + (uri (string-append "http://www.freedesktop.org/software/" name + "/releases/" (version-major+minor version) "/" + name "-" version ".tar.xz")) + (sha256 + (base32 + "0s0ws2bx5g1cbjamxmm448r4n4crha2fwpzm8zbx6cq6qslygmzi")) + (patches (list (search-patch "geoclue-config.patch"))))) + (build-system glib-or-gtk-build-system) + (arguments + '(;; The tests want to run the system bus. + #:tests? #f + #:configure-flags (list ;; Disable bits requiring ModemManager. + "--disable-3g-source" + "--disable-cdma-source" + "--disable-modem-gps-source" + "--with-dbus-service-user=geoclue") + #:phases + (modify-phases %standard-phases + (add-before 'configure 'patch-/bin/true + (lambda _ + (substitute* "configure" + (("/bin/true") (which "true")))))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("intltool" ,intltool))) + (inputs + `(("glib" ,glib) + ("json-glib" ,json-glib) + ("libsoup" ,libsoup))) + (home-page "http://freedesktop.org/wiki/Software/GeoClue/") + (synopsis "Geolocation service") + (description "Geoclue is a D-Bus service that provides location +information. The primary goal of the Geoclue project is to make creating +location-aware applications as simple as possible, while the secondary goal is +to ensure that no application can access location information without explicit +permission from user. ") + (license license:gpl2+))) + +(define-public geocode-glib + (package + (name "geocode-glib") + (version "3.16.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnome/sources/geocode-glib/" + (version-major+minor version) "/" + name "-" version ".tar.xz")) + (sha256 + (base32 + "1cbfv0kds6b6k0cl7q47xpj3x1scwcd7m68zl1rf7i4hmhw4hpqj")))) + (build-system gnu-build-system) + (arguments + `(;; The tests want to write to $HOME/.cache/geocode-glib, which doesn't + ;; work for the builder. Punt. + #:tests? #f + #:make-flags '("CC=gcc") ; for g-ir-scanner + )) + (native-inputs + `(("glib:bin" ,glib "bin") ; for glib-mkenums + ("gobject-introspection" ,gobject-introspection) + ("pkg-config" ,pkg-config) + ("json-glib" ,json-glib))) + (propagated-inputs + ;; geocode-glib-1.0.pc refers to GIO. + `(("glib" ,glib))) + (inputs + `(("libsoup" ,libsoup))) + (home-page "https://github.com/GNOME/geocode-glib/") + (synopsis "Geocoding and reverse-geocoding library") + (description + "geocode-glib is a convenience library for geocoding (finding longitude, +and latitude from an address) and reverse geocoding (finding an address from +coordinates) using the Nominatim service. geocode-glib caches requests for +faster results and to avoid unnecessary server load.") + (license license:lgpl2.0+))) + +(define-public upower + (package + (name "upower") + (version "0.99.2") + (source (origin + (method url-fetch) + (uri (string-append "http://upower.freedesktop.org/releases/" + name "-" version ".tar.xz")) + (sha256 + (base32 + "0vwlh20jmaf01m38kfn8yx2869a3clmkzlycrj99rf4nvwx4bp79")) + (patches (list (search-patch "upower-builddir.patch"))))) + (build-system glib-or-gtk-build-system) + (arguments + '( ;; The tests want to contact the system bus, which can't be done in the + ;; build environment. The integration test can run, but the last of + ;; the up-self-tests doesn't. Disable tests for now. + #:tests? #f + #:configure-flags (list "--localstatedir=/var" + (string-append "--with-udevrulesdir=" + (assoc-ref %outputs "out") + "/lib/udev/rules.d")) + #:phases + (modify-phases %standard-phases + (add-before 'configure 'patch-/bin/true + (lambda _ + (substitute* "configure" + (("/bin/true") (which "true"))))) + (add-before 'configure 'patch-integration-test + (lambda _ + (substitute* "src/linux/integration-test" + (("/usr/bin/python3") (which "python3")))))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("intltool" ,intltool) + ("python" ,python))) + (inputs + `(("eudev" ,eudev) + ("dbus" ,dbus) + ("dbus-glib" ,dbus-glib) + ("libusb" ,libusb))) + (home-page "http://upower.freedesktop.org/") + (synopsis "System daemon for managing power devices") + (description + "UPower is an abstraction for enumerating power devices, +listening to device events and querying history and statistics. Any +application or service on the system can access the org.freedesktop.UPower +service via the system message bus.") + (license license:gpl2+))) + +(define-public libgweather + (package + (name "libgweather") + (version "3.16.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnome/sources/" name "/" + (version-major+minor version) "/" + name "-" version ".tar.xz")) + (sha256 + (base32 + "0x1z6wv7hdw2ivlkifcbd940zyrnvqvc4zh2drgvd2r6jmd7bjza")))) + (build-system gnu-build-system) + (arguments + `(;; The tests want to write to $HOME/.cache/geocode-glib, which doesn't + ;; work for the builder. Punt. + #:tests? #f + #:make-flags '("CC=gcc") ; for g-ir-scanner + #:configure-flags + `(;; No introspection for now, as it wants to install to + ;; gobject-introspection's own directory and I don't know how to easily + ;; override this. + "--enable-introspection=no" + ,(string-append "--with-zoneinfo-dir=" + (assoc-ref %build-inputs "tzdata") + "/share/zoneinfo")))) + (native-inputs + `(("glib:bin" ,glib "bin") ; for glib-mkenums + ("pkg-config" ,pkg-config) + ("intltool" ,intltool))) + (propagated-inputs + ;; gweather-3.0.pc refers to GTK+, GDK-Pixbuf, GLib/GObject, libxml, and + ;; libsoup. + `(("gtk+" ,gtk+) + ("gdk-pixbuf" ,gdk-pixbuf) + ("libxml2" ,libxml2) + ("libsoup" ,libsoup))) + (inputs + `(("tzdata" ,tzdata) + ("geocode-glib" ,geocode-glib))) + (home-page "https://wiki.gnome.org/action/show/Projects/LibGWeather") + (synopsis "Location, time zone, and weather library for GNOME") + (description + "libgweather is a library to access weather information from online +services for numerous locations.") + (license license:gpl2+))) + +(define-public gnome-settings-daemon + (package + (name "gnome-settings-daemon") + (version "3.16.0") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://gnome/sources/" name "/" + (version-major+minor version) "/" + name "-" version ".tar.xz")) + (sha256 + (base32 + "1w29x2izq59125ga5ncmmaklc8kw7x7rdn6swn26bs23mah1r1g3")))) + (build-system glib-or-gtk-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + ;; libwacom and xorg-wacom not yet packaged. Hackily disable by + ;; pretending to be s390 (!). + (add-before + 'configure 'disable-wacom + (lambda _ + (substitute* "configure" + (("if test \"\\$host_cpu\" = s390 -o \"\\$host_cpu\" = s390x") + "if true"))))) + ;; Network manager not yet packaged. + #:configure-flags '("--disable-network-manager") + ;; Color management test can't reach the colord system service. + #:tests? #f)) + (native-inputs + `(("pkg-config" ,pkg-config) + ("intltool" ,intltool) + ("xsltproc" ,libxslt) + ("libxml2" ,libxml2) ;for XML_CATALOG_FILES + ("docbook-xml" ,docbook-xml-4.2) + ("docbook-xsl" ,docbook-xsl))) + (inputs + `(("colord" ,colord) + ("eudev" ,eudev) + ("upower" ,upower) + ("polkit" ,polkit) + ("pulseaudio" ,pulseaudio) + ("libcanberra" ,libcanberra) + ("libx11" ,libx11) + ("libxtst" ,libxtst) + ("lcms" ,lcms) + ("libnotify" ,libnotify) + ("geoclue" ,geoclue) + ("geocode-glib" ,geocode-glib) + ("libgweather" ,libgweather) + ("gnome-desktop" ,gnome-desktop) + ("nss" ,nss) + ("cups" ,cups) + ("gsettings-desktop-schemas" ,gsettings-desktop-schemas))) + (home-page "http://www.gnome.org") + (synopsis "GNOME settings daemon") + (description + "This package contains the daemon responsible for setting the various +parameters of a GNOME session and the applications that run under it. It +handles settings such keyboard layout, shortcuts, and accessibility, clipboard +settings, themes, mouse settings, and startup of other daemons.") + (license license:gpl2+))) diff --git a/gnu/packages/gnunet.scm b/gnu/packages/gnunet.scm index e50de7cc5d..78279b0243 100644 --- a/gnu/packages/gnunet.scm +++ b/gnu/packages/gnunet.scm @@ -112,14 +112,14 @@ tool to extract metadata from a file and print the results.") (define-public libmicrohttpd (package (name "libmicrohttpd") - (version "0.9.39") + (version "0.9.40") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/libmicrohttpd/libmicrohttpd-" version ".tar.gz")) (sha256 (base32 - "0wz3sw62z3wsqivrssh0xb3yn064ix5x5cc6prvdfrn3cmh7p4sg")))) + "19mpqwjb3g4bsh1rzcvmka380kmg7sz5dwfr5cwdh2k9m134sga0")))) (build-system gnu-build-system) (inputs `(("curl" ,curl) diff --git a/gnu/packages/gnutls.scm b/gnu/packages/gnutls.scm index 0ae660bf5d..17cd4582ff 100644 --- a/gnu/packages/gnutls.scm +++ b/gnu/packages/gnutls.scm @@ -29,6 +29,7 @@ #:use-module (gnu packages) #:use-module (gnu packages guile) #:use-module (gnu packages libffi) + #:use-module (gnu packages libidn) #:use-module (gnu packages nettle) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) @@ -38,7 +39,7 @@ (define-public libtasn1 (package (name "libtasn1") - (version "4.2") + (version "4.4") (source (origin (method url-fetch) @@ -46,7 +47,7 @@ version ".tar.gz")) (sha256 (base32 - "1fydwh5hlnmprdzmzn4kiqb939br59qv1001k7ah5b626v5l2fv9")))) + "0p8c5s1gm3z3nn4s9qc6gs18grbk45mx44byqw2l2qzynjqrsd7q")))) (build-system gnu-build-system) (native-inputs `(("perl" ,perl) @@ -65,7 +66,7 @@ specifications.") (define-public p11-kit (package (name "p11-kit") - (version "0.22.1") + (version "0.23.1") (source (origin (method url-fetch) @@ -73,7 +74,7 @@ specifications.") version ".tar.gz")) (sha256 (base32 - "0p4sadq2c70jdm7b5a5xw8mk2mqy36krpxr3ihnf783arygk6fpg")) + "1i3a1wdpagm0p3y1bwaz5x5rjhcpqbcrnhkcp10p259vkxk72wz5")) (modules '((guix build utils))) ; for substitute* (snippet '(begin @@ -103,7 +104,7 @@ living in the same process.") (define-public gnutls (package (name "gnutls") - (version "3.3.12") + (version "3.4.0") (source (origin (method url-fetch) (uri @@ -114,7 +115,9 @@ living in the same process.") "/gnutls-" version ".tar.xz")) (sha256 (base32 - "16r96bzsfqx1rlqrkggmhhx6zbxj1fmc3mwpp0ik73ylqn93xav7")))) + "0bj7ydvsyvml59b6040wg7694iz37rwnqnv09bic9ddz652588ml")) + (patches + (list (search-patch "gnutls-fix-duplicate-manpages.patch"))))) (build-system gnu-build-system) (arguments '(#:configure-flags @@ -130,7 +133,12 @@ living in the same process.") ;; store is used, so each program has to provide its own ;; fallback, and users have to configure each program ;; independently. This seems suboptimal. - "--with-default-trust-store-dir=/etc/ssl/certs"))) + "--with-default-trust-store-dir=/etc/ssl/certs" + + ;; FIXME: Temporarily disable p11-kit support since it is not + ;; working on mips64el. + "--without-p11-kit"))) + (outputs '("out" "debug")) (native-inputs `(("pkg-config" ,pkg-config) ("which" ,which))) @@ -140,6 +148,7 @@ living in the same process.") (propagated-inputs ;; These are all in the 'Requires.private' field of gnutls.pc. `(("libtasn1" ,libtasn1) + ("libidn" ,libidn) ("nettle" ,nettle) ("zlib" ,zlib))) (home-page "http://www.gnu.org/software/gnutls/") diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index fc2b41d38b..522404f280 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> -;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> ;;; @@ -103,15 +103,16 @@ in C/C++.") (native-inputs `(("perl", perl))) (arguments - `(#:tests? #f ; no check target - #:configure-flags - `("--enable-64bit") - #:phases - (alist-cons-before - 'configure 'chdir - (lambda _ - (chdir "nspr")) - %standard-phases))) + `(#:tests? #f ; no check target + #:configure-flags (list "--enable-64bit" + (string-append "LDFLAGS=-Wl,-rpath=" + (assoc-ref %outputs "out") + "/lib")) + #:phases (alist-cons-before + 'configure 'chdir + (lambda _ + (chdir "nspr")) + %standard-phases))) (home-page "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR") (synopsis "Netscape API for system level and libc-like functions") @@ -157,8 +158,6 @@ in the Mozilla clients.") (ice-9 ftw) (ice-9 match) (srfi srfi-26)) - #:imported-modules ((guix build gnu-build-system) - (guix build utils)) #:phases (alist-replace 'configure @@ -254,6 +253,7 @@ standards.") ("mesa" ,mesa) ("nspr" ,nspr) ("nss" ,nss) + ("sqlite" ,sqlite) ("unzip" ,unzip) ("yasm" ,yasm) ("zip" ,zip) @@ -267,6 +267,13 @@ standards.") `(#:tests? #f ; no check target #:out-of-source? #t ; must be built outside of the source directory + + ;; XXX: There are RUNPATH issues such as + ;; $prefix/lib/icecat-31.6.0/plugin-container NEEDing libmozalloc.so, + ;; which is not in its RUNPATH, but they appear to be harmless in + ;; practice somehow. See <http://hydra.gnu.org/build/378133>. + #:validate-runpath? #f + #:configure-flags '(;; Building with debugging symbols takes ~5GiB, so ;; disable it. "--disable-debug" @@ -285,11 +292,7 @@ standards.") "--enable-system-pixman" "--enable-system-cairo" "--enable-system-ffi" - - ;; Fails with "configure: error: System - ;; SQLite library is not compiled with - ;; SQLITE_ENABLE_UNLOCK_NOTIFY." - ;; "--enable-system-sqlite" + "--enable-system-sqlite" ;; Fails with "--with-system-png won't work because ;; the system's libpng doesn't have APNG support". diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index f574628698..14badc949c 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -181,14 +181,14 @@ output.") (build-system gnu-build-system) (arguments `(#:phases (modify-phases %standard-phases - (replace configure + (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (chdir "trunk") (zero? (system* "qmake" (string-append "prefix=" out)))))) - (add-after install wrap-program + (add-after 'install 'wrap-program (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin")) diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm index e07bbec510..977ca14e3a 100644 --- a/gnu/packages/gstreamer.scm +++ b/gnu/packages/gstreamer.scm @@ -263,7 +263,14 @@ developers consider to have good quality code and correct functionality.") "1g7vg9amh3cc3nmc415h6g2rqxqi4wgwqi08hxfbpwq48ri64p30")))) (build-system gnu-build-system) (arguments - '(#:configure-flags '("--with-system-libav"))) + '(#:configure-flags '("--with-system-libav") + #:phases + (modify-phases %standard-phases + (add-before 'configure 'patch-/bin/sh + (lambda _ + (substitute* "gst-libs/ext/libav/configure" + (("#! /bin/sh") + (string-append "#! "(which "sh"))))))))) (native-inputs `(("pkg-config" ,pkg-config) ("python" ,python))) diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index b3688d5ec1..cd54cfc5b9 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch> ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org> +;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,6 +35,7 @@ #:use-module (gnu packages compression) #:use-module (gnu packages fontutils) #:use-module (gnu packages ghostscript) + #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) #:use-module (gnu packages icu4c) @@ -51,7 +53,7 @@ (define-public atk (package (name "atk") - (version "2.15.3") + (version "2.16.0") (source (origin (method url-fetch) (uri (string-append "mirror://gnome/sources/" name "/" @@ -59,9 +61,15 @@ name "-" version ".tar.xz")) (sha256 (base32 - "177a9x6lz2im0mfgxv2crv0l740wy7rg5vlnb8wyyf4fmnh0q19f")))) ; 2.15.3 + "0qp5i91kfk6rhrlam3s8ha0cz88lkyp89vsyn4pb5856c1h9hpq9")))) (build-system gnu-build-system) - (inputs `(("glib" ,glib))) + (outputs '("out" "doc")) + (arguments + `(#:configure-flags + (list (string-append "--with-html-dir=" + (assoc-ref %outputs "doc") + "/share/gtk-doc/html")))) + (propagated-inputs `(("glib" ,glib))) ; required by atk.pc (native-inputs `(("pkg-config" ,pkg-config) ("glib" ,glib "bin") ; glib-mkenums, etc. @@ -77,14 +85,14 @@ tools have full access to view and control running applications.") (define-public cairo (package (name "cairo") - (version "1.12.18") + (version "1.14.2") (source (origin (method url-fetch) (uri (string-append "http://cairographics.org/releases/cairo-" version ".tar.xz")) (sha256 (base32 - "1dpmlxmmigpiyv0jchjsn2l1a29655x24g5073hy8p4lmjvz0nfw")))) + "1sycbq0agbwmg1bj9lhkgsf0glmblaf2jrdy9g6vxfxivncxj6f9")))) (build-system gnu-build-system) (propagated-inputs `(("fontconfig" ,fontconfig) @@ -332,7 +340,7 @@ in the GNOME project.") (define-public at-spi2-core (package (name "at-spi2-core") - (version "2.10.0") + (version "2.16.0") (source (origin (method url-fetch) (uri (string-append "mirror://gnome/sources/" name "/" @@ -340,18 +348,32 @@ in the GNOME project.") name "-" version ".tar.xz")) (sha256 (base32 - "1ns44yibdgcwzwri7sr075hfs5rh5lgxkh71247a0822az3mahcn")))) + "1l3l39mw23zyjlcqidvkyqlr4gwbhplzw2hcv3qvn6p8ikxpf2qw")))) (build-system gnu-build-system) - (inputs `(("dbus" ,dbus) - ("glib" ,glib) - ("libxi" ,libxi) - ("libxtst" ,libxtst))) - (native-inputs - `(("intltool" ,intltool) - ("pkg-config" ,pkg-config))) + (outputs '("out" "doc")) (arguments - `(#:tests? #f)) ; FIXME: dbind/dbtest fails; one should disable tests in - ; a more fine-grained way. + '(#:make-flags '("CC=gcc") ; for g-ir-scanner + #:configure-flags + (list (string-append "--with-html-dir=" + (assoc-ref %outputs "doc") + "/share/gtk-doc/html")) + #:phases + (modify-phases %standard-phases + (replace 'check + ;; Run test-suite under a dbus session. + (lambda _ + (zero? (system* "dbus-launch" "make" "check"))))))) + (propagated-inputs + ;; atspi-2.pc refers to all these. + `(("dbus" ,dbus) + ("glib" ,glib))) + (inputs + `(("libxi" ,libxi) + ("libxtst" ,libxtst))) + (native-inputs + `(("gobject-introspection" ,gobject-introspection) + ("intltool" ,intltool) + ("pkg-config" ,pkg-config))) (synopsis "Assistive Technology Service Provider Interface, core components") (description "The Assistive Technology Service Provider Interface, core components, @@ -362,7 +384,7 @@ is part of the GNOME accessibility project.") (define-public at-spi2-atk (package (name "at-spi2-atk") - (version "2.10.0") + (version "2.16.0") (source (origin (method url-fetch) (uri (string-append "mirror://gnome/sources/" name "/" @@ -370,17 +392,22 @@ is part of the GNOME accessibility project.") name "-" version ".tar.xz")) (sha256 (base32 - "150sqc21difazqd53llwfdaqnwfy73bic9hia41xpfy9kcpzz9yy")))) + "1y9gfz1iz3wpja7s000f0bmyyvc6im5fcdl6bxwbz0v3qdgc9vvq")))) (build-system gnu-build-system) - (inputs `(("atk" ,atk) - ("at-spi2-core" ,at-spi2-core) - ("dbus" ,dbus) - ("glib" ,glib))) - (native-inputs - `(("pkg-config" ,pkg-config))) (arguments - `(#:tests? #f)) ; FIXME: droute/droute-test fails; one should disable - ; tests in a more fine-grained way. + '(#:phases + (modify-phases %standard-phases + (replace 'check + ;; Run test-suite under a dbus session. + (lambda _ + (zero? (system* "dbus-launch" "make" "check"))))))) + (propagated-inputs + `(("at-spi2-core" ,at-spi2-core))) ; required by atk-bridge-2.0.pc + (inputs + `(("atk" ,atk))) + (native-inputs + `(("dbus" ,dbus) ; for testing + ("pkg-config" ,pkg-config))) (synopsis "Assistive Technology Service Provider Interface, ATK bindings") (description "The Assistive Technology Service Provider Interface @@ -391,7 +418,7 @@ is part of the GNOME accessibility project.") (define-public gtk+-2 (package (name "gtk+") - (version "2.24.21") + (version "2.24.27") (source (origin (method url-fetch) (uri (string-append "mirror://gnome/sources/" name "/" @@ -399,20 +426,35 @@ is part of the GNOME accessibility project.") name "-" version ".tar.xz")) (sha256 (base32 - "1qyw73pr9ryqhir2h1kbx3vm70km4dg2fxrgkrdlpv0rvlb94bih")))) + "1x14rnjvqslpa1q19fp1qalz5sxds72amsgjk8m7769rwk511jr0")))) (build-system gnu-build-system) + (outputs '("out" "doc")) (propagated-inputs `(("atk" ,atk) ("gdk-pixbuf" ,gdk-pixbuf) ("pango" ,pango))) + (inputs + `(("cups" ,cups) + ("libxcomposite" ,libxcomposite) + ("libxcursor" ,libxcursor) + ("libxdamage" ,libxdamage) + ("libxi" ,libxi) + ("libxinerama" ,libxinerama) + ("libxrandr" ,libxrandr))) (native-inputs `(("perl" ,perl) + ("gettext" ,gnu-gettext) ("glib" ,glib "bin") ("gobject-introspection" ,gobject-introspection) ("pkg-config" ,pkg-config) ("python-wrapper" ,python-wrapper))) (arguments `(#:make-flags '("CC=gcc") + #:configure-flags + (list "--with-xinput=yes" + (string-append "--with-html-dir=" + (assoc-ref %outputs "doc") + "/share/gtk-doc/html")) #:phases (alist-cons-before 'configure 'disable-tests @@ -433,7 +475,7 @@ application suites.") (define-public gtk+ (package (inherit gtk+-2) (name "gtk+") - (version "3.14.7") + (version "3.16.0") (source (origin (method url-fetch) (uri (string-append "mirror://gnome/sources/" name "/" @@ -441,11 +483,12 @@ application suites.") name "-" version ".tar.xz")) (sha256 (base32 - "0vm40n6nf0w3vv54wqy67jcxddka7hplksi093xim3119yq196gv")))) + "1si6ihl1wlvag8qq3166skr9fnm9i33dimbfry1j628qzqc76qff")))) (propagated-inputs `(("at-spi2-atk" ,at-spi2-atk) ("atk" ,atk) ("gdk-pixbuf" ,gdk-pixbuf) + ("libepoxy" ,libepoxy) ("libxi" ,libxi) ("libxinerama" ,libxinerama) ("libxdamage" ,libxdamage) @@ -456,25 +499,33 @@ application suites.") (native-inputs `(("perl" ,perl) ("glib" ,glib "bin") + ("gettext" ,gnu-gettext) ("pkg-config" ,pkg-config) ("gobject-introspection" ,gobject-introspection) ("python-wrapper" ,python-wrapper) ("xorg-server" ,xorg-server))) (arguments - `(#:phases - (alist-replace - 'configure - (lambda* (#:key inputs #:allow-other-keys #:rest args) - (let ((configure (assoc-ref %standard-phases 'configure))) - ;; Disable most tests, failing in the chroot with the message: - ;; D-Bus library appears to be incorrectly set up; failed to read - ;; machine uuid: Failed to open "/etc/machine-id": No such file or - ;; directory. - ;; See the manual page for dbus-uuidgen to correct this issue. - (substitute* "testsuite/Makefile.in" - (("SUBDIRS = gdk gtk a11y css reftests") - "SUBDIRS = gdk")) - (apply configure args))) + `(;; 47 MiB goes to "out" (24 of which is locale data!), and 26 MiB goes + ;; to "doc". + #:configure-flags (list (string-append "--with-html-dir=" + (assoc-ref %outputs "doc") + "/share/gtk-doc/html")) + #:phases + (alist-cons-before + 'configure 'pre-configure + (lambda _ + ;; Disable most tests, failing in the chroot with the message: + ;; D-Bus library appears to be incorrectly set up; failed to read + ;; machine uuid: Failed to open "/etc/machine-id": No such file or + ;; directory. + ;; See the manual page for dbus-uuidgen to correct this issue. + (substitute* "testsuite/Makefile.in" + (("SUBDIRS = gdk gtk a11y css reftests") + "SUBDIRS = gdk")) + (substitute* '("demos/widget-factory/Makefile.in" + "demos/gtk-demo/Makefile.in") + (("gtk-update-icon-cache") "$(bindir)/gtk-update-icon-cache")) + #t) %standard-phases))))) ;;; diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index 254301e6c8..3bb5e3074a 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -111,13 +111,17 @@ ;; We get a smaller number of test failures by disabling parallel test ;; execution. #:parallel-tests? #f + + ;; The DSOs use $ORIGIN to refer to each other, but (guix build + ;; gremlin) doesn't support it yet, so skip this phase. + #:validate-runpath? #f + #:modules ((guix build gnu-build-system) (guix build utils) (guix build rpath) (srfi srfi-26) (srfi srfi-1)) - #:imported-modules ((guix build gnu-build-system) - (guix build utils) + #:imported-modules (,@%gnu-build-system-modules (guix build rpath)) #:configure-flags (list @@ -799,7 +803,7 @@ mutable and immutable), with a powerful loop optimisation framework.") `(#:tests? #f ; FIXME: currently missing libraries used for tests. #:phases (modify-phases %standard-phases - (add-before configure set-sh + (add-before 'configure 'set-sh (lambda _ (setenv "CONFIG_SHELL" "sh")))))) (home-page "https://github.com/haskell/network") (synopsis "Low-level networking interface") diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 93dd2ac4e6..ece0e8c54a 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -204,11 +204,11 @@ the W3C's XML-based Scaleable Vector Graphic (SVG) format.") (modify-phases %standard-phases ;; Prevent make from trying to regenerate config.h.in. (add-after - unpack set-config-h-in-file-time + 'unpack 'set-config-h-in-file-time (lambda _ (set-file-time "config/config.h.in" (stat "configure")))) (add-after - unpack patch-reg-wrapper + 'unpack 'patch-reg-wrapper (lambda _ (substitute* "prog/reg_wrapper.sh" ((" /bin/sh ") diff --git a/gnu/packages/imagemagick.scm b/gnu/packages/imagemagick.scm index 2a68627dc6..ab663b5a41 100644 --- a/gnu/packages/imagemagick.scm +++ b/gnu/packages/imagemagick.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org> ;;; ;;; This file is part of GNU Guix. @@ -112,7 +112,7 @@ text, lines, polygons, ellipses and Bézier curves.") `(#:phases (modify-phases %standard-phases (add-before - configure image-magick-flags + 'configure 'image-magick-flags (lambda* (#:key inputs #:allow-other-keys) (let ((im (assoc-ref inputs "imagemagick"))) (substitute* "Makefile.PL" @@ -121,7 +121,7 @@ text, lines, polygons, ellipses and Bézier curves.") (("my \\$LIBS_magick = .*") "my $LIBS_magick = `pkg-config --libs ImageMagick`;\n"))))) (add-before - check skip-mpeg-tests + 'check 'skip-mpeg-tests (lambda _ ;; TODO: MPEG tests fail even though our imagemagick supports ;; MPEG. Has been reported elsewhere, diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 3149c55eee..2a8cd99fe6 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -160,6 +160,11 @@ build process and its dependencies, whereas Make uses Makefile format.") ;; made no attempts to make a list of failing JDK tests. At least ;; 222 tests are failing of which at least 132 are AWT tests. #:tests? #f + + ;; The DSOs use $ORIGIN to refer to each other, but (guix build + ;; gremlin) doesn't support it yet, so skip this phase. + #:validate-runpath? #f + #:configure-flags (let* ((gcjdir (assoc-ref %build-inputs "gcj")) (ecj (string-append gcjdir "/share/java/ecj.jar")) diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm index 036e485be3..e5990441f5 100644 --- a/gnu/packages/julia.scm +++ b/gnu/packages/julia.scm @@ -56,6 +56,12 @@ #:modules ((ice-9 match) (guix build gnu-build-system) (guix build utils)) + + + ;; The DSOs use $ORIGIN to refer to each other, but (guix build + ;; gremlin) doesn't support it yet, so skip this phase. + #:validate-runpath? #f + #:phases (alist-cons-after 'unpack 'hardcode-soname-map diff --git a/gnu/packages/key-mon.scm b/gnu/packages/key-mon.scm index d29f30258d..c890f85f8d 100644 --- a/gnu/packages/key-mon.scm +++ b/gnu/packages/key-mon.scm @@ -42,7 +42,7 @@ (arguments `(#:python ,python-2 ;uses the Python 2 'print' syntax #:phases (modify-phases %standard-phases - (add-after install wrap + (add-after 'install 'wrap (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin")) diff --git a/gnu/packages/ld-wrapper.in b/gnu/packages/ld-wrapper.in new file mode 100644 index 0000000000..094018de3d --- /dev/null +++ b/gnu/packages/ld-wrapper.in @@ -0,0 +1,209 @@ +#!@BASH@ +# -*- mode: scheme; coding: utf-8; -*- + +# XXX: We have to go through Bash because there's no command-line switch to +# augment %load-compiled-path, and because of the silly 127-byte limit for +# the shebang line in Linux. +# Use `load-compiled' because `load' (and `-l') doesn't otherwise load our +# .go file (see <http://bugs.gnu.org/12519>). + +main="(@ (gnu build-support ld-wrapper) ld-wrapper)" +exec @GUILE@ -c "(load-compiled \"@SELF@.go\") (apply $main (cdr (command-line)))" "$@" +!# +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (gnu build-support ld-wrapper) + #:use-module (srfi srfi-1) + #:use-module (ice-9 match) + #:export (ld-wrapper)) + +;;; Commentary: +;;; +;;; This is a wrapper for the linker. Its purpose is to inspect the -L and +;;; -l switches passed to the linker, add corresponding -rpath arguments, and +;;; invoke the actual linker with this new set of arguments. +;;; +;;; The alternatives to this hack would be: +;;; +;;; 1. Using $LD_RUN_PATH. However, that would tend to include more than +;;; needed in the RPATH; for instance, given a package with `libfoo' as +;;; an input, all its binaries would have libfoo in their RPATH, +;;; regardless of whether they actually NEED it. +;;; +;;; 2. Use a GCC "lib" spec string such as `%{L*:-rpath %*}', which adds a +;;; `-rpath LIBDIR' argument for each occurrence of `-L LIBDIR'. +;;; However, this doesn't work when $LIBRARY_PATH is used, because the +;;; additional `-L' switches are not matched by the above rule, because +;;; the rule only matches explicit user-provided switches. See +;;; <http://gcc.gnu.org/ml/gcc-help/2012-09/msg00110.html> for details. +;;; +;;; As a bonus, this wrapper checks for "impurities"--i.e., references to +;;; libraries outside the store. +;;; +;;; Code: + +(define %real-ld + ;; Name of the linker that we wrap. + "@LD@") + +(define %store-directory + ;; File name of the store. + (or (getenv "NIX_STORE") "/gnu/store")) + +(define %temporary-directory + ;; Temporary directory. + (or (getenv "TMPDIR") "/tmp")) + +(define %build-directory + ;; Top build directory when run from a builder. + (getenv "NIX_BUILD_TOP")) + +(define %allow-impurities? + ;; Whether to allow references to libraries outside the store. + (getenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES")) + +(define %debug? + ;; Whether to emit debugging output. + (getenv "GUIX_LD_WRAPPER_DEBUG")) + +(define %disable-rpath? + ;; Whether to disable automatic '-rpath' addition. + (getenv "GUIX_LD_WRAPPER_DISABLE_RPATH")) + +(define (readlink* file) + ;; Call 'readlink' until the result is not a symlink. + (define %max-symlink-depth 50) + + (let loop ((file file) + (depth 0)) + (catch 'system-error + (lambda () + (if (>= depth %max-symlink-depth) + file + (loop (readlink file) (+ depth 1)))) + (lambda args + (if (= EINVAL (system-error-errno args)) + file + (apply throw args)))))) + +(define (dereference-symlinks file) + ;; Same as 'readlink*' but return FILE if the symlink target is invalid or + ;; FILE does not exist. + (catch 'system-error + (lambda () + ;; When used from a user environment, FILE may refer to + ;; ~/.guix-profile/lib/libfoo.so, which is itself a symlink to the + ;; store. Check whether this is the case. + (readlink* file)) + (lambda args + (if (= ENOENT (system-error-errno args)) + file + (apply throw args))))) + +(define (pure-file-name? file) + ;; Return #t when FILE is the name of a file either within the store + ;; (possibly via a symlink) or within the build directory. + (let ((file (dereference-symlinks file))) + (or (not (string-prefix? "/" file)) + (string-prefix? %store-directory file) + (string-prefix? %temporary-directory file) + (and %build-directory + (string-prefix? %build-directory file))))) + +(define (store-file-name? file) + ;; Return #t when FILE is a store file, possibly indirectly. + (string-prefix? %store-directory (dereference-symlinks file))) + +(define (shared-library? file) + ;; Return #t when FILE denotes a shared library. + (or (string-suffix? ".so" file) + (let ((index (string-contains file ".so."))) + ;; Since we cannot use regexps during bootstrap, roll our own. + (and index + (string-every (char-set-union (char-set #\.) char-set:digit) + (string-drop file (+ index 3))))))) + +(define (library-files-linked args) + ;; Return the file names of shared libraries explicitly linked against via + ;; `-l' or with an absolute file name in ARGS. + (define path+files + (fold (lambda (argument result) + (match result + ((library-path . library-files) + (cond ((string-prefix? "-L" argument) ;augment the search path + (cons (append library-path + (list (string-drop argument 2))) + library-files)) + ((string-prefix? "-l" argument) ;add library + (let* ((lib (string-append "lib" + (string-drop argument 2) + ".so")) + (full (search-path library-path lib))) + (if full + (cons library-path + (cons full library-files)) + result))) + ((and (string-prefix? %store-directory argument) + (shared-library? argument)) ;add library + (cons library-path + (cons argument library-files))) + (else + result))))) + (cons '() '()) + args)) + + (match path+files + ((path . files) + (reverse files)))) + +(define (rpath-arguments library-files) + ;; Return the `-rpath' argument list for each of LIBRARY-FILES, a list of + ;; absolute file names. + (fold-right (lambda (file args) + ;; Add '-rpath' if and only if FILE is in the store; we don't + ;; want to add '-rpath' for files under %BUILD-DIRECTORY or + ;; %TEMPORARY-DIRECTORY because that could leak to installed + ;; files. + (cond ((and (not %disable-rpath?) + (store-file-name? file)) + (cons* "-rpath" (dirname file) args)) + ((or %allow-impurities? + (pure-file-name? file)) + args) + (else + (begin + (format (current-error-port) + "ld-wrapper: error: attempt to use \ +impure library ~s~%" + file) + (exit 1))))) + '() + library-files)) + +(define (ld-wrapper . args) + ;; Invoke the real `ld' with ARGS, augmented with `-rpath' switches. + (let* ((libs (library-files-linked args)) + (args (append args (rpath-arguments libs)))) + (when %debug? + (format (current-error-port) + "ld-wrapper: invoking `~a' with ~s~%" + %real-ld args)) + (apply execl %real-ld (basename %real-ld) args))) + +;;; ld-wrapper.scm ends here diff --git a/gnu/packages/ld-wrapper.scm b/gnu/packages/ld-wrapper2.in index 4fa2962bb9..2f0e0ab24a 100644 --- a/gnu/packages/ld-wrapper.scm +++ b/gnu/packages/ld-wrapper2.in @@ -8,7 +8,7 @@ # .go file (see <http://bugs.gnu.org/12519>). main="(@ (gnu build-support ld-wrapper) ld-wrapper)" -exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" "$@" +exec @GUILE@ -c "(load-compiled \"@SELF@.go\") (apply $main (cdr (command-line)))" "$@" !# ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> @@ -82,27 +82,45 @@ exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" " ;; Whether to emit debugging output. (getenv "GUIX_LD_WRAPPER_DEBUG")) -(define (pure-file-name? file) - ;; Return #t when FILE is the name of a file either within the store - ;; (possibly via a symlink) or within the build directory. +(define %disable-rpath? + ;; Whether to disable automatic '-rpath' addition. + (getenv "GUIX_LD_WRAPPER_DISABLE_RPATH")) + +(define (readlink* file) + ;; Call 'readlink' until the result is not a symlink. (define %max-symlink-depth 50) (let loop ((file file) (depth 0)) + (define (absolute target) + (if (absolute-file-name? target) + target + (string-append (dirname file) "/" target))) + + (catch 'system-error + (lambda () + (if (>= depth %max-symlink-depth) + file + (loop (absolute (readlink file)) (+ depth 1)))) + (lambda args + (let ((errno (system-error-errno args))) + (if (or (= errno EINVAL) (= errno ENOENT)) + file + (apply throw args))))))) + +(define (pure-file-name? file) + ;; Return #t when FILE is the name of a file either within the store + ;; (possibly via a symlink) or within the build directory. + (let ((file (readlink* file))) (or (not (string-prefix? "/" file)) (string-prefix? %store-directory file) (string-prefix? %temporary-directory file) - (if %build-directory - (string-prefix? %build-directory file) - - ;; When used from a user environment, FILE may refer to - ;; ~/.guix-profile/lib/libfoo.so, which is itself a symlink to the - ;; store. Check whether this is the case. - (let ((s (false-if-exception (lstat file)))) - (and s - (eq? 'symlink (stat:type s)) - (< depth %max-symlink-depth) - (loop (readlink file) (+ 1 depth)))))))) + (and %build-directory + (string-prefix? %build-directory file))))) + +(define (store-file-name? file) + ;; Return #t when FILE is a store file, possibly indirectly. + (string-prefix? %store-directory (readlink* file))) (define (shared-library? file) ;; Return #t when FILE denotes a shared library. @@ -150,14 +168,23 @@ exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" " ;; Return the `-rpath' argument list for each of LIBRARY-FILES, a list of ;; absolute file names. (fold-right (lambda (file args) - (if (or %allow-impurities? - (pure-file-name? file)) - (cons* "-rpath" (dirname file) args) - (begin - (format (current-error-port) - "ld-wrapper: error: attempt to use impure library ~s~%" - file) - (exit 1)))) + ;; Add '-rpath' if and only if FILE is in the store; we don't + ;; want to add '-rpath' for files under %BUILD-DIRECTORY or + ;; %TEMPORARY-DIRECTORY because that could leak to installed + ;; files. + (cond ((and (not %disable-rpath?) + (store-file-name? file)) + (cons* "-rpath" (dirname file) args)) + ((or %allow-impurities? + (pure-file-name? file)) + args) + (else + (begin + (format (current-error-port) + "ld-wrapper: error: attempt to use \ +impure library ~s~%" + file) + (exit 1))))) '() library-files)) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index dc0532283e..101982114c 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -91,7 +91,7 @@ version "-gnu.tar.xz"))) (define-public linux-libre-headers - (let* ((version "3.3.8") + (let* ((version "3.14.37") (build-phase (lambda (arch) `(lambda _ @@ -120,7 +120,7 @@ (uri (linux-libre-urls version)) (sha256 (base32 - "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl")))) + "1blxr2bsvfqi9khj4cpspv434bmx252zak2wsbi2mgl60zh77gza")))) (build-system gnu-build-system) (native-inputs `(("perl" ,perl))) (arguments @@ -404,8 +404,14 @@ providing the system administrator with some help in common tasks.") (("build_kill=yes") "build_kill=no"))))) (build-system gnu-build-system) (arguments - `(#:configure-flags '("--disable-use-tty-group" - "--enable-ddate") + `(#:configure-flags (list "--disable-use-tty-group" + "--enable-ddate" + + ;; Install completions where our + ;; bash-completion package expects them. + (string-append "--with-bashcompletiondir=" + (assoc-ref %outputs "out") + "/etc/bash_completion.d")) #:phases (alist-cons-before 'check 'pre-check (lambda* (#:key inputs outputs #:allow-other-keys) @@ -789,7 +795,10 @@ MIDI functionality to the Linux-based operating system.") (base32 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24")))) (build-system gnu-build-system) - (arguments '(#:tests? #f)) ; no test suite + (arguments + '(#:tests? #f ; no test suite + #:configure-flags ; add $libdir to the RUNPATH of executables + (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")))) (home-page "http://www.netfilter.org/projects/iptables/index.html") (synopsis "Program to configure the Linux IP packet filtering rules") (description @@ -910,10 +919,12 @@ manpages.") ;; Pretend we have everything... (system "yes | make config") - ;; ... except we don't have libdnet, so remove that - ;; definition. + ;; ... except for the things we don't have. + ;; HAVE_AFDECnet requires libdnet, which we don't have. + ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers + ;; that have been removed. (substitute* '("config.make" "config.h") - (("^.*HAVE_AFDECnet.*$") "")))) + (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") "")))) (alist-cons-after 'install 'remove-redundant-commands (lambda* (#:key outputs #:allow-other-keys) @@ -975,7 +986,15 @@ advanced aspects of IP configuration (iptunnel, ipmaddr).") (base32 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1")))) (build-system gnu-build-system) - (arguments '(#:phases (alist-delete 'configure %standard-phases) + (arguments '(#:phases + (modify-phases %standard-phases + (replace 'configure + ;; Add $libdir to the RUNPATH of executables. + (lambda _ + (substitute* "Make.Rules" + (("LDFLAGS := #-g") + (string-append "LDFLAGS := -Wl,-rpath=" + %output "/lib")))))) #:tests? #f ; no 'check' target #:make-flags (list "lib=lib" (string-append "prefix=" diff --git a/gnu/packages/lsh.scm b/gnu/packages/lsh.scm index a931a111ad..0edf6b4382 100644 --- a/gnu/packages/lsh.scm +++ b/gnu/packages/lsh.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -91,7 +91,7 @@ basis for almost any application.") ("gperf" ,gperf) ("psmisc" ,psmisc))) ; for `killall' (inputs - `(("nettle" ,nettle) + `(("nettle" ,nettle-2) ("linux-pam" ,linux-pam) ;; 'rl.c' uses the 'CPPFunction' type, which is no longer in diff --git a/gnu/packages/ncurses.scm b/gnu/packages/ncurses.scm index 0dbc583f79..180cdde19f 100644 --- a/gnu/packages/ncurses.scm +++ b/gnu/packages/ncurses.scm @@ -43,14 +43,6 @@ (string-append "CONFIG_SHELL=" bash) (string-append "--prefix=" out) configure-flags))))) - (cross-pre-install-phase - '(lambda _ - ;; Run the native `tic' program, not the cross-built one. - (substitute* "misc/run_tic.sh" - (("\\{TIC_PATH:=.*\\}") - "{TIC_PATH:=true}") - (("cross_compiling:=no") - "cross_compiling:=yes")))) (post-install-phase '(lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -116,12 +108,9 @@ `(alist-cons-before ; cross build 'configure 'patch-makefile-SHELL ,patch-makefile-phase - (alist-cons-before - 'install 'pre-install - ,cross-pre-install-phase - (alist-cons-after - 'install 'post-install ,post-install-phase - %standard-phases))) + (alist-cons-after + 'install 'post-install ,post-install-phase + %standard-phases)) `(alist-cons-after ; native build 'install 'post-install ,post-install-phase diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm index e72cf32e3f..475635e7e1 100644 --- a/gnu/packages/netpbm.scm +++ b/gnu/packages/netpbm.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> +;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -49,7 +50,41 @@ (revision 1832))) (sha256 (base32 - "1mj1pqq18yj0yb6l24zfjls7axhqmiv0pvcaabl5xvc4a0dm543j")))) + "1mj1pqq18yj0yb6l24zfjls7axhqmiv0pvcaabl5xvc4a0dm543j")) + (file-name (string-append name "-" version "-checkout")) + (modules '((guix build utils))) + (snippet + ;; Remove non-FSDG-compliant code. + '(begin + (use-modules (guix build utils)) + + (define-syntax drop + (syntax-rules (in) + ;; Remove PROGRAM from DIRECTORY/Makefile, and remove + ;; DIRECTORY/PROGRAM and DIRECTORY/PROGRAM.c. + ((_ program ... in directory) + (begin + (substitute* (string-append directory "/Makefile") + ((program) "") ...) + + (let* ((subdir (string-append directory "/" program)) + (dot-c (string-append subdir ".c"))) + (when (file-exists? subdir) + (delete-file-recursively subdir)) + (when (file-exists? dot-c) + (delete-file dot-c))) + + ...)))) + + ;; Drop advertisement for non-free program. + (drop "hpcdtoppm" in "converter/ppm") + + ;; Drop programs without a license, see + ;; <http://packages.debian.org/changelogs/pool/main/n/netpbm-free/netpbm-free_10.0-12.2/libnetpbm10.copyright>. + (drop "pbmto4425" "pbmtoln03" "pbmtolps" "pbmtopk" "pktopbm" + in "converter/pbm") + (drop "spottopgm" in "converter/pgm") + (drop "ppmtopjxl" in "converter/ppm"))))) (build-system gnu-build-system) (inputs `(("ghostscript" ,ghostscript) ("libjpeg" ,libjpeg) @@ -75,19 +110,8 @@ (display "TIFFLIB = libtiff.so\n" f) (display "JPEGLIB = libjpeg.so\n" f) (display "ZLIB = libz.so\n" f) - (close-port f) - ;; drop advertisement for non-free program - (substitute* "converter/ppm/Makefile" (("hpcdtoppm") "")) - ;; drop programs without license, see - ;; http://packages.debian.org/changelogs/pool/main/n/netpbm-free/netpbm-free_10.0-12.2/libnetpbm10.copyright - (substitute* "converter/pbm/Makefile" - (("pbmto4425") "") - (("pbmtoln03") "") - (("pbmtolps") "") - (("pbmtopk") "") - (("pktopbm") "")) - (substitute* "converter/pgm/Makefile" (("spottopgm") "")) - (substitute* "converter/ppm/Makefile" (("ppmtopjxl") "")))) + (display (string-append "LDFLAGS += -Wl,-rpath=" %output "/lib") f) + (close-port f))) (alist-cons-before 'check 'setup-check (lambda _ diff --git a/gnu/packages/nettle.scm b/gnu/packages/nettle.scm index 0df8f001bf..ed140d43c0 100644 --- a/gnu/packages/nettle.scm +++ b/gnu/packages/nettle.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -17,6 +17,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu packages nettle) + #:use-module (guix utils) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) @@ -24,7 +25,7 @@ #:use-module (gnu packages multiprecision) #:use-module (gnu packages m4)) -(define-public nettle +(define-public nettle-2 (package (name "nettle") (version "2.7.1") @@ -42,6 +43,7 @@ '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") "/lib")))) + (outputs '("out" "debug")) (native-inputs `(("m4" ,m4))) (propagated-inputs `(("gmp" ,gmp))) (home-page "http://www.lysator.liu.se/~nisse/nettle/") @@ -53,15 +55,21 @@ cryptographic toolkits for object-oriented languages or in applications themselves.") (license gpl2+))) -(define-public nettle-3 +(define-public nettle ;; This version is not API-compatible with version 2. In particular GnuTLS ;; cannot use it yet. So keep it separate. - (package (inherit nettle) - (version "3.0") + (package (inherit nettle-2) + (version "3.1") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/nettle/nettle-" version ".tar.gz")) (sha256 (base32 - "04yrpjz33vrj6j0zxc153b00f93i8hs41syr1ryp7sr64fyw0lcn")))))) + "1ly9kz5fgc8ilykz07crqwgjsfn4p2s6565gj1aq0w4fr179v1gn")))) + (arguments + (substitute-keyword-arguments (package-arguments nettle-2) + ((#:configure-flags flags) + ;; Build "fat" binaries where the right implementation is chosen at + ;; run time based on CPU features (starting from 3.1.) + `(cons "--enable-fat" ,flags)))))) diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm index 8d9a0f5be9..0b65843183 100644 --- a/gnu/packages/node.scm +++ b/gnu/packages/node.scm @@ -29,7 +29,6 @@ #:use-module (guix packages) #:use-module (guix derivations) #:use-module (guix download) - #:use-module (guix build gnu-build-system) #:use-module (guix build-system gnu)) (define-public node diff --git a/gnu/packages/ocr.scm b/gnu/packages/ocr.scm index 32da42b95f..b94a7f51cb 100644 --- a/gnu/packages/ocr.scm +++ b/gnu/packages/ocr.scm @@ -76,7 +76,7 @@ it produces text in 8-bit or UTF-8 formats.") '(#:phases (modify-phases %standard-phases (add-after - unpack autogen + 'unpack 'autogen (lambda _ (zero? (system* "sh" "autogen.sh"))))) #:configure-flags diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm index a6c4cb0d93..fe7961affb 100644 --- a/gnu/packages/openldap.scm +++ b/gnu/packages/openldap.scm @@ -34,14 +34,14 @@ (define-public openldap (package (name "openldap") - (version "2.4.33") + (version "2.4.40") (source (origin (method url-fetch) (uri (string-append "ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/openldap-" version ".tgz")) (sha256 (base32 - "0k51mhrs7pkwph2j38w09x7xl1ii69mcdi7b2mfrm9hp1yifrsc1")))) + "1nyslrgwxwilgv5sixc37svls5rbvhsv9drb7hlrjr2vqaji29ni")))) (build-system gnu-build-system) (inputs `(("bdb" ,bdb) ("openssl" ,openssl) diff --git a/gnu/packages/openssl.scm b/gnu/packages/openssl.scm index 6acbb12737..1ed7a7a1f2 100644 --- a/gnu/packages/openssl.scm +++ b/gnu/packages/openssl.scm @@ -36,7 +36,8 @@ ".tar.gz")) (sha256 (base32 - "0jijgzf72659pikms2bc5w31h78xrd1h5zp2r01an2h340y3kdhm")))) + "0jijgzf72659pikms2bc5w31h78xrd1h5zp2r01an2h340y3kdhm")) + (patches (list (search-patch "openssl-runpath.patch"))))) (build-system gnu-build-system) (native-inputs `(("perl" ,perl))) (arguments diff --git a/gnu/packages/patches/curl-gss-api-fix.patch b/gnu/packages/patches/curl-gss-api-fix.patch deleted file mode 100644 index ea838ae8c7..0000000000 --- a/gnu/packages/patches/curl-gss-api-fix.patch +++ /dev/null @@ -1,38 +0,0 @@ -Copied from upstream: -https://github.com/bagder/curl/commit/5c0e66d63214e0306197c5a3f162441e074f3401.patch - -From 5c0e66d63214e0306197c5a3f162441e074f3401 Mon Sep 17 00:00:00 2001 -From: Steve Holme <steve_holme@hotmail.com> -Date: Thu, 8 Jan 2015 19:23:53 +0000 -Subject: [PATCH] sasl_gssapi: Fixed build on NetBSD with built-in GSS-API - -Bug: http://curl.haxx.se/bug/view.cgi?id=1469 -Reported-by: Thomas Klausner ---- - lib/curl_sasl_gssapi.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/lib/curl_sasl_gssapi.c b/lib/curl_sasl_gssapi.c -index 6dda0e9..a50646a 100644 ---- a/lib/curl_sasl_gssapi.c -+++ b/lib/curl_sasl_gssapi.c -@@ -6,6 +6,7 @@ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 2014, Steve Holme, <steve_holme@hotmail.com>. -+ * Copyright (C) 2015, Daniel Stenberg, <daniel@haxx.se>, et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms -@@ -126,7 +127,7 @@ CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data, - - /* Import the SPN */ - gss_major_status = gss_import_name(&gss_minor_status, &spn_token, -- gss_nt_service_name, &krb5->spn); -+ GSS_C_NT_HOSTBASED_SERVICE, &krb5->spn); - if(GSS_ERROR(gss_major_status)) { - Curl_gss_log_error(data, gss_minor_status, "gss_import_name() failed: "); - --- -2.2.1 - diff --git a/gnu/packages/patches/curl-support-capath-on-gnutls-conf.patch b/gnu/packages/patches/curl-support-capath-on-gnutls-conf.patch new file mode 100644 index 0000000000..d2391d461d --- /dev/null +++ b/gnu/packages/patches/curl-support-capath-on-gnutls-conf.patch @@ -0,0 +1,16 @@ +This patch updates 'configure' as autoreconf would have done after +applying curl-support-capath-on-gnutls.patch. + +--- a/configure 2015-03-22 01:11:23.178743705 +0100 ++++ b/configure 2015-02-25 00:05:37.000000000 +0100 +@@ -23952,8 +24432,8 @@ + ca="$want_ca" + capath="no" + elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then +- if test "x$OPENSSL_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then +- as_fn_error $? "--with-ca-path only works with openSSL or PolarSSL" "$LINENO" 5 ++ if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then ++ as_fn_error $? "--with-ca-path only works with OpenSSL, GnuTLS or PolarSSL" "$LINENO" 5 + fi + capath="$want_capath" + ca="no" diff --git a/gnu/packages/patches/curl-support-capath-on-gnutls.patch b/gnu/packages/patches/curl-support-capath-on-gnutls.patch new file mode 100644 index 0000000000..d05dd021e8 --- /dev/null +++ b/gnu/packages/patches/curl-support-capath-on-gnutls.patch @@ -0,0 +1,102 @@ +This patch adds support for CURLOPT_CAPATH to the GnuTLS backend. + +From 5a1614cecdd57cab8b4ae3e9bc19dfff5ba77e80 Mon Sep 17 00:00:00 2001 +From: Alessandro Ghedini <alessandro@ghedini.me> +Date: Sun, 8 Mar 2015 20:11:06 +0100 +Subject: [PATCH] gtls: add support for CURLOPT_CAPATH + +--- + acinclude.m4 | 4 ++-- + docs/libcurl/opts/CURLOPT_CAPATH.3 | 5 ++--- + lib/vtls/gtls.c | 22 ++++++++++++++++++++++ + lib/vtls/gtls.h | 3 +++ + 4 files changed, 29 insertions(+), 5 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 6ed7ffb..ca01869 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -2615,8 +2615,8 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]), + capath="no" + elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then + dnl --with-ca-path given +- if test "x$OPENSSL_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then +- AC_MSG_ERROR([--with-ca-path only works with openSSL or PolarSSL]) ++ if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then ++ AC_MSG_ERROR([--with-ca-path only works with OpenSSL, GnuTLS or PolarSSL]) + fi + capath="$want_capath" + ca="no" +diff --git a/docs/libcurl/opts/CURLOPT_CAPATH.3 b/docs/libcurl/opts/CURLOPT_CAPATH.3 +index 642953d..6695f9f 100644 +--- a/docs/libcurl/opts/CURLOPT_CAPATH.3 ++++ b/docs/libcurl/opts/CURLOPT_CAPATH.3 +@@ -43,9 +43,8 @@ All TLS based protocols: HTTPS, FTPS, IMAPS, POP3, SMTPS etc. + .SH EXAMPLE + TODO + .SH AVAILABILITY +-This option is OpenSSL-specific and does nothing if libcurl is built to use +-GnuTLS. NSS-powered libcurl provides the option only for backward +-compatibility. ++This option is supported by the OpenSSL, GnuTLS and PolarSSL backends. The NSS ++backend provides the option only for backward compatibility. + .SH RETURN VALUE + Returns CURLE_OK if TLS enabled, and CURLE_UNKNOWN_OPTION if not, or + CURLE_OUT_OF_MEMORY if there was insufficient heap space. +diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c +index 05aef19..c792540 100644 +--- a/lib/vtls/gtls.c ++++ b/lib/vtls/gtls.c +@@ -97,6 +97,10 @@ static bool gtls_inited = FALSE; + # if (GNUTLS_VERSION_NUMBER >= 0x03020d) + # define HAS_OCSP + # endif ++ ++# if (GNUTLS_VERSION_NUMBER >= 0x030306) ++# define HAS_CAPATH ++# endif + #endif + + #ifdef HAS_OCSP +@@ -462,6 +466,24 @@ gtls_connect_step1(struct connectdata *conn, + rc, data->set.ssl.CAfile); + } + ++#ifdef HAS_CAPATH ++ if(data->set.ssl.CApath) { ++ /* set the trusted CA cert directory */ ++ rc = gnutls_certificate_set_x509_trust_dir(conn->ssl[sockindex].cred, ++ data->set.ssl.CApath, ++ GNUTLS_X509_FMT_PEM); ++ if(rc < 0) { ++ infof(data, "error reading ca cert file %s (%s)\n", ++ data->set.ssl.CAfile, gnutls_strerror(rc)); ++ if(data->set.ssl.verifypeer) ++ return CURLE_SSL_CACERT_BADFILE; ++ } ++ else ++ infof(data, "found %d certificates in %s\n", ++ rc, data->set.ssl.CApath); ++ } ++#endif ++ + if(data->set.ssl.CRLfile) { + /* set the CRL list file */ + rc = gnutls_certificate_set_x509_crl_file(conn->ssl[sockindex].cred, +diff --git a/lib/vtls/gtls.h b/lib/vtls/gtls.h +index c3867e5..af1cb5b 100644 +--- a/lib/vtls/gtls.h ++++ b/lib/vtls/gtls.h +@@ -54,6 +54,9 @@ bool Curl_gtls_cert_status_request(void); + /* Set the API backend definition to GnuTLS */ + #define CURL_SSL_BACKEND CURLSSLBACKEND_GNUTLS + ++/* this backend supports the CAPATH option */ ++#define have_curlssl_ca_path 1 ++ + /* API setup for GnuTLS */ + #define curlssl_init Curl_gtls_init + #define curlssl_cleanup Curl_gtls_cleanup +-- +2.2.1 + diff --git a/gnu/packages/patches/elfutils-tests-ptrace.patch b/gnu/packages/patches/elfutils-tests-ptrace.patch new file mode 100644 index 0000000000..cd46999063 --- /dev/null +++ b/gnu/packages/patches/elfutils-tests-ptrace.patch @@ -0,0 +1,64 @@ +This patch allows us to skip tests that require PTRACE_ATTACH in situations +where PTRACE_ATTACH is only allowed when CAP_SYS_PTRACE is held (i.e., for +root, by default.) + +Reported at <https://bugzilla.redhat.com/show_bug.cgi?id=1210966>. + +--- elfutils-0.161/tests/run-deleted.sh 2015-04-11 16:38:33.028556235 +0200 ++++ elfutils-0.161/tests/run-deleted.sh 2015-04-11 16:46:15.012442185 +0200 +@@ -17,6 +17,15 @@ + + . $srcdir/backtrace-subr.sh + ++# Check whether the Yama policy allows us to use PTRACE_ATTACH. ++if [ -f /proc/sys/kernel/yama/ptrace_scope ] ++then ++ if [ `cat /proc/sys/kernel/yama/ptrace_scope` -ne 0 ] ++ then ++ exit 77 ++ fi ++fi ++ + tempfiles deleted deleted-lib.so + cp -p ${abs_builddir}/deleted ${abs_builddir}/deleted-lib.so . + +--- elfutils-0.161/tests/vdsosyms.c 2015-04-11 16:40:20.633461110 +0200 ++++ elfutils-0.161/tests/vdsosyms.c 2015-04-11 16:45:06.611866677 +0200 +@@ -23,6 +23,8 @@ + #include <stdio.h> + #include <string.h> + #include <sys/types.h> ++#include <sys/stat.h> ++#include <fcntl.h> + #include <unistd.h> + #include ELFUTILS_HEADER(dwfl) + +@@ -68,6 +70,7 @@ module_callback (Dwfl_Module *mod, void + int + main (int argc __attribute__ ((unused)), char **argv __attribute__ ((unused))) + { ++ static const char ptrace_scope_file[] = "/proc/sys/kernel/yama/ptrace_scope"; + static char *debuginfo_path; + static const Dwfl_Callbacks proc_callbacks = + { +@@ -76,6 +79,20 @@ main (int argc __attribute__ ((unused)), + + .find_elf = dwfl_linux_proc_find_elf, + }; ++ ++ /* Check whether the Yama policy allows us to use PTRACE_ATTACH. */ ++ int ptrace_scope = open (ptrace_scope_file, O_RDONLY); ++ if (ptrace_scope >= 0) ++ { ++ char buf[10]; ++ int count = read (ptrace_scope, buf, sizeof buf); ++ assert (count > 0); ++ if (buf[0] != '0') ++ /* We're not allowed, so skip this test. */ ++ return 77; ++ close (ptrace_scope); ++ } ++ + Dwfl *dwfl = dwfl_begin (&proc_callbacks); + if (dwfl == NULL) + error (2, 0, "dwfl_begin: %s", dwfl_errmsg (-1)); diff --git a/gnu/packages/patches/gcc-arm-link-spec-fix.patch b/gnu/packages/patches/gcc-arm-link-spec-fix.patch new file mode 100644 index 0000000000..0ffe8a1810 --- /dev/null +++ b/gnu/packages/patches/gcc-arm-link-spec-fix.patch @@ -0,0 +1,16 @@ +Do not pass -dynamic-linker to linker when !shared. +Fixes <http://bugs.gnu.org/20102>. + +Patch by Ludovic Courtès <ludo@gnu.org>. + +--- gcc-4.8.4/gcc/config/arm/linux-elf.h.orig 2015-04-08 20:31:20.376900478 +0200 ++++ gcc-4.8.4/gcc/config/arm/linux-elf.h 2015-04-08 20:31:36.437014437 +0200 +@@ -65,7 +65,7 @@ + %{symbolic:-Bsymbolic} \ + %{!static: \ + %{rdynamic:-export-dynamic} \ +- -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \ ++ %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \ + -X \ + %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ + SUBTARGET_EXTRA_LINK_SPEC diff --git a/gnu/packages/patches/geoclue-config.patch b/gnu/packages/patches/geoclue-config.patch new file mode 100644 index 0000000000..dd35b90be5 --- /dev/null +++ b/gnu/packages/patches/geoclue-config.patch @@ -0,0 +1,25 @@ +Allow the configuration file to be specified via an environment variable. + +--- geoclue-2.1.10/src/gclue-config.c 2015-04-07 09:50:07.721074380 +0200 ++++ geoclue-2.1.10/src/gclue-config.c 2015-04-07 10:27:26.613171960 +0200 +@@ -235,6 +235,11 @@ + gclue_config_init (GClueConfig *config) + { + GError *error = NULL; ++ const char *config_file_path; ++ ++ config_file_path = g_getenv ("GEOCLUE_CONFIG_FILE"); ++ if (config_file_path == NULL) ++ config_file_path = CONFIG_FILE_PATH; + + config->priv = + G_TYPE_INSTANCE_GET_PRIVATE (config, +@@ -242,7 +247,7 @@ + GClueConfigPrivate); + config->priv->key_file = g_key_file_new (); + g_key_file_load_from_file (config->priv->key_file, +- CONFIG_FILE_PATH, ++ config_file_path, + 0, + &error); + if (error != NULL) { diff --git a/gnu/packages/patches/ghostscript-runpath.patch b/gnu/packages/patches/ghostscript-runpath.patch new file mode 100644 index 0000000000..c7dcfd4529 --- /dev/null +++ b/gnu/packages/patches/ghostscript-runpath.patch @@ -0,0 +1,17 @@ +This patch adds $(libdir) to the RUNPATH of 'gsc' and 'gsx'. + +--- gnu-ghostscript-9.14.0/base/unix-dll.mak 2015-04-05 15:12:45.386957927 +0200 ++++ gnu-ghostscript-9.14.0/base/unix-dll.mak 2015-04-05 15:12:49.222982359 +0200 +@@ -91,11 +91,11 @@ $(GS_SO_MAJOR): $(GS_SO_MAJOR_MINOR) + # Build the small Ghostscript loaders, with Gtk+ and without + $(GSSOC_XE): $(GS_SO) $(PSSRC)$(SOC_LOADER) + $(GLCC) -g -o $(GSSOC_XE) $(PSSRC)dxmainc.c \ +- -L$(BINDIR) -l$(GS_SO_BASE) ++ -L$(BINDIR) -l$(GS_SO_BASE) -Wl,-rpath=$(libdir) + + $(GSSOX_XE): $(GS_SO) $(PSSRC)$(SOC_LOADER) + $(GLCC) -g $(SOC_CFLAGS) -o $(GSSOX_XE) $(PSSRC)$(SOC_LOADER) \ +- -L$(BINDIR) -l$(GS_SO_BASE) $(SOC_LIBS) ++ -L$(BINDIR) -l$(GS_SO_BASE) $(SOC_LIBS) -Wl,-rpath=$(libdir) + + # ------------------------- Recursive make targets ------------------------- # diff --git a/gnu/packages/patches/gnutls-fix-duplicate-manpages.patch b/gnu/packages/patches/gnutls-fix-duplicate-manpages.patch new file mode 100644 index 0000000000..95a25560e5 --- /dev/null +++ b/gnu/packages/patches/gnutls-fix-duplicate-manpages.patch @@ -0,0 +1,30 @@ +Remove duplicate manpage entries from Makefile. + +--- gnutls-3.4.0/doc/manpages/Makefile.am.orig 2015-04-06 04:48:30.000000000 -0400 ++++ gnutls-3.4.0/doc/manpages/Makefile.am 2015-04-12 16:52:58.029694525 -0400 +@@ -134,11 +134,8 @@ + APIMANS += gnutls_certificate_get_peers_subkey_id.3 + APIMANS += gnutls_certificate_get_trust_list.3 + APIMANS += gnutls_certificate_get_verify_flags.3 +-APIMANS += gnutls_certificate_get_verify_flags.3 +-APIMANS += gnutls_certificate_get_x509_crt.3 + APIMANS += gnutls_certificate_get_x509_crt.3 + APIMANS += gnutls_certificate_get_x509_key.3 +-APIMANS += gnutls_certificate_get_x509_key.3 + APIMANS += gnutls_certificate_send_x509_rdn_sequence.3 + APIMANS += gnutls_certificate_server_set_request.3 + APIMANS += gnutls_certificate_set_dh_params.3 +--- gnutls-3.4.0/doc/manpages/Makefile.in.orig 2015-04-08 02:08:30.000000000 -0400 ++++ gnutls-3.4.0/doc/manpages/Makefile.in 2015-04-12 16:53:13.319694530 -0400 +@@ -1275,11 +1275,8 @@ + gnutls_certificate_get_peers_subkey_id.3 \ + gnutls_certificate_get_trust_list.3 \ + gnutls_certificate_get_verify_flags.3 \ +- gnutls_certificate_get_verify_flags.3 \ +- gnutls_certificate_get_x509_crt.3 \ + gnutls_certificate_get_x509_crt.3 \ + gnutls_certificate_get_x509_key.3 \ +- gnutls_certificate_get_x509_key.3 \ + gnutls_certificate_send_x509_rdn_sequence.3 \ + gnutls_certificate_server_set_request.3 \ + gnutls_certificate_set_dh_params.3 \ diff --git a/gnu/packages/patches/libtool-skip-tests2.patch b/gnu/packages/patches/libtool-skip-tests2.patch new file mode 100644 index 0000000000..c9d61e3b41 --- /dev/null +++ b/gnu/packages/patches/libtool-skip-tests2.patch @@ -0,0 +1,33 @@ +Skip the nopic test on ARM and MIPS systems. + +--- libtool-2.4.6/tests/demo.at.orig 2015-01-16 13:52:04.000000000 -0500 ++++ libtool-2.4.6/tests/demo.at 2015-02-16 10:48:51.435851966 -0500 +@@ -510,7 +510,7 @@ + AT_SETUP([force non-PIC objects]) + + AT_CHECK([case $host in +-hppa*|x86_64*|s390*) ++hppa*|x86_64*|s390*|arm*|mips*) + # These hosts cannot use non-PIC shared libs + exit 77 ;; + *-solaris*|*-sunos*) +--- libtool-2.4.6/tests/testsuite.orig 2015-02-15 11:15:25.000000000 -0500 ++++ libtool-2.4.6/tests/testsuite 2015-02-16 10:50:58.736483216 -0500 +@@ -8741,7 +8741,7 @@ + + { set +x + $as_echo "$at_srcdir/demo.at:535: case \$host in +-hppa*|x86_64*|s390*) ++hppa*|x86_64*|s390*|arm*|mips*) + # These hosts cannot use non-PIC shared libs + exit 77 ;; + *-solaris*|*-sunos*) +@@ -8766,7 +8766,7 @@ + " + at_fn_check_prepare_notrace 'a `...` command substitution' "demo.at:535" + ( $at_check_trace; case $host in +-hppa*|x86_64*|s390*) ++hppa*|x86_64*|s390*|arm*|mips*) + # These hosts cannot use non-PIC shared libs + exit 77 ;; + *-solaris*|*-sunos*) diff --git a/gnu/packages/patches/openssl-runpath.patch b/gnu/packages/patches/openssl-runpath.patch new file mode 100644 index 0000000000..fa7c0b9962 --- /dev/null +++ b/gnu/packages/patches/openssl-runpath.patch @@ -0,0 +1,15 @@ +This patch makes the build system pass -Wl,-rpath=$out/lib even for +libraries (it already does so for executables, thanks to 'DO_GNU_APP' +in 'Makefile.shared'.) + +--- openssl-1.0.2a/Makefile.shared 2015-04-05 01:07:35.357602454 +0200 ++++ openssl-1.0.2a/Makefile.shared 2015-04-05 01:09:50.474513303 +0200 +@@ -106,7 +106,7 @@ LINK_SO= \ + LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \ + LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \ + LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ +- $${SHAREDCMD} $${SHAREDFLAGS} \ ++ $${SHAREDCMD} $${SHAREDFLAGS} -Wl,-rpath,$(LIBRPATH) \ + -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \ + $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \ + ) && $(SYMLINK_SO) diff --git a/gnu/packages/patches/python-fix-tests.patch b/gnu/packages/patches/python-fix-tests.patch index 70e4aa05d5..82c19980f9 100644 --- a/gnu/packages/patches/python-fix-tests.patch +++ b/gnu/packages/patches/python-fix-tests.patch @@ -64,8 +64,8 @@ http://bugs.python.org/issue20868 . @unittest.skipUnless(support.is_resource_enabled('network'), 'network is not enabled') def test_idna(self): ---- Lib/test/test_multiprocessing.py 2014-04-06 23:12:27.575235000 +0200 -+++ Lib/test/test_multiprocessing.py 2014-04-06 23:13:04.827235000 +0200 +--- Lib/test/_test_multiprocessing.py 2014-04-06 23:12:27.575235000 +0200 ++++ Lib/test/_test_multiprocessing.py 2014-04-06 23:13:04.827235000 +0200 @@ -1016,6 +1016,7 @@ if pid is not None: os.kill(pid, signal.SIGINT) @@ -112,3 +112,52 @@ http://bugs.python.org/issue20868 . def test_issue_8959_a(self): from ctypes.util import find_library libc_path = find_library("c") +--- Tools/scripts/run_tests.py.orig 2015-04-06 03:52:17.484000000 +0200 ++++ Tools/scripts/run_tests.py 2015-04-06 03:52:25.880000000 +0200 +@@ -47,7 +47,7 @@ + if threading and not any(is_multiprocess_flag(arg) for arg in regrtest_args): + args.extend(['-j', '0']) # Use all CPU cores + if not any(is_resource_use_flag(arg) for arg in regrtest_args): +- args.extend(['-u', 'all,-largefile,-audio,-gui']) ++ args.extend(['-u', 'all,-largefile,-audio,-gui,-network']) + args.extend(regrtest_args) + print(' '.join(args)) + os.execv(sys.executable, args) +--- Lib/distutils/tests/test_archive_util.py.orig 2015-04-06 04:08:49.288000000 +0200 ++++ Lib/distutils/tests/test_archive_util.py 2015-04-06 04:09:34.396000000 +0200 +@@ -282,6 +282,7 @@ + finally: + del ARCHIVE_FORMATS['xxx'] + ++ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix") + def test_make_archive_owner_group(self): + # testing make_archive with owner and group, with various combinations + # this works even if there's not gid/uid support +@@ -310,6 +311,7 @@ + + @unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib") + @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support") ++ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix") + def test_tarfile_root_owner(self): + tmpdir, tmpdir2, base_name = self._create_files() + old_dir = os.getcwd() +--- Lib/distutils/tests/test_sdist.py.orig 2015-04-06 04:10:05.264000000 +0200 ++++ Lib/distutils/tests/test_sdist.py 2015-04-06 04:10:21.448000000 +0200 +@@ -435,6 +435,7 @@ + "The tar command is not found") + @unittest.skipIf(find_executable('gzip') is None, + "The gzip command is not found") ++ @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix") + def test_make_distribution_owner_group(self): + # now building a sdist + dist, cmd = self.get_cmd() +--- Lib/test/test_resource.py.orig 2015-04-06 21:30:24.708000000 +0200 ++++ Lib/test/test_resource.py 2015-04-06 23:07:27.220000000 +0200 +@@ -146,6 +146,7 @@ + + @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit') + @support.requires_linux_version(2, 6, 36) ++ @unittest.skipIf(True, "Bug: the PermissionError is not raised") + def test_prlimit(self): + self.assertRaises(TypeError, resource.prlimit) + if os.geteuid() != 0: diff --git a/gnu/packages/patches/qt4-ldflags.patch b/gnu/packages/patches/qt4-ldflags.patch new file mode 100644 index 0000000000..0d6398018a --- /dev/null +++ b/gnu/packages/patches/qt4-ldflags.patch @@ -0,0 +1,18 @@ +Explicitly link against libicui18n so that libQtCore.so always finds it. + +--- qt-everywhere-opensource-src-4.8.6/src/corelib/corelib.pro 2015-04-15 12:01:41.661862663 +0200 ++++ qt-everywhere-opensource-src-4.8.6/src/corelib/corelib.pro 2015-04-15 12:03:57.954586336 +0200 +@@ -19,6 +19,13 @@ include(codecs/codecs.pri) + include(statemachine/statemachine.pri) + include(xml/xml.pri) + ++# Explicitly link with icui18n, which is dlopened by libQtCore.so. ++# We cannot do this by setting LDFLAGS because that then overrides ++# other LDFLAGS: <https://bugreports.qt.io/browse/QTBUG-5471>. ++# XXX: According to the Nixpkgs recipe, this may be necessary for ++# further libraries (cups, gtk-x11-2.0, libgdk-x11-2.0). ++LIBS_PRIVATE += -licui18n ++ + !qpa:mac|darwin:LIBS_PRIVATE += -framework ApplicationServices + qpa:mac { + !ios { diff --git a/gnu/packages/patches/qt5-runpath.patch b/gnu/packages/patches/qt5-runpath.patch new file mode 100644 index 0000000000..a6cbb26ff9 --- /dev/null +++ b/gnu/packages/patches/qt5-runpath.patch @@ -0,0 +1,25 @@ +Allow the use of DT_RUNPATH. This fixes a bug whereby libQt5WebEngineCore.so +ends up having an empty RUNPATH. + +--- qt-everywhere-opensource-src-5.4.1/qtwebengine/src/3rdparty/chromium/build/common.gypi 2015-04-14 10:21:09.330925545 +0200 ++++ qt-everywhere-opensource-src-5.4.1/qtwebengine/src/3rdparty/chromium/build/common.gypi 2015-04-14 10:21:38.735106097 +0200 +@@ -4142,19 +4142,6 @@ + '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)', + ], + }], +- # Some binutils 2.23 releases may or may not have new dtags enabled, +- # but they are all compatible with --disable-new-dtags, +- # because the new dynamic tags are not created by default. +- ['binutils_version>=223', { +- # Newer binutils don't set DT_RPATH unless you disable "new" dtags +- # and the new DT_RUNPATH doesn't work without --no-as-needed flag. +- # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags +- # inside this file to allow usage of --no-as-needed and removal of +- # this flag. +- 'ldflags': [ +- '-Wl,--disable-new-dtags', +- ], +- }] + ], + }, + }], diff --git a/gnu/packages/patches/upower-builddir.patch b/gnu/packages/patches/upower-builddir.patch new file mode 100644 index 0000000000..13cef5876a --- /dev/null +++ b/gnu/packages/patches/upower-builddir.patch @@ -0,0 +1,44 @@ +Remove explicit set of UPOWER_CONF_FILE_NAME in up-self-test.c; +instead the harness should set it. In Guix we set it explicitly; the +right thing is to use AM_TEST_ENVIRONMENT and regenerate the +makefiles, but we can't regenerate because current autotools carp on +some things, so we patch the Makefile.in instead. + +Also fix to not try to create /var/lib/upower if /var isn't writable. + +Patch by Andy Wingo <wingo@igalia.com> + +--- upower-0.99.2.orig/src/Makefile.in 2014-12-18 10:32:01.000000000 +0100 ++++ upower-0.99.2/src/Makefile.in 2015-04-04 19:49:28.020843678 +0200 +@@ -780,6 +780,7 @@ + + @UP_BUILD_TESTS_TRUE@up_self_test_CFLAGS = $(AM_CFLAGS) $(WARNINGFLAGS_C) + @UP_BUILD_TESTS_TRUE@TESTS_ENVIRONMENT = $(DBUS_LAUNCH) ++@UP_BUILD_TESTS_TRUE@AM_TESTS_ENVIRONMENT = UPOWER_CONF_FILE_NAME=$(top_srcdir)/etc/UPower.conf + dbusservicedir = $(datadir)/dbus-1/system-services + dbusservice_in_files = org.freedesktop.UPower.service.in + dbusservice_DATA = $(dbusservice_in_files:.service.in=.service) +@@ -1789,7 +1790,7 @@ + @HAVE_SYSTEMDSYSTEMUNITDIR_TRUE@ @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ + + install-data-hook: +- if test -w $(DESTDIR)$(prefix)/; then \ ++ if test -w $(DESTDIR)$(localstatedir)/; then \ + mkdir -p $(DESTDIR)$(historydir); \ + fi + +--- upower-0.99.2.orig/src/up-self-test.c 2014-07-17 09:46:15.000000000 +0200 ++++ upower-0.99.2/src/up-self-test.c 2015-04-04 18:43:04.952741927 +0200 +@@ -295,12 +295,6 @@ + #endif + g_test_init (&argc, &argv, NULL); + +- /* make check, vs. make distcheck */ +- if (g_file_test ("../etc/UPower.conf", G_FILE_TEST_EXISTS)) +- g_setenv ("UPOWER_CONF_FILE_NAME", "../etc/UPower.conf", TRUE); +- else +- g_setenv ("UPOWER_CONF_FILE_NAME", "../../etc/UPower.conf", TRUE); +- + /* tests go here */ + g_test_add_func ("/power/backend", up_test_backend_func); + g_test_add_func ("/power/device", up_test_device_func); diff --git a/gnu/packages/plotutils.scm b/gnu/packages/plotutils.scm index 245dfe9c67..6166226dce 100644 --- a/gnu/packages/plotutils.scm +++ b/gnu/packages/plotutils.scm @@ -118,13 +118,13 @@ using the Cairo drawing library.") '(#:tests? #f #:phases (modify-phases %standard-phases - (replace configure (lambda _ (chdir "src"))) - (add-before install make-target-directories + (replace 'configure (lambda _ (chdir "src"))) + (add-before 'install 'make-target-directories (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (mkdir-p (string-append out "/bin")) #t))) - (add-after install install-prefabs + (add-after 'install 'install-prefabs (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (dir (string-append out diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 59c460af3b..d64f6331d9 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -201,24 +201,24 @@ data types.") (define-public python (package (inherit python-2) - (version "3.3.5") + (version "3.4.3") (source (origin (method url-fetch) (uri (string-append "https://www.python.org/ftp/python/" version "/Python-" version ".tar.xz")) - (patches (list (search-patch "python-fix-tests.patch") - (search-patch "python-sqlite-3.8.4-test-fix.patch") - (search-patch "python-libffi-mips-n32-fix.patch"))) + (patches (list (search-patch "python-fix-tests.patch"))) (patch-flags '("-p0")) (sha256 (base32 - "1rdncc7g8g6f3lfdg33rli1yffbiq8z283xy4f5ksl1l8i49psdb")))) + "1f4nm4z08sy0kqwisvv95l02crv6dyysdmx44p1mz3bn6csrdcxm")))) (arguments (substitute-keyword-arguments (package-arguments python-2) ((#:tests? _) #t))) (native-search-paths (list (search-path-specification (variable "PYTHONPATH") - (files '("lib/python3.3/site-packages"))))))) + (files (list (string-append "lib/python" + (version-major+minor version) + "/site-packages")))))))) (define-public python-wrapper (package (inherit python) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 4c750416e5..8de1ffe398 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> +;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -103,6 +104,7 @@ X11 (yet).") (sha256 (base32 "0q6qzakq8xihw91xv310qi3vyylq7x2bzdkjgy8sqxii2lgbjzhv")) + (patches (list (search-patch "qt5-runpath.patch"))) (snippet '(begin ;; Remove broken symlinks. @@ -229,30 +231,36 @@ developers using C++ or QML, a CSS & JavaScript like language.") (sha256 (base32 "0b036iqgmbbv37dgwwfihw3mihjbnw3kb5kaisdy0qi8nn8xs54b")) - (patches (list (search-patch "qt4-tests.patch"))))) + (patches (map search-patch + '("qt4-ldflags.patch" "qt4-tests.patch"))))) (inputs `(,@(alist-delete "libjpeg" (package-inputs qt)) ("libjepg" ,libjpeg-8) ("libsm" ,libsm))) + + ;; Note: there are 37 MiB of examples and a '-exampledir' configure flags, + ;; but we can't make them a separate output because "out" and "examples" + ;; would refer to each other. + (outputs '("out" ;112MiB core + 37MiB examples + "doc")) ;280MiB of HTML + code (arguments `(#:phases (alist-replace 'configure (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) + (let ((out (assoc-ref outputs "out")) + (doc (assoc-ref outputs "doc"))) (substitute* '("configure") - (("/bin/pwd") (which "pwd"))) - ;; Explicitly link with icui18n, which is dlopened by - ;; QtCore.so. The LDFLAGS are in fact added to other flags - ;; determined by the configure phase. - ;; According to the nix recipe, this may be necessary for - ;; further libraries (cups, gtk-x11-2.0, libgdk-x11-2.0). - (setenv "LDFLAGS" "-licui18n") - ;; do not pass "--enable-fast-install", which makes the - ;; configure process fail + (("/bin/pwd") (which "pwd"))) + (zero? (system* "./configure" "-verbose" "-prefix" out + "-docdir" (string-append doc "/share/doc/qt-" ,version) + "-demosdir" (string-append out "/share/qt-" ,version + "/demos") + "-examplesdir" (string-append out "/share/qt-" ,version + "/examples") "-opensource" "-confirm-license" ;; explicitly link with dbus instead of dlopening it diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm index c147abcaab..8e53debcb3 100644 --- a/gnu/packages/samba.scm +++ b/gnu/packages/samba.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> ;;; ;;; This file is part of GNU Guix. @@ -105,7 +105,7 @@ anywhere.") "0l9pz2m67vf398q3c2dwn8jwdxsjb20igncf4byhv6yq5dzqlb4g")))) (build-system gnu-build-system) (arguments - '(#:phases (alist-cons-before + `(#:phases (alist-cons-before 'configure 'chdir (lambda _ (chdir "source3")) @@ -127,8 +127,7 @@ anywhere.") (guix build utils) (guix build rpath) (srfi srfi-26)) - #:imported-modules ((guix build gnu-build-system) - (guix build utils) + #:imported-modules (,@%gnu-build-system-modules (guix build rpath)) ;; This flag is required to allow for "make test". diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm index b450e33bbd..77d0d846c8 100644 --- a/gnu/packages/scheme.scm +++ b/gnu/packages/scheme.scm @@ -188,7 +188,10 @@ features an integrated Emacs-like editor and a large runtime library.") ;; <http://article.gmane.org/gmane.lisp.scheme.bigloo/6126>. ;; "--customgc=no" ; use our libgc (string-append"--mv=" (which "mv")) - (string-append "--rm=" (which "rm")))))) + (string-append "--rm=" (which "rm")) + (string-append "--ldflags=-Wl,-rpath=" + (assoc-ref outputs "out") + "/lib/bigloo/" ,version))))) (alist-cons-after 'install 'install-emacs-modes (lambda* (#:key outputs #:allow-other-keys) diff --git a/gnu/packages/search.scm b/gnu/packages/search.scm index d1133248df..5886c6a9ea 100644 --- a/gnu/packages/search.scm +++ b/gnu/packages/search.scm @@ -76,10 +76,10 @@ rich set of boolean query operators.") (arguments `(#:phases (modify-phases %standard-phases (add-before - configure chdir-source + 'configure 'chdir-source (lambda _ (chdir "libtocc/src"))) (replace - check + 'check (lambda _ (with-directory-excursion "../tests" (and (zero? (system* "./configure" @@ -88,7 +88,9 @@ rich set of boolean query operators.") (string-append "SHELL=" (which "sh")) "CPPFLAGS=-I../src" - "LDFLAGS=-L../src/.libs")) + (string-append + "LDFLAGS=-L../src/.libs " + "-Wl,-rpath=../src/.libs"))) (zero? (system* "make")) (zero? (system* "./libtocctests"))))))))) (home-page "http://t-o-c-c.com/") @@ -113,7 +115,7 @@ files and directories.") `(#:tests? #f ;No tests #:phases (modify-phases %standard-phases (add-after - unpack chdir-source + 'unpack 'chdir-source (lambda _ (chdir "cli/src")))))) (home-page "http://t-o-c-c.com/") (synopsis "Command-line interface to libtocc") diff --git a/gnu/packages/texlive.scm b/gnu/packages/texlive.scm index 56149ab58e..14ee9c37ad 100644 --- a/gnu/packages/texlive.scm +++ b/gnu/packages/texlive.scm @@ -176,8 +176,6 @@ This package contains the binaries.") `(#:modules ((guix build gnu-build-system) (guix build utils) (srfi srfi-26)) - #:imported-modules ((guix build gnu-build-system) - (guix build utils)) #:phases (alist-cons-before 'texmf-config 'install diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index 8f00b1f6aa..08b1b64c57 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -45,11 +45,13 @@ (arguments '(#:phases (alist-cons-before - 'check 'fix-setup-py + 'check 'pre-check (lambda _ (substitute* "tests/setup.py" (("([[:space:]]*)include_dirs=.*" all space) - (string-append all space "library_dirs=['../src/.libs'],\n")))) + (string-append all space "library_dirs=['../src/.libs'],\n"))) + ;; The test extension 'Recode.so' lacks RUNPATH for 'librecode.so'. + (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/src/.libs"))) %standard-phases))) (home-page "https://github.com/pinard/Recode") (synopsis "Text encoding converter") diff --git a/gnu/packages/upnp.scm b/gnu/packages/upnp.scm index a1a18d272c..c46e905c42 100644 --- a/gnu/packages/upnp.scm +++ b/gnu/packages/upnp.scm @@ -48,7 +48,11 @@ (string-append "SH=" (assoc-ref %build-inputs "bash") "/bin/sh") (string-append "INSTALLPREFIX=" (assoc-ref %outputs "out")) - "CC=gcc") + "CC=gcc" + + ;; Allow executables to find libminiupnpc.so. + (string-append "LDFLAGS=-Wl,-rpath=" + (assoc-ref %outputs "out") "/lib")) #:phases (alist-delete 'configure %standard-phases))) (home-page "http://miniupnp.free.fr/") diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 48e16a14be..2094ec0554 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -531,7 +531,10 @@ property manipulation.") (system* "perl" "Makefile.PL" (string-append "PREFIX=" out))) (zero? - (system* "make" "install"))))))) + (system* "make" "install" + (string-append "OTHERLDFLAGS=" + "-Wl,-rpath=" + out "/lib")))))))) %standard-phases)))) (native-inputs `(("pkg-config" ,pkg-config) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 8ded42ce96..e5e4743b2c 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -97,7 +97,7 @@ (arguments '(#:phases (modify-phases %standard-phases - (replace configure + (replace 'configure (lambda* (#:key inputs outputs #:allow-other-keys) ;; This old `configure' script doesn't support ;; variables passed as arguments. @@ -320,11 +320,11 @@ standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).") (guix build utils) (guix build rpath) (srfi srfi-26)) - #:imported-modules ((guix build gnu-build-system) - (guix build utils) + #:imported-modules (,@%gnu-build-system-modules (guix build rpath)) #:phases - (alist-replace + (modify-phases %standard-phases + (replace 'configure ;; configure does not work followed by "SHELL=..." and ;; "CONFIG_SHELL=..."; set environment variables instead @@ -334,48 +334,48 @@ standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).") (("#! /bin/sh") (string-append "#!" (which "bash")))) (setenv "SHELL" (which "bash")) (setenv "CONFIG_SHELL" (which "bash")) - ;; FIXME: only needed for ffmpeg-2.2.13, but easier to add - ;; globally; drop as soon as ffmpeg-2.2.13 is dropped + ;; FIXME: only needed for ffmpeg-2.2.13, but easier to add + ;; globally; drop as soon as ffmpeg-2.2.13 is dropped (setenv "LDFLAGS" "-ldl") -;; possible additional inputs: -;; --enable-avisynth enable reading of AviSynth script files [no] -;; --enable-frei0r enable frei0r video filtering -;; --enable-libaacplus enable AAC+ encoding via libaacplus [no] -;; --enable-libcelt enable CELT decoding via libcelt [no] -;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394 -;; and libraw1394 [no] -;; --enable-libfaac enable AAC encoding via libfaac [no] -;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no] -;; --enable-libflite enable flite (voice synthesis) support via libflite [no] -;; --enable-libgme enable Game Music Emu via libgme [no] -;; --enable-libgsm enable GSM de/encoding via libgsm [no] -;; --enable-libiec61883 enable iec61883 via libiec61883 [no] -;; --enable-libilbc enable iLBC de/encoding via libilbc [no] -;; --enable-libmodplug enable ModPlug via libmodplug [no] -;; --enable-libnut enable NUT (de)muxing via libnut, -;; native (de)muxer exists [no] -;; --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no] -;; --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no] -;; --enable-libopencv enable video filtering via libopencv [no] -;; --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no] -;; --enable-librtmp enable RTMP[E] support via librtmp [no] -;; --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no] -;; --enable-libshine enable fixed-point MP3 encoding via libshine [no] -;; --enable-libssh enable SFTP protocol via libssh [no] -;; (libssh2 does not work) -;; --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no] -;; --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no] -;; --enable-libv4l2 enable libv4l2/v4l-utils [no] -;; --enable-libvidstab enable video stabilization using vid.stab [no] -;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no] -;; --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no] -;; --enable-libwavpack enable wavpack encoding via libwavpack [no] -;; --enable-libx264 enable H.264 encoding via x264 [no] -;; --enable-libxavs enable AVS encoding via xavs [no] -;; --enable-libzmq enable message passing via libzmq [no] -;; --enable-libzvbi enable teletext support via libzvbi [no] -;; --enable-opencl enable OpenCL code -;; --enable-x11grab enable X11 grabbing [no] + ;; possible additional inputs: + ;; --enable-avisynth enable reading of AviSynth script files [no] + ;; --enable-frei0r enable frei0r video filtering + ;; --enable-libaacplus enable AAC+ encoding via libaacplus [no] + ;; --enable-libcelt enable CELT decoding via libcelt [no] + ;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394 + ;; and libraw1394 [no] + ;; --enable-libfaac enable AAC encoding via libfaac [no] + ;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no] + ;; --enable-libflite enable flite (voice synthesis) support via libflite [no] + ;; --enable-libgme enable Game Music Emu via libgme [no] + ;; --enable-libgsm enable GSM de/encoding via libgsm [no] + ;; --enable-libiec61883 enable iec61883 via libiec61883 [no] + ;; --enable-libilbc enable iLBC de/encoding via libilbc [no] + ;; --enable-libmodplug enable ModPlug via libmodplug [no] + ;; --enable-libnut enable NUT (de)muxing via libnut, + ;; native (de)muxer exists [no] + ;; --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no] + ;; --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no] + ;; --enable-libopencv enable video filtering via libopencv [no] + ;; --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no] + ;; --enable-librtmp enable RTMP[E] support via librtmp [no] + ;; --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no] + ;; --enable-libshine enable fixed-point MP3 encoding via libshine [no] + ;; --enable-libssh enable SFTP protocol via libssh [no] + ;; (libssh2 does not work) + ;; --enable-libstagefright-h264 enable H.264 decoding via libstagefright [no] + ;; --enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no] + ;; --enable-libv4l2 enable libv4l2/v4l-utils [no] + ;; --enable-libvidstab enable video stabilization using vid.stab [no] + ;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no] + ;; --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no] + ;; --enable-libwavpack enable wavpack encoding via libwavpack [no] + ;; --enable-libx264 enable H.264 encoding via x264 [no] + ;; --enable-libxavs enable AVS encoding via xavs [no] + ;; --enable-libzmq enable message passing via libzmq [no] + ;; --enable-libzvbi enable teletext support via libzvbi [no] + ;; --enable-opencl enable OpenCL code + ;; --enable-x11grab enable X11 grabbing [no] (zero? (system* "./configure" (string-append "--prefix=" out) @@ -410,18 +410,27 @@ standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).") "--disable-mips32r2" "--disable-mipsdspr1" "--disable-mipsdspr2" - "--disable-mipsfpu")))) - (alist-cons-after - 'strip 'add-lib-to-runpath - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib"))) - ;; Add LIB to the RUNPATH of all the executables and libraries. - (with-directory-excursion out - (for-each (cut augment-rpath <> lib) - (append (find-files "bin" ".*") - (find-files "lib" "\\.so\\..*\\.")))))) - %standard-phases)))) + "--disable-mipsfpu"))))) + (add-before + 'check 'set-ld-library-path + (lambda _ + ;; Allow $(top_builddir)/ffmpeg to find its dependencies when + ;; running tests. + (let* ((dso (find-files "." "\\.so$")) + (path (string-join (map dirname dso) ":"))) + (format #t "setting LD_LIBRARY_PATH to ~s~%" path) + (setenv "LD_LIBRARY_PATH" path) + #t))) + (add-after + 'strip 'add-lib-to-runpath + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib"))) + ;; Add LIB to the RUNPATH of all the executables and libraries. + (with-directory-excursion out + (for-each (cut augment-rpath <> lib) + (append (find-files "bin" ".*") + (find-files "lib" "\\.so\\..*\\.")))))))))) (home-page "http://www.ffmpeg.org/") (synopsis "Audio and video framework") (description "FFmpeg is a complete, cross-platform solution to record, @@ -444,7 +453,7 @@ audio/video codec library.") (define-public vlc (package (name "vlc") - (version "2.1.5") + (version "2.2.0") (source (origin (method url-fetch) (uri (string-append @@ -452,7 +461,7 @@ audio/video codec library.") version "/vlc-" version ".tar.xz")) (sha256 (base32 - "0whzbn7ahn5maarcwl1yhk9lq10b0q0y9w5pjl9kh3frdjmncrbg")))) + "05smn9hqdp7iscc1dj4cxp1mrlad7b50lhlnlqisfzf493i2f2jy")))) (build-system gnu-build-system) (native-inputs `(("git" ,git) ; needed for a test @@ -463,7 +472,7 @@ audio/video codec library.") ("avahi" ,avahi) ("dbus" ,dbus) ("flac" ,flac) - ("ffmpeg" ,ffmpeg-2.2) ; FIXME: vlc-2.1.5 won't work with ffmpeg-2.4 + ("ffmpeg" ,ffmpeg) ("fontconfig" ,fontconfig) ("freetype" ,freetype) ("gnutls" ,gnutls) @@ -775,12 +784,12 @@ several areas.") '(#:phases (modify-phases %standard-phases (add-before - configure setup-waf + 'configure 'setup-waf (lambda* (#:key inputs #:allow-other-keys) (copy-file (assoc-ref inputs "waf") "waf") (setenv "CC" "gcc"))) (add-before - configure patch-wscript + 'configure 'patch-wscript (lambda* (#:key inputs #:allow-other-keys) (substitute* "wscript" ;; XXX Remove this when our Samba package provides a .pc file. @@ -820,6 +829,8 @@ projects while introducing many more.") (lambda* (#:key outputs #:allow-other-keys) (setenv "CONFIG_SHELL" (which "bash")) (let ((out (assoc-ref outputs "out"))) + (setenv "LDFLAGS" + (string-append "-Wl,-rpath=" out "/lib")) (zero? (system* "./configure" "--enable-shared" "--as=yasm" @@ -1256,7 +1267,7 @@ capabilities.") '(#:phases (modify-phases %standard-phases (add-after - unpack autogen + 'unpack 'autogen (lambda _ (zero? (system* "sh" "autogen.sh"))))))) (home-page "http://www.vapoursynth.com/") diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 374642862a..c6a3938546 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -109,11 +109,11 @@ and its related documentation.") `(#:tests? #f ; no test target #:phases (modify-phases %standard-phases - (add-before configure patch-/bin/sh + (add-before 'configure 'patch-/bin/sh (lambda _ (substitute* "auto/feature" (("/bin/sh") (which "bash"))))) - (replace configure + (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let ((flags (list (string-append "--prefix=" (assoc-ref outputs "out")) @@ -138,7 +138,7 @@ and its related documentation.") (format #t "environment variable `CC' set to `gcc'~%") (format #t "configure flags: ~s~%" flags) (zero? (apply system* "./configure" flags))))) - (add-after install fix-root-dirs + (add-after 'install 'fix-root-dirs (lambda* (#:key outputs #:allow-other-keys) ;; 'make install' puts things in strange places, so we need to ;; clean it up ourselves. diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm index bdf153054e..5b0758c6b2 100644 --- a/gnu/packages/wine.scm +++ b/gnu/packages/wine.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014 Sou Bunnbu <iyzsong@gmail.com> +;;; Copyright © 2014, 2015 Sou Bunnbu <iyzsong@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -48,14 +48,14 @@ (define-public wine (package (name "wine") - (version "1.7.31") + (version "1.7.40") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/wine/" name "-" version ".tar.bz2")) (sha256 (base32 - "14747ihmyanxvv8mnrafbj3l6807h7zf1gcwidgm1f7s7g5n4viw")) + "1dnasmw1rnlz7wk1bn0x1zmy3r78hgrn9y53z4vm8xjkllwyd0hd")) (modules '((guix build utils))) (snippet '(substitute* "Make.vars.in" @@ -108,6 +108,9 @@ ;; pass. #:tests? #f + #:configure-flags + (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")) + #:phases (alist-cons-after 'configure 'patch-dlopen-paths diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm index a08f004119..b39b903e9b 100644 --- a/gnu/packages/xfce.scm +++ b/gnu/packages/xfce.scm @@ -569,9 +569,6 @@ on your desktop.") (guix build glib-or-gtk-build-system) (guix build utils) (srfi srfi-26)) - #:imported-modules ((guix build gnu-build-system) - (guix build glib-or-gtk-build-system) - (guix build utils)) #:phases (alist-replace 'install diff --git a/gnu/services/colord.scm b/gnu/services/colord.scm new file mode 100644 index 0000000000..588436002c --- /dev/null +++ b/gnu/services/colord.scm @@ -0,0 +1,72 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2015 Andy Wingo <wingo@igalia.com> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (gnu services colord) + #:use-module (gnu services) + #:use-module (gnu system shadow) + #:use-module (gnu packages gnome) + #:use-module (ice-9 match) + #:use-module (guix monads) + #:use-module (guix store) + #:use-module (guix gexp) + #:export (colord-service)) + +;;; Commentary: +;;; +;;; This module provides service definitions for the colord color management +;;; service. +;;; +;;; Code: + +(define* (colord-service #:key (colord colord)) + "Return a service that runs @command{colord}, a system service with a D-Bus +interface to manage the color profiles of input and output devices such as +screens and scanners. It is notably used by the GNOME Color Manager graphical +tool. See @uref{http://www.freedesktop.org/software/colord/, the colord web +site} for more information." + (with-monad %store-monad + (return + (service + (documentation "Run the colord color management service.") + (provision '(colord-daemon)) + (requirement '(dbus-system udev)) + + (start #~(make-forkexec-constructor + (list (string-append #$colord "/libexec/colord")))) + (stop #~(make-kill-destructor)) + (activate #~(begin + (use-modules (guix build utils)) + (mkdir-p "/var/lib/colord") + (let ((user (getpwnam "colord"))) + (chown "/var/lib/colord" + (passwd:uid user) (passwd:gid user))))) + + (user-groups (list (user-group + (name "colord") + (system? #t)))) + (user-accounts (list (user-account + (name "colord") + (group "colord") + (system? #t) + (comment "colord daemon user") + (home-directory "/var/empty") + (shell + "/run/current-system/profile/sbin/nologin")))))))) + +;;; colord.scm ends here diff --git a/gnu/services/upower.scm b/gnu/services/upower.scm new file mode 100644 index 0000000000..3654c812f1 --- /dev/null +++ b/gnu/services/upower.scm @@ -0,0 +1,122 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 Andy Wingo <wingo@igalia.com> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (gnu services upower) + #:use-module (gnu services) + #:use-module (gnu system shadow) + #:use-module (gnu packages gnome) + #:use-module (ice-9 match) + #:use-module (guix monads) + #:use-module (guix store) + #:use-module (guix gexp) + #:export (upower-service)) + +;;; Commentary: +;;; +;;; This module provides service definitions for the UPower power and battery +;;; monitoring service. +;;; +;;; Code: + +(define* (configuration-file #:key watts-up-pro? poll-batteries? ignore-lid? + use-percentage-for-policy? percentage-low + percentage-critical percentage-action + time-low time-critical time-action + critical-power-action) + "Return an upower-daemon configuration file." + (define (bool value) + (if value "true\n" "false\n")) + + (text-file "UPower.conf" + (string-append + "[UPower]\n" + "EnableWattsUpPro=" (bool watts-up-pro?) + "NoPollBatteries=" (bool (not poll-batteries?)) + "IgnoreLid=" (bool ignore-lid?) + "UsePercentageForPolicy=" (bool use-percentage-for-policy?) + "PercentageLow=" (number->string percentage-low) "\n" + "PercentageCritical=" (number->string percentage-critical) "\n" + "PercentageAction=" (number->string percentage-action) "\n" + "TimeLow=" (number->string time-low) "\n" + "TimeCritical=" (number->string time-critical) "\n" + "TimeAction=" (number->string time-action) "\n" + "CriticalPowerAction=" (match critical-power-action + ('hybrid-sleep "HybridSleep") + ('hibernate "Hibernate") + ('power-off "PowerOff")) + "\n"))) + +(define* (upower-service #:key (upower upower) + (watts-up-pro? #f) + (poll-batteries? #t) + (ignore-lid? #f) + (use-percentage-for-policy? #f) + (percentage-low 10) + (percentage-critical 3) + (percentage-action 2) + (time-low 1200) + (time-critical 300) + (time-action 120) + (critical-power-action 'hybrid-sleep)) + "Return a service that runs @uref{http://upower.freedesktop.org/, +@command{upowerd}}, a system-wide monitor for power consumption and battery +levels, with the given configuration settings. It implements the +@code{org.freedesktop.UPower} D-Bus interface, and is notably used by GNOME." + (mlet %store-monad ((config (configuration-file + #:watts-up-pro? watts-up-pro? + #:poll-batteries? poll-batteries? + #:ignore-lid? ignore-lid? + #:use-percentage-for-policy? use-percentage-for-policy? + #:percentage-low percentage-low + #:percentage-critical percentage-critical + #:percentage-action percentage-action + #:time-low time-low + #:time-critical time-critical + #:time-action time-action + #:critical-power-action critical-power-action))) + (return + (service + (documentation "Run the UPower power and battery monitor.") + (provision '(upower-daemon)) + (requirement '(dbus-system udev)) + + (start #~(make-forkexec-constructor + (list (string-append #$upower "/libexec/upowerd")) + #:environment-variables + (list (string-append "UPOWER_CONF_FILE_NAME=" #$config)))) + (stop #~(make-kill-destructor)) + (activate #~(begin + (use-modules (guix build utils)) + (mkdir-p "/var/lib/upower") + (let ((user (getpwnam "upower"))) + (chown "/var/lib/upower" + (passwd:uid user) (passwd:gid user))))) + + (user-groups (list (user-group + (name "upower") + (system? #t)))) + (user-accounts (list (user-account + (name "upower") + (group "upower") + (system? #t) + (comment "UPower daemon user") + (home-directory "/var/empty") + (shell + "/run/current-system/profile/sbin/nologin")))))))) + +;;; upower.scm ends here diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm index 0425e9fb39..2e6784251e 100644 --- a/guix/build-system/cmake.scm +++ b/guix/build-system/cmake.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com> ;;; ;;; This file is part of GNU Guix. @@ -25,7 +25,8 @@ #:use-module (guix build-system gnu) #:use-module (guix packages) #:use-module (ice-9 match) - #:export (cmake-build + #:export (%cmake-build-system-modules + cmake-build cmake-build-system)) ;; Commentary: @@ -35,6 +36,11 @@ ;; ;; Code: +(define %cmake-build-system-modules + ;; Build-side modules imported by default. + `((guix build cmake-build-system) + ,@%gnu-build-system-modules)) + (define (default-cmake) "Return the default CMake package." @@ -86,9 +92,7 @@ (phases '(@ (guix build cmake-build-system) %standard-phases)) (system (%current-system)) - (imported-modules '((guix build cmake-build-system) - (guix build gnu-build-system) - (guix build utils))) + (imported-modules %cmake-build-system-modules) (modules '((guix build cmake-build-system) (guix build utils)))) "Build SOURCE using CMAKE, and with INPUTS. This assumes that SOURCE diff --git a/guix/build-system/glib-or-gtk.scm b/guix/build-system/glib-or-gtk.scm index 7a90587136..85d01961a5 100644 --- a/guix/build-system/glib-or-gtk.scm +++ b/guix/build-system/glib-or-gtk.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com> ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch> ;;; @@ -26,7 +26,8 @@ #:use-module (guix build-system gnu) #:use-module (guix packages) #:use-module (ice-9 match) - #:export (glib-or-gtk-build + #:export (%glib-or-gtk-build-system-modules + glib-or-gtk-build glib-or-gtk-build-system)) ;; Commentary: @@ -67,11 +68,10 @@ '((guix build glib-or-gtk-build-system) (guix build utils))) -(define %default-imported-modules +(define %glib-or-gtk-build-system-modules ;; Build-side modules imported and used by default. - '((guix build gnu-build-system) - (guix build glib-or-gtk-build-system) - (guix build utils))) + `((guix build glib-or-gtk-build-system) + ,@%gnu-build-system-modules)) (define (default-glib) "Return the default glib package from which we use @@ -136,7 +136,7 @@ %standard-phases)) (glib-or-gtk-wrap-excluded-outputs ''()) (system (%current-system)) - (imported-modules %default-imported-modules) + (imported-modules %glib-or-gtk-build-system-modules) (modules %default-modules) allowed-references) "Build SOURCE with INPUTS. See GNU-BUILD for more details." diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index c91ad2ee0c..3ccdef1328 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -24,7 +24,8 @@ #:use-module (guix packages) #:use-module (srfi srfi-1) #:use-module (ice-9 match) - #:export (gnu-build + #:export (%gnu-build-system-modules + gnu-build gnu-build-system standard-packages package-with-explicit-inputs @@ -41,9 +42,16 @@ ;; ;; Code: -(define %default-modules +(define %gnu-build-system-modules ;; Build-side modules imported and used by default. '((guix build gnu-build-system) + (guix build utils) + (guix build gremlin) + (guix elf))) + +(define %default-modules + ;; Modules in scope in the build-side environment. + '((guix build gnu-build-system) (guix build utils))) (define* (package-with-explicit-inputs p inputs @@ -182,7 +190,7 @@ runs `make distcheck' and whose result is one or more source tarballs." (let* ((args (default-keyword-arguments (package-arguments p) `(#:phases #f #:modules ,%default-modules - #:imported-modules ,%default-modules)))) + #:imported-modules ,%gnu-build-system-modules)))) (substitute-keyword-arguments args ((#:modules modules) `((guix build gnu-dist) @@ -277,10 +285,11 @@ standard packages used as implicit inputs of the GNU build system." (strip-flags ''("--strip-debug")) (strip-directories ''("lib" "lib64" "libexec" "bin" "sbin")) + (validate-runpath? #t) (phases '%standard-phases) (locale "en_US.UTF-8") (system (%current-system)) - (imported-modules %default-modules) + (imported-modules %gnu-build-system-modules) (modules %default-modules) (substitutable? #t) allowed-references) @@ -339,6 +348,7 @@ are allowed to refer to." #:parallel-tests? ,parallel-tests? #:patch-shebangs? ,patch-shebangs? #:strip-binaries? ,strip-binaries? + #:validate-runpath? ,validate-runpath? #:strip-flags ,strip-flags #:strip-directories ,strip-directories))) @@ -411,13 +421,12 @@ is one of `host' or `target'." (strip-flags ''("--strip-debug")) (strip-directories ''("lib" "lib64" "libexec" "bin" "sbin")) + (validate-runpath? #t) (phases '%standard-phases) (locale "en_US.UTF-8") (system (%current-system)) - (imported-modules '((guix build gnu-build-system) - (guix build utils))) - (modules '((guix build gnu-build-system) - (guix build utils))) + (imported-modules %gnu-build-system-modules) + (modules %default-modules) (substitutable? #t) allowed-references) "Cross-build NAME for TARGET, where TARGET is a GNU triplet. INPUTS are @@ -486,6 +495,7 @@ platform." #:parallel-tests? ,parallel-tests? #:patch-shebangs? ,patch-shebangs? #:strip-binaries? ,strip-binaries? + #:validate-runpath? ,validate-runpath? #:strip-flags ,strip-flags #:strip-directories ,strip-directories)))) diff --git a/guix/build-system/haskell.scm b/guix/build-system/haskell.scm index 79faa5a09e..0fbf0b8e75 100644 --- a/guix/build-system/haskell.scm +++ b/guix/build-system/haskell.scm @@ -25,7 +25,8 @@ #:use-module (guix build-system gnu) #:use-module (ice-9 match) #:use-module (srfi srfi-26) - #:export (haskell-build + #:export (%haskell-build-system-modules + haskell-build haskell-build-system)) ;; Commentary: @@ -35,6 +36,11 @@ ;; ;; Code: +(define %haskell-build-system-modules + ;; Build-side modules imported by default. + `((guix build haskell-build-system) + ,@%gnu-build-system-modules)) + (define (default-haskell) "Return the default Haskell package." ;; Lazily resolve the binding to avoid a circular dependency. @@ -80,9 +86,7 @@ (search-paths '()) (system (%current-system)) (guile #f) - (imported-modules '((guix build haskell-build-system) - (guix build gnu-build-system) - (guix build utils))) + (imported-modules %haskell-build-system-modules) (modules '((guix build haskell-build-system) (guix build utils)))) "Build SOURCE using HASKELL, and with INPUTS. This assumes that SOURCE diff --git a/guix/build-system/perl.scm b/guix/build-system/perl.scm index e0f86438a8..7833153676 100644 --- a/guix/build-system/perl.scm +++ b/guix/build-system/perl.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,7 +24,8 @@ #:use-module (guix build-system gnu) #:use-module (guix packages) #:use-module (ice-9 match) - #:export (perl-build + #:export (%perl-build-system-modules + perl-build perl-build-system)) ;; Commentary: @@ -35,6 +36,11 @@ ;; ;; Code: +(define %perl-build-system-modules + ;; Build-side modules imported by default. + `((guix build perl-build-system) + ,@%gnu-build-system-modules)) + (define (default-perl) "Return the default Perl package." @@ -83,9 +89,7 @@ (outputs '("out")) (system (%current-system)) (guile #f) - (imported-modules '((guix build perl-build-system) - (guix build gnu-build-system) - (guix build utils))) + (imported-modules %perl-build-system-modules) (modules '((guix build perl-build-system) (guix build utils)))) "Build SOURCE using PERL, and with INPUTS. This assumes that SOURCE diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm index 37108650d0..d498cf618b 100644 --- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm @@ -27,7 +27,8 @@ #:use-module (guix build-system gnu) #:use-module (ice-9 match) #:use-module (srfi srfi-26) - #:export (package-with-python2 + #:export (%python-build-system-modules + package-with-python2 python-build python-build-system)) @@ -38,6 +39,11 @@ ;; ;; Code: +(define %python-build-system-modules + ;; Build-side modules imported by default. + `((guix build python-build-system) + ,@%gnu-build-system-modules)) + (define (default-python) "Return the default Python package." ;; Lazily resolve the binding to avoid a circular dependency. @@ -132,9 +138,7 @@ prepended to the name." (search-paths '()) (system (%current-system)) (guile #f) - (imported-modules '((guix build python-build-system) - (guix build gnu-build-system) - (guix build utils))) + (imported-modules %python-build-system-modules) (modules '((guix build python-build-system) (guix build utils)))) "Build SOURCE using PYTHON, and with INPUTS. This assumes that SOURCE diff --git a/guix/build-system/ruby.scm b/guix/build-system/ruby.scm index 08301ec609..83bc93d901 100644 --- a/guix/build-system/ruby.scm +++ b/guix/build-system/ruby.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014 David Thompson <davet@gnu.org> -;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,9 +25,15 @@ #:use-module (guix build-system) #:use-module (guix build-system gnu) #:use-module (ice-9 match) - #:export (ruby-build + #:export (%ruby-build-system-modules + ruby-build ruby-build-system)) +(define %ruby-build-system-modules + ;; Build-side modules imported by default. + `((guix build ruby-build-system) + ,@%gnu-build-system-modules)) + (define (default-ruby) "Return the default Ruby package." ;; Lazily resolve the binding to avoid a circular dependency. @@ -72,9 +78,7 @@ (search-paths '()) (system (%current-system)) (guile #f) - (imported-modules '((guix build ruby-build-system) - (guix build gnu-build-system) - (guix build utils))) + (imported-modules %ruby-build-system-modules) (modules '((guix build ruby-build-system) (guix build utils)))) "Build SOURCE using RUBY and INPUTS." diff --git a/guix/build-system/waf.scm b/guix/build-system/waf.scm index 494cb957ac..c67f649fa7 100644 --- a/guix/build-system/waf.scm +++ b/guix/build-system/waf.scm @@ -27,7 +27,8 @@ #:select (default-python default-python2)) #:use-module (ice-9 match) #:use-module (srfi srfi-26) - #:export (waf-build + #:export (%waf-build-system-modules + waf-build waf-build-system)) ;; Commentary: @@ -38,6 +39,11 @@ ;; ;; Code: +(define %waf-build-system-modules + ;; Build-side modules imported by default. + `((guix build waf-build-system) + ,@%gnu-build-system-modules)) + (define* (lower name #:key source inputs native-inputs outputs system target (python (default-python)) @@ -75,9 +81,7 @@ (search-paths '()) (system (%current-system)) (guile #f) - (imported-modules '((guix build waf-build-system) - (guix build gnu-build-system) - (guix build utils))) + (imported-modules %waf-build-system-modules) (modules '((guix build waf-build-system) (guix build utils)))) "Build SOURCE with INPUTS. This assumes that SOURCE provides a 'waf' file diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm index d8d437c653..f57622e0f4 100644 --- a/guix/build/cmake-build-system.scm +++ b/guix/build/cmake-build-system.scm @@ -73,8 +73,8 @@ ;; Everything is as with the GNU Build System except for the `configure' ;; and 'check' phases. (modify-phases gnu:%standard-phases - (replace check check) - (replace configure configure))) + (replace 'check check) + (replace 'configure configure))) (define* (cmake-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) diff --git a/guix/build/glib-or-gtk-build-system.scm b/guix/build/glib-or-gtk-build-system.scm index 40f1bb85fa..15d7de2236 100644 --- a/guix/build/glib-or-gtk-build-system.scm +++ b/guix/build/glib-or-gtk-build-system.scm @@ -242,9 +242,9 @@ needed." (define %standard-phases (modify-phases gnu:%standard-phases - (add-after install glib-or-gtk-compile-schemas compile-glib-schemas) - (add-after install glib-or-gtk-icon-cache generate-icon-cache) - (add-after install glib-or-gtk-wrap wrap-all-programs))) + (add-after 'install 'glib-or-gtk-compile-schemas compile-glib-schemas) + (add-after 'install 'glib-or-gtk-icon-cache generate-icon-cache) + (add-after 'install 'glib-or-gtk-wrap wrap-all-programs))) (define* (glib-or-gtk-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 5ae537150f..c60f8ba162 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -18,12 +18,15 @@ (define-module (guix build gnu-build-system) #:use-module (guix build utils) + #:use-module (guix build gremlin) + #:use-module (guix elf) #:use-module (ice-9 ftw) #:use-module (ice-9 match) #:use-module (ice-9 regex) #:use-module (ice-9 format) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (rnrs io ports) #:export (%standard-phases gnu-build)) @@ -398,6 +401,64 @@ makefiles." strip-directories))) outputs)))) +(define (every* pred lst) + "This is like 'every', but process all the elements of LST instead of +stopping as soon as PRED returns false. This is useful when PRED has side +effects, such as displaying warnings or error messages." + (let loop ((lst lst) + (result #t)) + (match lst + (() + result) + ((head . tail) + (loop tail (and (pred head) result)))))) + +(define* (validate-runpath #:key + validate-runpath? + (elf-directories '("lib" "lib64" "libexec" + "bin" "sbin")) + outputs #:allow-other-keys) + "When VALIDATE-RUNPATH? is true, validate that all the ELF files in +ELF-DIRECTORIES have their dependencies found in their 'RUNPATH'. + +Since the ELF parser needs to have a copy of files in memory, better run this +phase after stripping." + (define (sub-directory parent) + (lambda (directory) + (let ((directory (string-append parent "/" directory))) + (and (directory-exists? directory) directory)))) + + (define (validate directory) + (define (file=? file1 file2) + (let ((st1 (stat file1)) + (st2 (stat file2))) + (= (stat:ino st1) (stat:ino st2)))) + + ;; There are always symlinks from '.so' to '.so.1' and so on, so delete + ;; duplicates. + (let ((files (delete-duplicates (find-files directory (lambda (file stat) + (elf-file? file))) + file=?))) + (format (current-error-port) + "validating RUNPATH of ~a binaries in ~s...~%" + (length files) directory) + (every* validate-needed-in-runpath files))) + + (if validate-runpath? + (let ((dirs (append-map (match-lambda + (("debug" . _) + ;; The "debug" output is full of ELF files + ;; that are not worth checking. + '()) + ((name . output) + (filter-map (sub-directory output) + elf-directories))) + outputs))) + (every* validate dirs)) + (begin + (format (current-error-port) "skipping RUNPATH validation~%") + #t))) + (define* (validate-documentation-location #:key outputs #:allow-other-keys) "Documentation should go to 'share/info' and 'share/man', not just 'info/' @@ -477,6 +538,16 @@ DOCUMENTATION-COMPRESSOR-FLAGS." (format #t "not compressing documentation~%") #t))) +(define* (delete-info-dir-file #:key outputs #:allow-other-keys) + "Delete any 'share/info/dir' file from OUTPUTS." + (for-each (match-lambda + ((output . directory) + (let ((info-dir-file (string-append directory "/share/info/dir"))) + (when (file-exists? info-dir-file) + (delete-file info-dir-file))))) + outputs) + #t) + (define %standard-phases ;; Standard build phases, as a list of symbol/procedure pairs. (let-syntax ((phases (syntax-rules () @@ -486,7 +557,9 @@ DOCUMENTATION-COMPRESSOR-FLAGS." patch-source-shebangs configure patch-generated-file-shebangs build check install patch-shebangs strip + validate-runpath validate-documentation-location + delete-info-dir-file compress-documentation))) diff --git a/guix/build/gnu-dist.scm b/guix/build/gnu-dist.scm index 887b5e94e9..ad69c6cf16 100644 --- a/guix/build/gnu-dist.scm +++ b/guix/build/gnu-dist.scm @@ -83,10 +83,10 @@ (define %dist-phases ;; Phases for building a source tarball. (modify-phases %standard-phases - (delete strip) - (replace install install-dist) - (replace build build) - (add-before configure autoreconf autoreconf) - (replace unpack copy-source))) + (delete 'strip) + (replace 'install install-dist) + (replace 'build build) + (add-before 'configure 'autoreconf autoreconf) + (replace 'unpack copy-source))) ;;; gnu-dist.scm ends here diff --git a/guix/build/gremlin.scm b/guix/build/gremlin.scm index e8429129e1..30b06034dd 100644 --- a/guix/build/gremlin.scm +++ b/guix/build/gremlin.scm @@ -18,14 +18,22 @@ (define-module (guix build gremlin) #:use-module (guix elf) + #:use-module ((guix build utils) #:select (store-file-name?)) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:use-module (system foreign) #:use-module (rnrs bytevectors) #:use-module (rnrs io ports) - #:export (elf-dynamic-info + #:export (elf-error? + elf-error-elf + invalid-segment-size? + invalid-segment-size-segment + + elf-dynamic-info elf-dynamic-info? elf-dynamic-info-sopath elf-dynamic-info-needed @@ -41,12 +49,31 @@ ;;; ;;; Code: +(define-condition-type &elf-error &error + elf-error? + (elf elf-error-elf)) + +(define-condition-type &invalid-segment-size &elf-error + invalid-segment-size? + (segment invalid-segment-size-segment)) + + (define (dynamic-link-segment elf) "Return the 'PT_DYNAMIC' segment of ELF--i.e., the segment that contains dynamic linking information." - (find (lambda (segment) - (= (elf-segment-type segment) PT_DYNAMIC)) - (elf-segments elf))) + (let ((size (bytevector-length (elf-bytes elf)))) + (find (lambda (segment) + (unless (<= (+ (elf-segment-offset segment) + (elf-segment-filesz segment)) + size) + ;; This happens on separate debug output files created by + ;; 'strip --only-keep-debug' (Binutils 2.25.) + (raise (condition (&invalid-segment-size + (elf elf) + (segment segment))))) + + (= (elf-segment-type segment) PT_DYNAMIC)) + (elf-segments elf)))) (define (word-reader size byte-order) "Return a procedure to read a word of SIZE bytes according to BYTE-ORDER." @@ -197,6 +224,7 @@ value of DT_NEEDED entries is a string.)" "libc.so" "libdl.so" "libm.so" + "libnsl.so" ;NEEDED by nscd "libpthread.so" "libresolv.so" "librt.so" @@ -214,23 +242,42 @@ value of DT_NEEDED entries is a string.)" present in its RUNPATH, or if FILE lacks dynamic-link information. Return #f otherwise. Libraries whose name matches ALWAYS-FOUND? are considered to be always available." - (let* ((elf (call-with-input-file file - (compose parse-elf get-bytevector-all))) - (dyninfo (elf-dynamic-info elf))) - (when dyninfo - (let* ((runpath (elf-dynamic-info-runpath dyninfo)) - (needed (remove always-found? - (elf-dynamic-info-needed dyninfo))) - (not-found (remove (cut search-path runpath <>) - needed))) - (for-each (lambda (lib) - (format (current-error-port) - "error: '~a' depends on '~a', which cannot \ + (guard (c ((invalid-segment-size? c) + (let ((segment (invalid-segment-size-segment c))) + (format (current-error-port) + "~a: error: offset + size of segment ~a (type ~a) \ +exceeds total size~%" + file + (elf-segment-index segment) + (elf-segment-type segment)) + #f))) + + (let* ((elf (call-with-input-file file + (compose parse-elf get-bytevector-all))) + (dyninfo (elf-dynamic-info elf))) + (when dyninfo + (let* ((runpath (filter store-file-name? + (elf-dynamic-info-runpath dyninfo))) + (bogus (remove store-file-name? + (elf-dynamic-info-runpath dyninfo))) + (needed (remove always-found? + (elf-dynamic-info-needed dyninfo))) + (not-found (remove (cut search-path runpath <>) + needed))) + ;; XXX: $ORIGIN is not supported. + (unless (null? bogus) + (format (current-error-port) + "~a: warning: RUNPATH contains bogus entries: ~s~%" + file bogus)) + + (for-each (lambda (lib) + (format (current-error-port) + "~a: error: depends on '~a', which cannot \ be found in RUNPATH ~s~%" - file lib runpath)) - not-found) - ;; (when (null? not-found) - ;; (format (current-error-port) "~a is OK~%" file)) - (null? not-found))))) + file lib runpath)) + not-found) + ;; (when (null? not-found) + ;; (format (current-error-port) "~a is OK~%" file)) + (null? not-found)))))) ;;; gremlin.scm ends here diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm index e17967fb72..d382ee403d 100644 --- a/guix/build/haskell-build-system.scm +++ b/guix/build/haskell-build-system.scm @@ -196,13 +196,13 @@ generate the cache as it would clash in user profiles." (define %standard-phases (modify-phases gnu:%standard-phases - (add-before configure setup-compiler setup-compiler) - (add-before install haddock haddock) - (add-after install register register) - (replace install install) - (replace check check) - (replace build build) - (replace configure configure))) + (add-before 'configure 'setup-compiler setup-compiler) + (add-before 'install 'haddock haddock) + (add-after 'install 'register register) + (replace 'install install) + (replace 'check check) + (replace 'build build) + (replace 'configure configure))) (define* (haskell-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) diff --git a/guix/build/perl-build-system.scm b/guix/build/perl-build-system.scm index 9ca5353bb9..8f480eae16 100644 --- a/guix/build/perl-build-system.scm +++ b/guix/build/perl-build-system.scm @@ -72,10 +72,10 @@ ;; Everything is as with the GNU Build System except for the `configure', ;; `build', `check', and `install' phases. (modify-phases gnu:%standard-phases - (replace install install) - (replace check check) - (replace build build) - (replace configure configure))) + (replace 'install install) + (replace 'check check) + (replace 'build build) + (replace 'configure configure))) (define* (perl-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm index 9f853134bd..26a7254db9 100644 --- a/guix/build/python-build-system.scm +++ b/guix/build/python-build-system.scm @@ -123,12 +123,12 @@ installed with setuptools." ;; 'configure' and 'build' phases are not needed. Everything is done during ;; 'install'. (modify-phases gnu:%standard-phases - (delete configure) - (replace install install) - (replace check check) - (replace build build) - (add-after install wrap wrap) - (add-before strip rename-pth-file rename-pth-file))) + (delete 'configure) + (replace 'install install) + (replace 'check check) + (replace 'build build) + (add-after 'install 'wrap wrap) + (add-before 'strip 'rename-pth-file rename-pth-file))) (define* (python-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm index a143df467f..531cf382ae 100644 --- a/guix/build/ruby-build-system.scm +++ b/guix/build/ruby-build-system.scm @@ -72,11 +72,11 @@ directory." (define %standard-phases (modify-phases gnu:%standard-phases - (delete configure) - (add-after unpack gitify gitify) - (replace build build) - (replace install install) - (replace check check))) + (delete 'configure) + (add-after 'unpack 'gitify gitify) + (replace 'build build) + (replace 'install install) + (replace 'check check))) (define* (ruby-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index a5a6167a8c..676a0120e3 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -32,6 +32,7 @@ #:re-export (alist-cons alist-delete) #:export (%store-directory + store-file-name? parallel-job-count directory-exists? @@ -44,6 +45,7 @@ mkdir-p copy-recursively delete-file-recursively + file-name-predicate find-files search-path-as-list @@ -80,6 +82,10 @@ (or (getenv "NIX_STORE") "/gnu/store")) +(define (store-file-name? file) + "Return true if FILE is in the store." + (string-prefix? (%store-directory) file)) + (define parallel-job-count ;; Number of processes to be passed next to GNU Make's `-j' argument. (make-parameter @@ -263,33 +269,46 @@ errors." ;; Don't follow symlinks. lstat))) -(define (find-files dir regexp) - "Return the lexicographically sorted list of files under DIR whose basename -matches REGEXP." - (define file-rx - (if (regexp? regexp) - regexp - (make-regexp regexp))) - - ;; Sort the result to get deterministic results. - (sort (file-system-fold (const #t) - (lambda (file stat result) ; leaf - (if (regexp-exec file-rx (basename file)) - (cons file result) - result)) - (lambda (dir stat result) ; down - result) - (lambda (dir stat result) ; up - result) - (lambda (file stat result) ; skip - result) - (lambda (file stat errno result) - (format (current-error-port) "find-files: ~a: ~a~%" - file (strerror errno)) - result) - '() - dir) - string<?)) +(define (file-name-predicate regexp) + "Return a predicate that returns true when passed a file name whose base +name matches REGEXP." + (let ((file-rx (if (regexp? regexp) + regexp + (make-regexp regexp)))) + (lambda (file stat) + (regexp-exec file-rx (basename file))))) + +(define* (find-files dir #:optional (pred (const #t)) + #:key (stat lstat)) + "Return the lexicographically sorted list of files under DIR for which PRED +returns true. PRED is passed two arguments: the absolute file name, and its +stat buffer; the default predicate always returns true. PRED can also be a +regular expression, in which case it is equivalent to (file-name-predicate +PRED). STAT is used to obtain file information; using 'lstat' means that +symlinks are not followed." + (let ((pred (if (procedure? pred) + pred + (file-name-predicate pred)))) + ;; Sort the result to get deterministic results. + (sort (file-system-fold (const #t) + (lambda (file stat result) ; leaf + (if (pred file stat) + (cons file result) + result)) + (lambda (dir stat result) ; down + result) + (lambda (dir stat result) ; up + result) + (lambda (file stat result) ; skip + result) + (lambda (file stat errno result) + (format (current-error-port) "find-files: ~a: ~a~%" + file (strerror errno)) + result) + '() + dir + stat) + string<?))) ;;; @@ -446,13 +465,13 @@ an expression evaluating to a procedure." (define-syntax %modify-phases (syntax-rules (delete replace add-before add-after) ((_ phases (delete old-phase-name)) - (alist-delete 'old-phase-name phases)) + (alist-delete old-phase-name phases)) ((_ phases (replace old-phase-name new-phase)) - (alist-replace 'old-phase-name new-phase phases)) + (alist-replace old-phase-name new-phase phases)) ((_ phases (add-before old-phase-name new-phase-name new-phase)) - (alist-cons-before 'old-phase-name 'new-phase-name new-phase phases)) + (alist-cons-before old-phase-name new-phase-name new-phase phases)) ((_ phases (add-after old-phase-name new-phase-name new-phase)) - (alist-cons-after 'old-phase-name 'new-phase-name new-phase phases)))) + (alist-cons-after old-phase-name new-phase-name new-phase phases)))) ;;; diff --git a/guix/build/waf-build-system.scm b/guix/build/waf-build-system.scm index d172c5a836..85f0abcfd6 100644 --- a/guix/build/waf-build-system.scm +++ b/guix/build/waf-build-system.scm @@ -70,10 +70,10 @@ (define %standard-phases (modify-phases gnu:%standard-phases - (replace configure configure) - (replace build build) - (replace check check) - (replace install install))) + (replace 'configure configure) + (replace 'build build) + (replace 'check check) + (replace 'install install))) (define* (waf-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) diff --git a/guix/cvs-download.scm b/guix/cvs-download.scm index 8a0d479fa4..72478dd2c2 100644 --- a/guix/cvs-download.scm +++ b/guix/cvs-download.scm @@ -66,7 +66,7 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f." '#$(cvs-reference-module ref) '#$(cvs-reference-revision ref) #$output - #:cvs-command (string-append #$cvs "/bin/cvs")))) + #:cvs-command (string-append #+cvs "/bin/cvs")))) (mlet %store-monad ((guile (package->derivation guile system))) (gexp->derivation (or name "cvs-checkout") build diff --git a/guix/download.scm b/guix/download.scm index d87d02e2af..3e4024fe1f 100644 --- a/guix/download.scm +++ b/guix/download.scm @@ -241,12 +241,12 @@ in the store." (define builder #~(begin - #$(if need-gnutls? + #+(if need-gnutls? ;; Add GnuTLS to the inputs and to the load path. #~(eval-when (load expand eval) (set! %load-path - (cons (string-append #$(gnutls-package) + (cons (string-append #+(gnutls-package) "/share/guile/site/" (effective-version)) %load-path))) diff --git a/guix/git-download.scm b/guix/git-download.scm index 94a1245480..f4b48d7a6b 100644 --- a/guix/git-download.scm +++ b/guix/git-download.scm @@ -76,7 +76,7 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f." ;; The 'git submodule' commands expects Coreutils, sed, ;; grep, etc. to be in $PATH. (set-path-environment-variable "PATH" '("bin") - (match '#$inputs + (match '#+inputs (((names dirs) ...) dirs))) @@ -84,7 +84,7 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f." '#$(git-reference-commit ref) #$output #:recursive? '#$(git-reference-recursive? ref) - #:git-command (string-append #$git "/bin/git")))) + #:git-command (string-append #+git "/bin/git")))) (mlet %store-monad ((guile (package->derivation guile system))) (gexp->derivation (or name "git-checkout") build diff --git a/guix/packages.scm b/guix/packages.scm index ec0e79d08b..8ebe8d06b5 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -26,6 +26,7 @@ #:use-module (guix base32) #:use-module (guix derivations) #:use-module (guix build-system) + #:use-module (guix gexp) #:use-module (ice-9 match) #:use-module (ice-9 vlist) #:use-module (srfi srfi-1) @@ -106,6 +107,7 @@ package->bag bag->derivation + bag-direct-inputs bag-transitive-inputs bag-transitive-host-inputs bag-transitive-build-inputs @@ -334,8 +336,10 @@ corresponds to the arguments expected by `set-path-environment-variable'." ("bzip2" ,(ref '(gnu packages compression) 'bzip2)) ("gzip" ,(ref '(gnu packages compression) 'gzip)) ("lzip" ,(ref '(gnu packages compression) 'lzip)) + ("unzip" ,(ref '(gnu packages zip) 'unzip)) ("patch" ,(ref '(gnu packages base) 'patch)) - ("locales" ,(ref '(gnu packages base) 'glibc-utf8-locales))))) + ("locales" ,(ref '(gnu packages commencement) + 'glibc-utf8-locales-final))))) (define (default-guile) "Return the default Guile package used to run the build code of @@ -349,10 +353,9 @@ the build code of derivation." (package->derivation (default-guile) system #:graft? #f)) -;; TODO: Rewrite using %STORE-MONAD and gexps. -(define* (patch-and-repack store source patches +(define* (patch-and-repack source patches #:key - (inputs '()) + inputs (snippet #f) (flags '("-p1")) (modules '()) @@ -370,10 +373,20 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET." (derivation->output-path source) source)) + (define lookup-input + ;; The default value of the 'patch-inputs' field, and thus INPUTS is #f, + ;; so deal with that. + (let ((inputs (or inputs (%standard-patch-inputs)))) + (lambda (name) + (match (assoc-ref inputs name) + ((package) package) + (#f #f))))) + (define decompression-type (cond ((string-suffix? "gz" source-file-name) "gzip") ((string-suffix? "bz2" source-file-name) "bzip2") ((string-suffix? "lz" source-file-name) "lzip") + ((string-suffix? "zip" source-file-name) "unzip") (else "xz"))) (define original-file-name @@ -398,115 +411,95 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET." ".xz" ".tar.xz")))) - (define patch-inputs - (map (lambda (number patch) - (list (string-append "patch" (number->string number)) - (match patch - ((? string?) - (add-to-store store (basename patch) #t - "sha256" patch)) - ((? origin?) - (package-source-derivation store patch system))))) - (iota (length patches)) - - patches)) - - (define builder - `(begin - (use-modules (ice-9 ftw) - (srfi srfi-1) - (guix build utils)) - - ;; Encoding/decoding errors shouldn't be silent. - (fluid-set! %default-port-conversion-strategy 'error) - - (let ((locales (assoc-ref %build-inputs "locales")) - (out (assoc-ref %outputs "out")) - (xz (assoc-ref %build-inputs "xz")) - (decomp (assoc-ref %build-inputs ,decompression-type)) - (source (assoc-ref %build-inputs "source")) - (tar (string-append (assoc-ref %build-inputs "tar") - "/bin/tar")) - (patch (string-append (assoc-ref %build-inputs "patch") - "/bin/patch"))) - (define (apply-patch input) - (let ((patch* (assoc-ref %build-inputs input))) - (format (current-error-port) "applying '~a'...~%" patch*) - - ;; Use '--force' so that patches that do not apply perfectly are - ;; rejected. - (zero? (system* patch "--force" ,@flags "--input" patch*)))) - - (define (first-file directory) - ;; Return the name of the first file in DIRECTORY. - (car (scandir directory - (lambda (name) - (not (member name '("." ".."))))))) - - (when locales - ;; First of all, install a UTF-8 locale so that UTF-8 file names - ;; are correctly interpreted. During bootstrap, LOCALES is #f. - (setenv "LOCPATH" (string-append locales "/lib/locale")) - (setlocale LC_ALL "en_US.UTF-8")) - - (setenv "PATH" (string-append xz "/bin" ":" - decomp "/bin")) - - ;; SOURCE may be either a directory or a tarball. - (and (if (file-is-directory? source) - (let* ((store (or (getenv "NIX_STORE") "/gnu/store")) - (len (+ 1 (string-length store))) - (base (string-drop source len)) - (dash (string-index base #\-)) - (directory (string-drop base (+ 1 dash)))) - (mkdir directory) - (copy-recursively source directory) - #t) - (zero? (system* tar "xvf" source))) - (let ((directory (first-file "."))) - (format (current-error-port) - "source is under '~a'~%" directory) - (chdir directory) - - (and (every apply-patch ',(map car patch-inputs)) - - ,@(if snippet - `((let ((module (make-fresh-user-module))) - (module-use-interfaces! module - (map resolve-interface - ',modules)) - (module-define! module '%build-inputs - %build-inputs) - (module-define! module '%outputs %outputs) - ((@ (system base compile) compile) - ',snippet - #:to 'value - #:opts %auto-compilation-options - #:env module))) - '()) - - (begin (chdir "..") #t) - (zero? (system* tar "cvfa" out directory)))))))) - - - (let ((name (tarxz-name original-file-name)) - (inputs (filter-map (match-lambda - ((name (? package? p)) - (and (member name (cons decompression-type - '("tar" "xz" "patch"))) - (list name - (package-derivation store p system - #:graft? #f))))) - (or inputs (%standard-patch-inputs)))) - (modules (delete-duplicates (cons '(guix build utils) modules)))) - - (build-expression->derivation store name builder - #:inputs `(("source" ,source) - ,@inputs - ,@patch-inputs) - #:system system - #:modules modules - #:guile-for-build guile-for-build))) + (define instantiate-patch + (match-lambda + ((? string? patch) + (interned-file patch #:recursive? #t)) + ((? origin? patch) + (origin->derivation patch system)))) + + (mlet %store-monad ((tar -> (lookup-input "tar")) + (xz -> (lookup-input "xz")) + (patch -> (lookup-input "patch")) + (locales -> (lookup-input "locales")) + (decomp -> (lookup-input decompression-type)) + (patches (sequence %store-monad + (map instantiate-patch patches)))) + (define build + #~(begin + (use-modules (ice-9 ftw) + (srfi srfi-1) + (guix build utils)) + + (define (apply-patch patch) + (format (current-error-port) "applying '~a'...~%" patch) + + ;; Use '--force' so that patches that do not apply perfectly are + ;; rejected. + (zero? (system* (string-append #+patch "/bin/patch") + "--force" #+@flags "--input" patch))) + + (define (first-file directory) + ;; Return the name of the first file in DIRECTORY. + (car (scandir directory + (lambda (name) + (not (member name '("." ".."))))))) + + ;; Encoding/decoding errors shouldn't be silent. + (fluid-set! %default-port-conversion-strategy 'error) + + (when #+locales + ;; First of all, install a UTF-8 locale so that UTF-8 file names + ;; are correctly interpreted. During bootstrap, LOCALES is #f. + (setenv "LOCPATH" (string-append #+locales "/lib/locale")) + (setlocale LC_ALL "en_US.UTF-8")) + + (setenv "PATH" (string-append #+xz "/bin" ":" + #+decomp "/bin")) + + ;; SOURCE may be either a directory or a tarball. + (and (if (file-is-directory? #+source) + (let* ((store (or (getenv "NIX_STORE") "/gnu/store")) + (len (+ 1 (string-length store))) + (base (string-drop #+source len)) + (dash (string-index base #\-)) + (directory (string-drop base (+ 1 dash)))) + (mkdir directory) + (copy-recursively #+source directory) + #t) + #+(if (string=? decompression-type "unzip") + #~(zero? (system* "unzip" #+source)) + #~(zero? (system* (string-append #+tar "/bin/tar") + "xvf" #+source)))) + (let ((directory (first-file "."))) + (format (current-error-port) + "source is under '~a'~%" directory) + (chdir directory) + + (and (every apply-patch '#+patches) + #+@(if snippet + #~((let ((module (make-fresh-user-module))) + (module-use-interfaces! module + (map resolve-interface + '#+modules)) + ((@ (system base compile) compile) + '#+snippet + #:to 'value + #:opts %auto-compilation-options + #:env module))) + #~()) + + (begin (chdir "..") #t) + (zero? (system* (string-append #+tar "/bin/tar") + "cvfa" #$output directory))))))) + + (let ((name (tarxz-name original-file-name)) + (modules (delete-duplicates (cons '(guix build utils) modules)))) + (gexp->derivation name build + #:graft? #f + #:system system + #:modules modules + #:guile-for-build guile-for-build)))) (define (transitive-inputs inputs) (let loop ((inputs inputs) @@ -586,13 +579,17 @@ supported by its dependencies." (_ systems))) (package-supported-systems package) - (package-direct-inputs package))) + (bag-direct-inputs (package->bag package)))) + +(define (bag-direct-inputs bag) + "Same as 'package-direct-inputs', but applied to a bag." + (append (bag-build-inputs bag) + (bag-host-inputs bag) + (bag-target-inputs bag))) (define (bag-transitive-inputs bag) "Same as 'package-transitive-inputs', but applied to a bag." - (transitive-inputs (append (bag-build-inputs bag) - (bag-host-inputs bag) - (bag-target-inputs bag)))) + (transitive-inputs (bag-direct-inputs bag))) (define (bag-transitive-build-inputs bag) "Same as 'package-transitive-native-inputs', but applied to a bag." @@ -954,9 +951,6 @@ cross-compilation target triplet." (package->cross-derivation package target system) (package->derivation package system))) -(define patch-and-repack* - (store-lift patch-and-repack)) - (define* (origin->derivation source #:optional (system (%current-system))) "When SOURCE is an <origin> object, return its derivation for SYSTEM. When @@ -976,14 +970,14 @@ outside of the store) or SOURCE itself (if SOURCE is already a store item.)" (default-guile)) system #:graft? #f))) - (patch-and-repack* source patches - #:inputs inputs - #:snippet snippet - #:flags flags - #:system system - #:modules modules - #:imported-modules modules - #:guile-for-build guile))) + (patch-and-repack source patches + #:inputs inputs + #:snippet snippet + #:flags flags + #:system system + #:modules modules + #:imported-modules modules + #:guile-for-build guile))) ((and (? string?) (? direct-store-path?) file) (with-monad %store-monad (return file))) diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm index c40d76b558..cced1bda66 100644 --- a/guix/scripts/lint.scm +++ b/guix/scripts/lint.scm @@ -19,6 +19,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (guix scripts lint) + #:use-module (guix store) #:use-module (guix base32) #:use-module (guix download) #:use-module (guix ftp-client) @@ -32,6 +33,8 @@ #:use-module (ice-9 regex) #:use-module (ice-9 format) #:use-module (web uri) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:use-module ((guix build download) #:select (maybe-expand-mirrors open-connection-for-uri)) @@ -41,12 +44,15 @@ #:use-module (srfi srfi-9) #:use-module (srfi srfi-11) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:use-module (srfi srfi-37) #:export (guix-lint check-description-style check-inputs-should-be-native - check-patches + check-patch-file-names check-synopsis-style + check-derivation check-home-page check-source)) @@ -348,26 +354,30 @@ warning for PACKAGE mentionning the FIELD." (package-home-page package)) 'home-page))))) -(define (check-patches package) - ;; Emit a warning if the patches requires by PACKAGE are badly named. - (let ((patches (and=> (package-source package) origin-patches)) - (name (package-name package)) - (full-name (package-full-name package))) - (when (and patches - (any (match-lambda - ((? string? patch) - (let ((filename (basename patch))) - (not (or (eq? (string-contains filename name) 0) - (eq? (string-contains filename full-name) - 0))))) - (_ - ;; This must be an <origin> or something like that. - #f)) - patches)) - (emit-warning package - (_ "file names of patches should start with \ +(define (check-patch-file-names package) + "Emit a warning if the patches requires by PACKAGE are badly named or if the +patch could not be found." + (guard (c ((message-condition? c) ;raised by 'search-patch' + (emit-warning package (condition-message c) + 'patch-file-names))) + (let ((patches (and=> (package-source package) origin-patches)) + (name (package-name package)) + (full-name (package-full-name package))) + (when (and patches + (any (match-lambda + ((? string? patch) + (let ((file (basename patch))) + (not (or (eq? (string-contains file name) 0) + (eq? (string-contains file full-name) + 0))))) + (_ + ;; This must be an <origin> or something like that. + #f)) + patches)) + (emit-warning package + (_ "file names of patches should start with \ the package name") - 'patches)))) + 'patch-file-names))))) (define (escape-quotes str) "Replace any quote character in STR by an escaped quote character." @@ -434,6 +444,25 @@ descriptions maintained upstream." (append-map (cut maybe-expand-mirrors <> %mirrors) uris)))))) +(define (check-derivation package) + "Emit a warning if we fail to compile PACKAGE to a derivation." + (catch #t + (lambda () + (guard (c ((nix-protocol-error? c) + (emit-warning package + (format #f (_ "failed to create derivation: ~a") + (nix-protocol-error-message c)))) + ((message-condition? c) + (emit-warning package + (format #f (_ "failed to create derivation: ~a") + (condition-message c))))) + (with-store store + (package-derivation store package)))) + (lambda args + (emit-warning package + (format #f (_ "failed to create derivation: ~s~%") + args))))) + ;;; @@ -455,9 +484,9 @@ descriptions maintained upstream." (description "Identify inputs that should be native inputs") (check check-inputs-should-be-native)) (lint-checker - (name 'patch-filenames) - (description "Validate file names of patches") - (check check-patches)) + (name 'patch-file-names) + (description "Validate file names and availability of patches") + (check check-patch-file-names)) (lint-checker (name 'home-page) (description "Validate home-page URLs") @@ -467,6 +496,10 @@ descriptions maintained upstream." (description "Validate source URLs") (check check-source)) (lint-checker + (name 'derivation) + (description "Report failure to compile a package to a derivation") + (check check-derivation)) + (lint-checker (name 'synopsis) (description "Validate package synopses") (check check-synopsis-style)))) diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index 04886499a2..28519d78e2 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> ;;; @@ -207,16 +207,13 @@ update would trigger a complete rebuild." (list-dependent? (assoc-ref opts 'list-dependent?)) (key-download (assoc-ref opts 'key-download)) (packages - (match (concatenate - (filter-map (match-lambda - (('argument . value) - (let ((p (find-packages-by-name value))) - (when (null? p) - (leave (_ "~a: no package by that name~%") - value)) - p)) + (match (filter-map (match-lambda + (('argument . spec) + ;; Take either the specified version or the + ;; latest one. + (specification->package spec)) (_ #f)) - opts)) + opts) (() ; default to all packages (let ((select? (match (assoc-ref opts 'select) ('core core-package?) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 1b64e6fb92..1838e89452 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -69,21 +69,7 @@ (set-current-module %user-module) (primitive-load file)))) (lambda args - (match args - (('system-error . _) - (let ((err (system-error-errno args))) - (leave (_ "failed to open operating system file '~a': ~a~%") - file (strerror err)))) - (('syntax-error proc message properties form . rest) - (let ((loc (source-properties->location properties))) - (format (current-error-port) (_ "~a: error: ~a~%") - (location->string loc) message) - (exit 1))) - ((error args ...) - (report-error (_ "failed to load operating system file '~a':~%") - file) - (apply display-error #f (current-error-port) args) - (exit 1)))))) + (report-load-error file args)))) ;;; diff --git a/guix/svn-download.scm b/guix/svn-download.scm index 92b03d13f3..d6853ca861 100644 --- a/guix/svn-download.scm +++ b/guix/svn-download.scm @@ -62,7 +62,7 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f." (svn-fetch '#$(svn-reference-url ref) '#$(svn-reference-revision ref) #$output - #:svn-command (string-append #$svn "/bin/svn")))) + #:svn-command (string-append #+svn "/bin/svn")))) (mlet %store-monad ((guile (package->derivation guile system))) (gexp->derivation (or name "svn-checkout") build diff --git a/guix/ui.scm b/guix/ui.scm index 67c65aa14d..5ca5afe457 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -47,6 +47,8 @@ P_ report-error leave + report-load-error + warn-about-load-error show-version-and-exit show-bug-report-information string->number* @@ -130,6 +132,38 @@ messages." (report-error args ...) (exit 1))) +(define (report-load-error file args) + "Report the failure to load FILE, a user-provided Scheme file, and exit. +ARGS is the list of arguments received by the 'throw' handler." + (match args + (('system-error . _) + (let ((err (system-error-errno args))) + (leave (_ "failed to load '~a': ~a~%") file (strerror err)))) + (('syntax-error proc message properties form . rest) + (let ((loc (source-properties->location properties))) + (format (current-error-port) (_ "~a: error: ~a~%") + (location->string loc) message) + (exit 1))) + ((error args ...) + (report-error (_ "failed to load '~a':~%") file) + (apply display-error #f (current-error-port) args) + (exit 1)))) + +(define (warn-about-load-error file args) ;FIXME: factorize with ↑ + "Report the failure to load FILE, a user-provided Scheme file, without +exiting. ARGS is the list of arguments received by the 'throw' handler." + (match args + (('system-error . _) + (let ((err (system-error-errno args))) + (warning (_ "failed to load '~a': ~a~%") file (strerror err)))) + (('syntax-error proc message properties form . rest) + (let ((loc (source-properties->location properties))) + (format (current-error-port) (_ "~a: warning: ~a~%") + (location->string loc) message))) + ((error args ...) + (warning (_ "failed to load '~a':~%") file) + (apply display-error #f (current-error-port) args)))) + (define (install-locale) "Install the current locale settings." (catch 'system-error diff --git a/tests/lint.scm b/tests/lint.scm index 2312b80934..2807eba1cc 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -301,9 +301,34 @@ requests." (uri "someurl") (sha256 "somesha") (patches (list "/path/to/y.patch"))))))) - (check-patches pkg))) + (check-patch-file-names pkg))) "file names of patches should start with the package name"))) +(test-assert "patches: not found" + (->bool + (string-contains + (with-warnings + (let ((pkg (dummy-package "x" + (source + (origin + (method url-fetch) + (uri "someurl") + (sha256 "somesha") + (patches + (list (search-patch "this-patch-does-not-exist!")))))))) + (check-patch-file-names pkg))) + "patch not found"))) + +(test-assert "derivation: invalid arguments" + (->bool + (string-contains + (with-warnings + (let ((pkg (dummy-package "x" + (arguments + '(#:imported-modules (invalid-module)))))) + (check-derivation pkg))) + "failed to create derivation"))) + (test-assert "home-page: wrong home-page" (->bool (string-contains diff --git a/tests/packages.scm b/tests/packages.scm index d7c169a585..3007b50b92 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -128,21 +128,44 @@ ("y") ;c ("y") ;d ("y")) ;e - (let* ((a (dummy-package "a" (supported-systems '("x" "y" "z")))) - (b (dummy-package "b" (supported-systems '("x" "y")) - (inputs `(("a" ,a))))) - (c (dummy-package "c" (supported-systems '("y" "z")) - (inputs `(("b" ,b))))) - (d (dummy-package "d" (supported-systems '("x" "y" "z")) - (inputs `(("b" ,b) ("c" ,c))))) - (e (dummy-package "e" (supported-systems '("x" "y" "z")) - (inputs `(("d" ,d)))))) + ;; Use TRIVIAL-BUILD-SYSTEM because it doesn't add implicit inputs and thus + ;; doesn't restrict the set of supported systems. + (let* ((a (dummy-package "a" + (build-system trivial-build-system) + (supported-systems '("x" "y" "z")))) + (b (dummy-package "b" + (build-system trivial-build-system) + (supported-systems '("x" "y")) + (inputs `(("a" ,a))))) + (c (dummy-package "c" + (build-system trivial-build-system) + (supported-systems '("y" "z")) + (inputs `(("b" ,b))))) + (d (dummy-package "d" + (build-system trivial-build-system) + (supported-systems '("x" "y" "z")) + (inputs `(("b" ,b) ("c" ,c))))) + (e (dummy-package "e" + (build-system trivial-build-system) + (supported-systems '("x" "y" "z")) + (inputs `(("d" ,d)))))) (list (package-transitive-supported-systems a) (package-transitive-supported-systems b) (package-transitive-supported-systems c) (package-transitive-supported-systems d) (package-transitive-supported-systems e)))) +(test-equal "package-transitive-supported-systems, implicit inputs" + %supported-systems + + ;; Here GNU-BUILD-SYSTEM adds implicit inputs that build only on + ;; %SUPPORTED-SYSTEMS. Thus the others must be ignored. + (let ((p (dummy-package "foo" + (build-system gnu-build-system) + (supported-systems + `("does-not-exist" "foobar" ,@%supported-systems))))) + (package-transitive-supported-systems p))) + (test-skip (if (not %store) 8 0)) (test-assert "package-source-derivation, file" @@ -205,10 +228,7 @@ (chmod "." #o777) (symlink "guile" "guile-rocks") (copy-recursively "../share/guile/2.0/scripts" - "scripts") - - ;; These variables must exist. - (pk %build-inputs %outputs)))))) + "scripts")))))) (package (package (inherit (dummy-package "with-snippet")) (source source) (build-system trivial-build-system) |