From 5d80dd0823bab8483b31aea341d2ecabf54c3a23 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 26 Jan 2014 23:52:59 +0100 Subject: gnu: Add asciidoc. * gnu/packages/asciidoc.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. --- gnu-system.am | 1 + 1 file changed, 1 insertion(+) (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index a49b482549..473346c6ee 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -29,6 +29,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/algebra.scm \ gnu/packages/apl.scm \ gnu/packages/apr.scm \ + gnu/packages/asciidoc.scm \ gnu/packages/aspell.scm \ gnu/packages/attr.scm \ gnu/packages/autogen.scm \ -- cgit v1.2.3 From 735c6dd7faec036adbfa44d927c823ffa9ea1243 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 29 Jan 2014 13:04:00 +0100 Subject: gnu: Lower initrd makers from packages to monadic procedures. * gnu/packages/linux-initrd.scm: Remove. * gnu/system/linux-initrd.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Adjust accordingly. * gnu/system.scm (): Change default 'initrd' value to (gnu-system-initrd). (operating-system-derivation): Bind 'operating-system-initrd'. Pass 'menu-entry' an initrd file name instead of a package. * gnu/system/grub.scm (grub-configuration-file): Expect 'initrd' to be file name. --- gnu-system.am | 2 +- gnu/packages/linux-initrd.scm | 411 ------------------------------------------ gnu/system.scm | 15 +- gnu/system/grub.scm | 7 +- gnu/system/linux-initrd.scm | 360 ++++++++++++++++++++++++++++++++++++ gnu/system/vm.scm | 17 +- 6 files changed, 381 insertions(+), 431 deletions(-) delete mode 100644 gnu/packages/linux-initrd.scm create mode 100644 gnu/system/linux-initrd.scm (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 473346c6ee..1f7327e865 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -128,7 +128,6 @@ GNU_SYSTEM_MODULES = \ gnu/packages/libunwind.scm \ gnu/packages/lightning.scm \ gnu/packages/linux.scm \ - gnu/packages/linux-initrd.scm \ gnu/packages/lout.scm \ gnu/packages/lsh.scm \ gnu/packages/lsof.scm \ @@ -221,6 +220,7 @@ GNU_SYSTEM_MODULES = \ gnu/system/dmd.scm \ gnu/system/grub.scm \ gnu/system/linux.scm \ + gnu/system/linux-initrd.scm \ gnu/system/shadow.scm \ gnu/system/vm.scm diff --git a/gnu/packages/linux-initrd.scm b/gnu/packages/linux-initrd.scm deleted file mode 100644 index 5495e16e30..0000000000 --- a/gnu/packages/linux-initrd.scm +++ /dev/null @@ -1,411 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see . - -(define-module (gnu packages linux-initrd) - #:use-module (guix utils) - #:use-module (guix licenses) - #:use-module (guix build-system) - #:use-module ((guix derivations) - #:select (imported-modules compiled-modules %guile-for-build)) - #:use-module (gnu packages) - #:use-module (gnu packages cpio) - #:use-module (gnu packages compression) - #:use-module (gnu packages linux) - #:use-module (gnu packages guile) - #:use-module ((gnu packages make-bootstrap) - #:select (%guile-static-stripped)) - #:use-module (guix packages) - #:use-module (guix download) - #:use-module (guix build-system trivial)) - - -;;; Commentary: -;;; -;;; Tools to build initial RAM disks (initrd's) for Linux-Libre, and in -;;; particular initrd's that run Guile. -;;; -;;; Code: - - -(define-syntax-rule (raw-build-system (store system name inputs) body ...) - "Lift BODY to a package build system." - ;; TODO: Generalize. - (build-system - (name "raw") - (description "Raw build system") - (build (lambda* (store name source inputs #:key system #:allow-other-keys) - (parameterize ((%guile-for-build (package-derivation store - guile-2.0))) - body ...))))) - -(define (module-package modules) - "Return a package that contains all of MODULES, a list of Guile module -names." - (package - (name "guile-modules") - (version "0") - (source #f) - (build-system (raw-build-system (store system name inputs) - (imported-modules store modules - #:name name - #:system system))) - (synopsis "Set of Guile modules") - (description synopsis) - (license gpl3+) - (home-page "http://www.gnu.org/software/guix/"))) - -(define (compiled-module-package modules) - "Return a package that contains the .go files corresponding to MODULES, a -list of Guile module names." - (package - (name "guile-compiled-modules") - (version "0") - (source #f) - (build-system (raw-build-system (store system name inputs) - (compiled-modules store modules - #:name name - #:system system))) - (synopsis "Set of compiled Guile modules") - (description synopsis) - (license gpl3+) - (home-page "http://www.gnu.org/software/guix/"))) - -(define* (expression->initrd exp - #:key - (guile %guile-static-stripped) - (cpio cpio) - (gzip gzip) - (name "guile-initrd") - (system (%current-system)) - (modules '()) - (linux #f) - (linux-modules '())) - "Return a package that contains a Linux initrd (a gzipped cpio archive) -containing GUILE and that evaluates EXP upon booting. LINUX-MODULES is a list -of `.ko' file names to be copied from LINUX into the initrd. MODULES is a -list of Guile module names to be embedded in the initrd." - - ;; General Linux overview in `Documentation/early-userspace/README' and - ;; `Documentation/filesystems/ramfs-rootfs-initramfs.txt'. - - (define builder - `(begin - (use-modules (guix build utils) - (ice-9 pretty-print) - (ice-9 popen) - (ice-9 match) - (ice-9 ftw) - (srfi srfi-26) - (system base compile) - (rnrs bytevectors) - ((system foreign) #:select (sizeof))) - - (let ((guile (assoc-ref %build-inputs "guile")) - (cpio (string-append (assoc-ref %build-inputs "cpio") - "/bin/cpio")) - (gzip (string-append (assoc-ref %build-inputs "gzip") - "/bin/gzip")) - (modules (assoc-ref %build-inputs "modules")) - (gos (assoc-ref %build-inputs "modules/compiled")) - (scm-dir (string-append "share/guile/" (effective-version))) - (go-dir (format #f ".cache/guile/ccache/~a-~a-~a-~a" - (effective-version) - (if (eq? (native-endianness) (endianness little)) - "LE" - "BE") - (sizeof '*) - (effective-version))) - (out (assoc-ref %outputs "out"))) - (mkdir out) - (mkdir "contents") - (with-directory-excursion "contents" - (copy-recursively guile ".") - (call-with-output-file "init" - (lambda (p) - (format p "#!/bin/guile -ds~%!#~%" guile) - (pretty-print ',exp p))) - (chmod "init" #o555) - (chmod "bin/guile" #o555) - - ;; Copy Guile modules. - (chmod scm-dir #o777) - (copy-recursively modules scm-dir - #:follow-symlinks? #t) - (copy-recursively gos (string-append "lib/guile/" - (effective-version) "/ccache") - #:follow-symlinks? #t) - - ;; Compile `init'. - (mkdir-p go-dir) - (set! %load-path (cons modules %load-path)) - (set! %load-compiled-path (cons gos %load-compiled-path)) - (compile-file "init" - #:opts %auto-compilation-options - #:output-file (string-append go-dir "/init.go")) - - ;; Copy Linux modules. - (let* ((linux (assoc-ref %build-inputs "linux")) - (module-dir (and linux - (string-append linux "/lib/modules")))) - (mkdir "modules") - ,@(map (lambda (module) - `(match (find-files module-dir ,module) - ((file) - (format #t "copying '~a'...~%" file) - (copy-file file (string-append "modules/" - ,module))) - (() - (error "module not found" ,module module-dir)) - ((_ ...) - (error "several modules by that name" - ,module module-dir)))) - linux-modules)) - - ;; Reset the timestamps of all the files that will make it in the - ;; initrd. - (for-each (cut utime <> 0 0 0 0) - (find-files "." ".*")) - - (system* cpio "--version") - (let ((pipe (open-pipe* OPEN_WRITE cpio "-o" - "-O" (string-append out "/initrd") - "-H" "newc" "--null"))) - (define print0 - (let ((len (string-length "./"))) - (lambda (file) - (format pipe "~a\0" (string-drop file len))))) - - ;; Note: as per `ramfs-rootfs-initramfs.txt', always add - ;; directory entries before the files that are inside of it: "The - ;; Linux kernel cpio extractor won't create files in a directory - ;; that doesn't exist, so the directory entries must go before - ;; the files that go in those directories." - (file-system-fold (const #t) - (lambda (file stat result) ; leaf - (print0 file)) - (lambda (dir stat result) ; down - (unless (string=? dir ".") - (print0 dir))) - (const #f) ; up - (const #f) ; skip - (const #f) - #f - ".") - - (and (zero? (close-pipe pipe)) - (with-directory-excursion out - (and (zero? (system* gzip "--best" "initrd")) - (rename-file "initrd.gz" "initrd"))))))))) - - (package - (name name) - (version "0") - (source #f) - (build-system trivial-build-system) - (arguments `(#:modules ((guix build utils)) - #:builder ,builder)) - (inputs `(("guile" ,guile) - ("cpio" ,cpio) - ("gzip" ,gzip) - ("modules" ,(module-package modules)) - ("modules/compiled" ,(compiled-module-package modules)) - ,@(if linux - `(("linux" ,linux)) - '()))) - (synopsis "An initial RAM disk (initrd) for the Linux kernel") - (description - "An initial RAM disk (initrd), really a gzipped cpio archive, for use by -the Linux kernel.") - (license gpl3+) - (home-page "http://www.gnu.org/software/guix/"))) - -(define-public qemu-initrd - (expression->initrd - '(begin - (use-modules (srfi srfi-1) - (srfi srfi-26) - (ice-9 match) - ((system base compile) #:select (compile-file)) - (guix build utils) - (guix build linux-initrd)) - - (display "Welcome, this is GNU's early boot Guile.\n") - (display "Use '--repl' for an initrd REPL.\n\n") - - (mount-essential-file-systems) - (let* ((args (linux-command-line)) - (option (lambda (opt) - (let ((opt (string-append opt "="))) - (and=> (find (cut string-prefix? opt <>) - args) - (lambda (arg) - (substring arg (+ 1 (string-index arg #\=)))))))) - (to-load (option "--load")) - (root (option "--root"))) - - (when (member "--repl" args) - ((@ (system repl repl) start-repl))) - - (display "loading CIFS and companion modules...\n") - (for-each (compose load-linux-module* - (cut string-append "/modules/" <>)) - (list "md4.ko" "ecb.ko" "cifs.ko")) - - (unless (configure-qemu-networking) - (display "network interface is DOWN\n")) - - ;; Make /dev nodes. - (make-essential-device-nodes) - - ;; Prepare the real root file system under /root. - (unless (file-exists? "/root") - (mkdir "/root")) - (if root - (mount root "/root" "ext3") - (mount "none" "/root" "tmpfs")) - (mount-essential-file-systems #:root "/root") - - (mkdir-p "/root/xchg") - (mkdir-p "/root/nix/store") - - (unless (file-exists? "/root/dev") - (mkdir "/root/dev") - (make-essential-device-nodes #:root "/root")) - - ;; Mount the host's store and exchange directory. - (mount-qemu-smb-share "/store" "/root/nix/store") - (mount-qemu-smb-share "/xchg" "/root/xchg") - - ;; Copy the directories that contain .scm and .go files so that the - ;; child process in the chroot can load modules (we would bind-mount - ;; them but for some reason that fails with EINVAL -- XXX). - (mkdir-p "/root/share") - (mkdir-p "/root/lib") - (mount "none" "/root/share" "tmpfs") - (mount "none" "/root/lib" "tmpfs") - (copy-recursively "/share" "/root/share" - #:log (%make-void-port "w")) - (copy-recursively "/lib" "/root/lib" - #:log (%make-void-port "w")) - - - (if to-load - (letrec ((resolve - (lambda (file) - ;; If FILE is a symlink to an absolute file name, - ;; resolve it as if we were under /root. - (let ((st (lstat file))) - (if (eq? 'symlink (stat:type st)) - (let ((target (readlink file))) - (resolve (string-append "/root" target))) - file))))) - (format #t "loading boot file '~a'...\n" to-load) - (compile-file (resolve (string-append "/root/" to-load)) - #:output-file "/root/loader.go" - #:opts %auto-compilation-options) - (match (primitive-fork) - (0 - (chroot "/root") - (load-compiled "/loader.go") - - ;; TODO: Remove /lib, /share, and /loader.go. - ) - (pid - (format #t "boot file loaded under PID ~a~%" pid) - (let ((status (waitpid pid))) - (reboot))))) - (begin - (display "no boot file passed via '--load'\n") - (display "entering a warm and cozy REPL\n") - ((@ (system repl repl) start-repl)))))) - #:name "qemu-initrd" - #:modules '((guix build utils) - (guix build linux-initrd)) - #:linux linux-libre - #:linux-modules '("cifs.ko" "md4.ko" "ecb.ko"))) - -(define-public gnu-system-initrd - ;; Initrd for the GNU system itself, with nothing QEMU-specific. - (expression->initrd - '(begin - (use-modules (srfi srfi-1) - (srfi srfi-26) - (ice-9 match) - (guix build utils) - (guix build linux-initrd)) - - (display "Welcome, this is GNU's early boot Guile.\n") - (display "Use '--repl' for an initrd REPL.\n\n") - - (mount-essential-file-systems) - (let* ((args (linux-command-line)) - (option (lambda (opt) - (let ((opt (string-append opt "="))) - (and=> (find (cut string-prefix? opt <>) - args) - (lambda (arg) - (substring arg (+ 1 (string-index arg #\=)))))))) - (to-load (option "--load")) - (root (option "--root"))) - - (when (member "--repl" args) - ((@ (system repl repl) start-repl))) - - ;; Make /dev nodes. - (make-essential-device-nodes) - - ;; Prepare the real root file system under /root. - (mkdir-p "/root") - (if root - ;; Assume ROOT has a usable /dev tree. - (mount root "/root" "ext3") - (begin - (mount "none" "/root" "tmpfs") - (make-essential-device-nodes #:root "/root"))) - - (mount-essential-file-systems #:root "/root") - - (mkdir-p "/root/tmp") - (mount "none" "/root/tmp" "tmpfs") - - ;; XXX: We don't copy our fellow Guile modules to /root (see - ;; 'qemu-initrd'), so if TO-LOAD tries to load a module (which can - ;; happen if it throws, to display the exception!), then we're - ;; screwed. Hopefully TO-LOAD is a simple expression that just does - ;; '(execlp ...)'. - - (if to-load - (begin - (format #t "loading '~a'...\n" to-load) - (chroot "/root") - (primitive-load to-load) - (format (current-error-port) - "boot program '~a' terminated, rebooting~%" - to-load) - (sleep 2) - (reboot)) - (begin - (display "no init file passed via '--load'\n") - (display "entering a warm and cozy REPL\n") - ((@ (system repl repl) start-repl)))))) - #:name "qemu-system-initrd" - #:modules '((guix build linux-initrd) - (guix build utils)) - #:linux linux-libre)) - -;;; linux-initrd.scm ends here diff --git a/gnu/system.scm b/gnu/system.scm index 6fd753f8fd..5fb4a7483e 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2013, 2014 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,7 +22,6 @@ #:use-module (guix records) #:use-module (guix packages) #:use-module (guix derivations) - #:use-module (gnu packages linux-initrd) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages admin) @@ -31,6 +30,7 @@ #:use-module (gnu system grub) #:use-module (gnu system shadow) #:use-module (gnu system linux) + #:use-module (gnu system linux-initrd) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) @@ -58,8 +58,8 @@ (default grub)) (bootloader-entries operating-system-bootloader-entries ; list (default '())) - (initrd operating-system-initrd - (default gnu-system-initrd)) + (initrd operating-system-initrd ; monadic derivation + (default (gnu-system-initrd))) (host-name operating-system-host-name) ; string @@ -321,8 +321,9 @@ alias ll='ls -l' "--config" ,dmd-conf)))) (kernel -> (operating-system-kernel os)) (kernel-dir (package-file kernel)) - (initrd -> (operating-system-initrd os)) - (initrd-file (package-file initrd)) + (initrd (operating-system-initrd os)) + (initrd-file -> (string-append (derivation->output-path initrd) + "/initrd")) (entries -> (list (menu-entry (label (string-append "GNU system with " @@ -331,7 +332,7 @@ alias ll='ls -l' (linux kernel) (linux-arguments `("--root=/dev/vda1" ,(string-append "--load=" boot))) - (initrd initrd)))) + (initrd initrd-file)))) (grub.cfg (grub-configuration-file entries)) (extras (links (delete-duplicates (append (append-map service-inputs services) diff --git a/gnu/system/grub.scm b/gnu/system/grub.scm index 86fa9b504d..5dc0b85ff2 100644 --- a/gnu/system/grub.scm +++ b/gnu/system/grub.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2013, 2014 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -41,7 +41,7 @@ (linux menu-entry-linux) (linux-arguments menu-entry-linux-arguments (default '())) - (initrd menu-entry-initrd)) + (initrd menu-entry-initrd)) ; file name of the initrd (define* (grub-configuration-file entries #:key (default-entry 1) (timeout 5) @@ -66,10 +66,7 @@ search.file ~a~%" (match-lambda (($ label linux arguments initrd) (mlet %store-monad ((linux (package-file linux "bzImage" - #:system system)) - (initrd (package-file initrd "initrd" #:system system))) - ;; XXX: Assume that INITRD is a directory containing an 'initrd' file. (return (format #f "menuentry ~s { linux ~a ~a initrd ~a diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm new file mode 100644 index 0000000000..a28b913c3e --- /dev/null +++ b/gnu/system/linux-initrd.scm @@ -0,0 +1,360 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2013, 2014 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu system linux-initrd) + #:use-module (guix monads) + #:use-module (guix utils) + #:use-module (gnu packages cpio) + #:use-module (gnu packages compression) + #:use-module (gnu packages linux) + #:use-module (gnu packages guile) + #:use-module ((gnu packages make-bootstrap) + #:select (%guile-static-stripped)) + #:export (expression->initrd + qemu-initrd + gnu-system-initrd)) + + +;;; Commentary: +;;; +;;; Tools to build initial RAM disks (initrd's) for Linux-Libre, and in +;;; particular initrd's that run Guile. +;;; +;;; Code: + + +(define* (expression->initrd exp + #:key + (guile %guile-static-stripped) + (cpio cpio) + (gzip gzip) + (name "guile-initrd") + (system (%current-system)) + (modules '()) + (linux #f) + (linux-modules '())) + "Return a package that contains a Linux initrd (a gzipped cpio archive) +containing GUILE and that evaluates EXP upon booting. LINUX-MODULES is a list +of `.ko' file names to be copied from LINUX into the initrd. MODULES is a +list of Guile module names to be embedded in the initrd." + + ;; General Linux overview in `Documentation/early-userspace/README' and + ;; `Documentation/filesystems/ramfs-rootfs-initramfs.txt'. + + (define builder + `(begin + (use-modules (guix build utils) + (ice-9 pretty-print) + (ice-9 popen) + (ice-9 match) + (ice-9 ftw) + (srfi srfi-26) + (system base compile) + (rnrs bytevectors) + ((system foreign) #:select (sizeof))) + + (let ((guile (assoc-ref %build-inputs "guile")) + (cpio (string-append (assoc-ref %build-inputs "cpio") + "/bin/cpio")) + (gzip (string-append (assoc-ref %build-inputs "gzip") + "/bin/gzip")) + (modules (assoc-ref %build-inputs "modules")) + (gos (assoc-ref %build-inputs "modules/compiled")) + (scm-dir (string-append "share/guile/" (effective-version))) + (go-dir (format #f ".cache/guile/ccache/~a-~a-~a-~a" + (effective-version) + (if (eq? (native-endianness) (endianness little)) + "LE" + "BE") + (sizeof '*) + (effective-version))) + (out (assoc-ref %outputs "out"))) + (mkdir out) + (mkdir "contents") + (with-directory-excursion "contents" + (copy-recursively guile ".") + (call-with-output-file "init" + (lambda (p) + (format p "#!/bin/guile -ds~%!#~%" guile) + (pretty-print ',exp p))) + (chmod "init" #o555) + (chmod "bin/guile" #o555) + + ;; Copy Guile modules. + (chmod scm-dir #o777) + (copy-recursively modules scm-dir + #:follow-symlinks? #t) + (copy-recursively gos (string-append "lib/guile/" + (effective-version) "/ccache") + #:follow-symlinks? #t) + + ;; Compile `init'. + (mkdir-p go-dir) + (set! %load-path (cons modules %load-path)) + (set! %load-compiled-path (cons gos %load-compiled-path)) + (compile-file "init" + #:opts %auto-compilation-options + #:output-file (string-append go-dir "/init.go")) + + ;; Copy Linux modules. + (let* ((linux (assoc-ref %build-inputs "linux")) + (module-dir (and linux + (string-append linux "/lib/modules")))) + (mkdir "modules") + ,@(map (lambda (module) + `(match (find-files module-dir ,module) + ((file) + (format #t "copying '~a'...~%" file) + (copy-file file (string-append "modules/" + ,module))) + (() + (error "module not found" ,module module-dir)) + ((_ ...) + (error "several modules by that name" + ,module module-dir)))) + linux-modules)) + + ;; Reset the timestamps of all the files that will make it in the + ;; initrd. + (for-each (cut utime <> 0 0 0 0) + (find-files "." ".*")) + + (system* cpio "--version") + (let ((pipe (open-pipe* OPEN_WRITE cpio "-o" + "-O" (string-append out "/initrd") + "-H" "newc" "--null"))) + (define print0 + (let ((len (string-length "./"))) + (lambda (file) + (format pipe "~a\0" (string-drop file len))))) + + ;; Note: as per `ramfs-rootfs-initramfs.txt', always add + ;; directory entries before the files that are inside of it: "The + ;; Linux kernel cpio extractor won't create files in a directory + ;; that doesn't exist, so the directory entries must go before + ;; the files that go in those directories." + (file-system-fold (const #t) + (lambda (file stat result) ; leaf + (print0 file)) + (lambda (dir stat result) ; down + (unless (string=? dir ".") + (print0 dir))) + (const #f) ; up + (const #f) ; skip + (const #f) + #f + ".") + + (and (zero? (close-pipe pipe)) + (with-directory-excursion out + (and (zero? (system* gzip "--best" "initrd")) + (rename-file "initrd.gz" "initrd"))))))))) + + (mlet* %store-monad + ((source (imported-modules modules)) + (compiled (compiled-modules modules)) + (inputs (lower-inputs + `(("guile" ,guile) + ("cpio" ,cpio) + ("gzip" ,gzip) + ("modules" ,source) + ("modules/compiled" ,compiled) + ,@(if linux + `(("linux" ,linux)) + '()))))) + (derivation-expression name builder + #:modules '((guix build utils)) + #:inputs inputs))) + +(define (qemu-initrd) + "Return a monadic derivation that builds an initrd for use in a QEMU guest +where the store is shared with the host." + (expression->initrd + '(begin + (use-modules (srfi srfi-1) + (srfi srfi-26) + (ice-9 match) + ((system base compile) #:select (compile-file)) + (guix build utils) + (guix build linux-initrd)) + + (display "Welcome, this is GNU's early boot Guile.\n") + (display "Use '--repl' for an initrd REPL.\n\n") + + (mount-essential-file-systems) + (let* ((args (linux-command-line)) + (option (lambda (opt) + (let ((opt (string-append opt "="))) + (and=> (find (cut string-prefix? opt <>) + args) + (lambda (arg) + (substring arg (+ 1 (string-index arg #\=)))))))) + (to-load (option "--load")) + (root (option "--root"))) + + (when (member "--repl" args) + ((@ (system repl repl) start-repl))) + + (display "loading CIFS and companion modules...\n") + (for-each (compose load-linux-module* + (cut string-append "/modules/" <>)) + (list "md4.ko" "ecb.ko" "cifs.ko")) + + (unless (configure-qemu-networking) + (display "network interface is DOWN\n")) + + ;; Make /dev nodes. + (make-essential-device-nodes) + + ;; Prepare the real root file system under /root. + (unless (file-exists? "/root") + (mkdir "/root")) + (if root + (mount root "/root" "ext3") + (mount "none" "/root" "tmpfs")) + (mount-essential-file-systems #:root "/root") + + (mkdir-p "/root/xchg") + (mkdir-p "/root/nix/store") + + (unless (file-exists? "/root/dev") + (mkdir "/root/dev") + (make-essential-device-nodes #:root "/root")) + + ;; Mount the host's store and exchange directory. + (mount-qemu-smb-share "/store" "/root/nix/store") + (mount-qemu-smb-share "/xchg" "/root/xchg") + + ;; Copy the directories that contain .scm and .go files so that the + ;; child process in the chroot can load modules (we would bind-mount + ;; them but for some reason that fails with EINVAL -- XXX). + (mkdir-p "/root/share") + (mkdir-p "/root/lib") + (mount "none" "/root/share" "tmpfs") + (mount "none" "/root/lib" "tmpfs") + (copy-recursively "/share" "/root/share" + #:log (%make-void-port "w")) + (copy-recursively "/lib" "/root/lib" + #:log (%make-void-port "w")) + + + (if to-load + (letrec ((resolve + (lambda (file) + ;; If FILE is a symlink to an absolute file name, + ;; resolve it as if we were under /root. + (let ((st (lstat file))) + (if (eq? 'symlink (stat:type st)) + (let ((target (readlink file))) + (resolve (string-append "/root" target))) + file))))) + (format #t "loading boot file '~a'...\n" to-load) + (compile-file (resolve (string-append "/root/" to-load)) + #:output-file "/root/loader.go" + #:opts %auto-compilation-options) + (match (primitive-fork) + (0 + (chroot "/root") + (load-compiled "/loader.go") + + ;; TODO: Remove /lib, /share, and /loader.go. + ) + (pid + (format #t "boot file loaded under PID ~a~%" pid) + (let ((status (waitpid pid))) + (reboot))))) + (begin + (display "no boot file passed via '--load'\n") + (display "entering a warm and cozy REPL\n") + ((@ (system repl repl) start-repl)))))) + #:name "qemu-initrd" + #:modules '((guix build utils) + (guix build linux-initrd)) + #:linux linux-libre + #:linux-modules '("cifs.ko" "md4.ko" "ecb.ko"))) + +(define (gnu-system-initrd) + "Initrd for the GNU system itself, with nothing QEMU-specific." + (expression->initrd + '(begin + (use-modules (srfi srfi-1) + (srfi srfi-26) + (ice-9 match) + (guix build utils) + (guix build linux-initrd)) + + (display "Welcome, this is GNU's early boot Guile.\n") + (display "Use '--repl' for an initrd REPL.\n\n") + + (mount-essential-file-systems) + (let* ((args (linux-command-line)) + (option (lambda (opt) + (let ((opt (string-append opt "="))) + (and=> (find (cut string-prefix? opt <>) + args) + (lambda (arg) + (substring arg (+ 1 (string-index arg #\=)))))))) + (to-load (option "--load")) + (root (option "--root"))) + + (when (member "--repl" args) + ((@ (system repl repl) start-repl))) + + ;; Make /dev nodes. + (make-essential-device-nodes) + + ;; Prepare the real root file system under /root. + (mkdir-p "/root") + (if root + ;; Assume ROOT has a usable /dev tree. + (mount root "/root" "ext3") + (begin + (mount "none" "/root" "tmpfs") + (make-essential-device-nodes #:root "/root"))) + + (mount-essential-file-systems #:root "/root") + + (mkdir-p "/root/tmp") + (mount "none" "/root/tmp" "tmpfs") + + ;; XXX: We don't copy our fellow Guile modules to /root (see + ;; 'qemu-initrd'), so if TO-LOAD tries to load a module (which can + ;; happen if it throws, to display the exception!), then we're + ;; screwed. Hopefully TO-LOAD is a simple expression that just does + ;; '(execlp ...)'. + + (if to-load + (begin + (format #t "loading '~a'...\n" to-load) + (chroot "/root") + (primitive-load to-load) + (format (current-error-port) + "boot program '~a' terminated, rebooting~%" + to-load) + (sleep 2) + (reboot)) + (begin + (display "no init file passed via '--load'\n") + (display "entering a warm and cozy REPL\n") + ((@ (system repl repl) start-repl)))))) + #:name "qemu-system-initrd" + #:modules '((guix build linux-initrd) + (guix build utils)) + #:linux linux-libre)) + +;;; linux-initrd.scm ends here diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index e75c09d859..fa93654144 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2013, 2014 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -35,7 +35,6 @@ #:use-module (gnu packages zile) #:use-module (gnu packages grub) #:use-module (gnu packages linux) - #:use-module (gnu packages linux-initrd) #:use-module (gnu packages package-management) #:use-module ((gnu packages make-bootstrap) #:select (%guile-static-stripped)) @@ -43,6 +42,7 @@ #:use-module (gnu system shadow) #:use-module (gnu system linux) + #:use-module (gnu system linux-initrd) #:use-module (gnu system grub) #:use-module (gnu system dmd) #:use-module (gnu system) @@ -67,7 +67,7 @@ (system (%current-system)) (inputs '()) (linux linux-libre) - (initrd qemu-initrd) + initrd (qemu qemu/smb-shares) (env-vars '()) (modules '()) @@ -78,10 +78,10 @@ (references-graphs #f) (disk-image-size (* 100 (expt 2 20)))) - "Evaluate EXP in a QEMU virtual machine running LINUX with INITRD. In the -virtual machine, EXP has access to all of INPUTS from the store; it should put -its output files in the `/xchg' directory, which is copied to the derivation's -output when the VM terminates. + "Evaluate EXP in a QEMU virtual machine running LINUX with INITRD (a +derivation). In the virtual machine, EXP has access to all of INPUTS from the +store; it should put its output files in the `/xchg' directory, which is +copied to the derivation's output when the VM terminates. When MAKE-DISK-IMAGE? is true, then create a QEMU disk image of DISK-IMAGE-SIZE bytes and return it. @@ -178,6 +178,9 @@ made available under the /xchg CIFS share." (user-builder (text-file "builder-in-linux-vm" (object->string exp*))) (coreutils -> (car (assoc-ref %final-inputs "coreutils"))) + (initrd (if initrd + (return initrd) + (qemu-initrd))) ; default initrd (inputs (lower-inputs `(("qemu" ,qemu) ("linux" ,linux) ("initrd" ,initrd) -- cgit v1.2.3 From 99b030c7052abb5bc80c7e2e892529f0de8e4bf2 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 4 Feb 2014 13:48:18 +0100 Subject: gnu: gxmessage: New module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/gxmessage.scm: New file * gnu-system.am (GNU_SYSTEM_MODULES): Add gxmessage.scm Signed-off-by: Ludovic Courtès --- gnu-system.am | 1 + gnu/packages/gxmessage.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 gnu/packages/gxmessage.scm (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 1f7327e865..0a9fb4651e 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -101,6 +101,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/guile.scm \ gnu/packages/guile-wm.scm \ gnu/packages/gv.scm \ + gnu/packages/gxmessage.scm \ gnu/packages/help2man.scm \ gnu/packages/hugs.scm \ gnu/packages/icu4c.scm \ diff --git a/gnu/packages/gxmessage.scm b/gnu/packages/gxmessage.scm new file mode 100644 index 0000000000..425659274c --- /dev/null +++ b/gnu/packages/gxmessage.scm @@ -0,0 +1,50 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 John Darrington +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages gxmessage) + #:use-module (guix licenses) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages glib) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages gtk) + #:use-module (gnu packages)) + +(define-public gxmessage + (package + (name "gxmessage") + (version "2.20.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/gxmessage/gxmessage-" + version ".tar.gz")) + (sha256 + (base32 "1nq8r321x3rzcdkjlvj61i9x7smslnis7b05b39xqcjc9xyg4hv0")))) + (build-system gnu-build-system) + (inputs + `(("gtk+" ,gtk+-2))) + (native-inputs + `(("intltool" ,intltool) + ("pkg-config" ,pkg-config))) + (home-page "http://www.gnu.org/software/gxmessage/") + (synopsis "Open popup message window with buttons for return") + (description "GNU gxmessage is a program that pops up dialog windows, which display +a message to the user and waits for their action. The program then exits +with an exit code corresponding to the response.") + (license gpl3+))) -- cgit v1.2.3 From 2a72eeeea1e199a16cad2db5c62fb2ee1fac020b Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 4 Feb 2014 16:12:38 +0100 Subject: gnu: Add Boost. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/boost.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add boost.scm Signed-off-by: Ludovic Courtès --- gnu-system.am | 1 + gnu/packages/boost.scm | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 gnu/packages/boost.scm (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 0a9fb4651e..8355104a28 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -40,6 +40,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/bdb.scm \ gnu/packages/bdw-gc.scm \ gnu/packages/bison.scm \ + gnu/packages/boost.scm \ gnu/packages/bootstrap.scm \ gnu/packages/cdrom.scm \ gnu/packages/cflow.scm \ diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm new file mode 100644 index 0000000000..73b377e384 --- /dev/null +++ b/gnu/packages/boost.scm @@ -0,0 +1,89 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 John Darrington +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages boost) + #:use-module ((guix licenses) + #:renamer (symbol-prefix-proc 'license:)) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages python) + #:use-module (gnu packages tcsh) + #:use-module (gnu packages perl)) + +(define-public boost + (package + (name "boost") + (version "1.55.0") + (source (origin + (method url-fetch) + (uri (string-append + "mirror://sourceforge/boost/boost_" + (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version) + ".tar.bz2")) + (sha256 + (base32 + "0lkv5dzssbl5fmh2nkaszi8x9qbj80pr4acf9i26sj3rvlih1w7z")))) + (build-system gnu-build-system) + (native-inputs + `(("perl" ,perl) + ("python" ,python-2) + ("tcsh" ,tcsh))) + (arguments + `(#:phases + (alist-replace + 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* '("libs/config/configure" + "libs/spirit/classic/phoenix/test/runtest.sh" + "tools/build/v2/doc/bjam.qbk" + "tools/build/v2/engine/execunix.c" + "tools/build/v2/engine/Jambase" + "tools/build/v2/engine/jambase.c") + (("/bin/sh") (which "sh"))) + + (setenv "SHELL" (which "sh")) + (setenv "CONFIG_SHELL" (which "sh")) + + (zero? (system* "./bootstrap.sh" + (string-append "--prefix=" out) + "--with-toolset=gcc")))) + (alist-replace + 'build + (lambda _ + (zero? (system* "./b2" "threading=multi" "link=shared"))) + + (alist-replace + 'check + (lambda _ #t) + + (alist-replace + 'install + (lambda _ + (zero? (system* "./b2" "install" "threading=multi" "link=shared"))) + %standard-phases)))))) + + (home-page "http://boost.org") + (synopsis "Peer-reviewed portable C++ source libraries") + (description + "A collection of libraries intended to be widely useful, and usable +across a broad spectrum of applications.") + (license (license:x11-style "http://www.boost.org/LICENSE_1_0.txt" + "Some components have other similar licences.")))) -- cgit v1.2.3 From 1d07e9316a84a47da54469d63b1825368c0db720 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 4 Feb 2014 16:12:39 +0100 Subject: gnu: inkscape: New module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/inkscape.scm, gnu/packages/patches/inkscape-stray-comma.patch: New files. * gnu-system.am (GNU_SYSTEM_MODULES): Add inkscape.scm. (dist_patch_DATA): Add inkscape-stray-comma.patch. Signed-off-by: Ludovic Courtès --- gnu-system.am | 2 + gnu/packages/inkscape.scm | 79 +++++++++++++++++++++++++ gnu/packages/patches/inkscape-stray-comma.patch | 13 ++++ 3 files changed, 94 insertions(+) create mode 100644 gnu/packages/inkscape.scm create mode 100644 gnu/packages/patches/inkscape-stray-comma.patch (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 8355104a28..66c9ab39cd 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -109,6 +109,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/idutils.scm \ gnu/packages/imagemagick.scm \ gnu/packages/indent.scm \ + gnu/packages/inkscape.scm \ gnu/packages/irssi.scm \ gnu/packages/iso-codes.scm \ gnu/packages/kde.scm \ @@ -269,6 +270,7 @@ dist_patch_DATA = \ gnu/packages/patches/gtkglext-disable-disable-deprecated.patch \ gnu/packages/patches/gtkglext-remove-pangox-dependency.patch \ gnu/packages/patches/hop-bigloo-4.0b.patch \ + gnu/packages/patches/inkscape-stray-comma.patch \ gnu/packages/patches/libevent-dns-tests.patch \ gnu/packages/patches/libffi-mips-n32-fix.patch \ gnu/packages/patches/liboop-mips64-deplibs-fix.patch \ diff --git a/gnu/packages/inkscape.scm b/gnu/packages/inkscape.scm new file mode 100644 index 0000000000..6b8669f373 --- /dev/null +++ b/gnu/packages/inkscape.scm @@ -0,0 +1,79 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 John Darrington +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages inkscape) + #:use-module ((guix licenses) + #:renamer (symbol-prefix-proc 'license:)) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages aspell) + #:use-module (gnu packages bdw-gc) + #:use-module (gnu packages boost) + #:use-module (gnu packages glib) + #:use-module (gnu packages gtk) + #:use-module (gnu packages maths) + #:use-module (gnu packages perl) + #:use-module (gnu packages pdf) + #:use-module (gnu packages popt) + #:use-module (gnu packages python) + #:use-module (gnu packages xml) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages libpng) + #:use-module (gnu packages pkg-config)) + +(define-public inkscape + (package + (name "inkscape") + (version "0.48.4") + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/inkscape/inkscape-" + version ".tar.gz")) + (sha256 + (base32 + "0nhxsgrgsx6zrgpkd1akxjvmdqjp8ccnsvlwxh62l0brg84fw6bf")) + (patches (list (search-patch "inkscape-stray-comma.patch"))))) + (build-system gnu-build-system) + (inputs + `(("aspell" ,aspell) + ("gtkmm" ,gtkmm-2) + ("gtk" ,gtk+-2) + ("gsl" ,gsl) + ("poppler" ,poppler) + ("libpng" ,libpng) + ("libxml2" ,libxml2) + ("libxslt" ,libxslt) + ("libgc" ,libgc) + ("freetype" ,freetype) + ("popt" ,popt) + ("python" ,python-2) + ("lcms" ,lcms) + ("boost" ,boost))) + (native-inputs + `(("intltool" ,intltool) + ("perl" ,perl) + ("pkg-config" ,pkg-config))) + (home-page "http://inkscape.org/") + (synopsis "Vector graphics editor") + (description "Inkscape is a vector graphics editor. What sets Inkscape +apart is its use of Scalable Vector Graphics (SVG), an XML-based W3C standard, +as the native format.") + (license license:gpl2+))) diff --git a/gnu/packages/patches/inkscape-stray-comma.patch b/gnu/packages/patches/inkscape-stray-comma.patch new file mode 100644 index 0000000000..0b000d9e30 --- /dev/null +++ b/gnu/packages/patches/inkscape-stray-comma.patch @@ -0,0 +1,13 @@ +This is verbatim from Upstream: http://bazaar.launchpad.net/~inkscape.dev/inkscape/RELEASE_0_48_BRANCH/diff/9943 +--- a/src/widgets/desktop-widget.h 2011-06-06 06:43:00 +0000 ++++ b/src/widgets/desktop-widget.h 2013-01-05 14:34:09 +0000 +@@ -239,7 +239,7 @@ + private: + GtkWidget *tool_toolbox; + GtkWidget *aux_toolbox; +- GtkWidget *commands_toolbox,; ++ GtkWidget *commands_toolbox; + GtkWidget *snap_toolbox; + + static void init(SPDesktopWidget *widget); + -- cgit v1.2.3 From 16686a902276c827455d78860dd62aaa68922cd2 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 5 Feb 2014 22:18:14 +0100 Subject: gnu: slim: Upgrade to 1.3.6; allow the choice of a config file at run time. * gnu/packages/slim.scm (slim): Upgrade to 1.3.6. Add patches. Comment out systemd-related stuff from CMakeLists.txt. Add "-DBUILD_SHARED_LIBS=OFF" and "-DCMAKE_SKIP_BUILD_RPATH=ON" to #:configure-flags. Adjust 'home-page' field. * gnu/packages/patches/slim-config.patch, gnu/packages/patches/slim-session.patch: New files. * gnu-system.am (dist_patch_DATA): Add them. --- gnu-system.am | 2 ++ gnu/packages/patches/slim-config.patch | 27 +++++++++++++++++++++++++++ gnu/packages/patches/slim-session.patch | 17 +++++++++++++++++ gnu/packages/slim.scm | 31 ++++++++++++++++++++++++------- 4 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 gnu/packages/patches/slim-config.patch create mode 100644 gnu/packages/patches/slim-session.patch (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 66c9ab39cd..2e248c7df7 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -296,6 +296,8 @@ dist_patch_DATA = \ gnu/packages/patches/readline-link-ncurses.patch \ gnu/packages/patches/ripperx-libm.patch \ gnu/packages/patches/scheme48-tests.patch \ + gnu/packages/patches/slim-session.patch \ + gnu/packages/patches/slim-config.patch \ gnu/packages/patches/tcsh-fix-autotest.patch \ gnu/packages/patches/teckit-cstdio.patch \ gnu/packages/patches/valgrind-glibc.patch \ diff --git a/gnu/packages/patches/slim-config.patch b/gnu/packages/patches/slim-config.patch new file mode 100644 index 0000000000..5e6135d75c --- /dev/null +++ b/gnu/packages/patches/slim-config.patch @@ -0,0 +1,27 @@ +Allow the configuration file and theme directory to be specified at run time. +Patch by Eelco Dolstra, from Nixpkgs. + +--- slim-1.3.6/app.cpp 2013-10-02 00:38:05.000000000 +0200 ++++ slim-1.3.6/app.cpp 2013-10-15 11:02:55.629263422 +0200 +@@ -200,7 +200,9 @@ + + /* Read configuration and theme */ + cfg = new Cfg; +- cfg->readConf(CFGFILE); ++ char *cfgfile = getenv("SLIM_CFGFILE"); ++ if (!cfgfile) cfgfile = CFGFILE; ++ cfg->readConf(cfgfile); + string themebase = ""; + string themefile = ""; + string themedir = ""; +@@ -208,7 +210,9 @@ + if (testing) { + themeName = testtheme; + } else { +- themebase = string(THEMESDIR) + "/"; ++ char *themesdir = getenv("SLIM_THEMESDIR"); ++ if (!themesdir) themesdir = THEMESDIR; ++ themebase = string(themesdir) + "/"; + themeName = cfg->getOption("current_theme"); + string::size_type pos; + if ((pos = themeName.find(",")) != string::npos) { diff --git a/gnu/packages/patches/slim-session.patch b/gnu/packages/patches/slim-session.patch new file mode 100644 index 0000000000..b85d3f7dd0 --- /dev/null +++ b/gnu/packages/patches/slim-session.patch @@ -0,0 +1,17 @@ +Exit after the user's session has finished. This works around slim's broken +PAM session handling (see +http://developer.berlios.de/bugs/?func=detailbug&bug_id=19102&group_id=2663). + +Patch by Eelco Dolstra, from Nixpkgs. + +--- slim-1.3.6/app.cpp 2013-10-15 11:02:55.629263422 +0200 ++++ slim-1.3.6/app.cpp 2013-10-15 13:00:10.141210784 +0200 +@@ -816,7 +822,7 @@ + StopServer(); + RemoveLock(); + while (waitpid(-1, NULL, WNOHANG) > 0); /* Collects all dead childrens */ +- Run(); ++ exit(OK_EXIT); + } + + void App::KillAllClients(Bool top) { diff --git a/gnu/packages/slim.scm b/gnu/packages/slim.scm index fd2c73c772..1a1feadede 100644 --- a/gnu/packages/slim.scm +++ b/gnu/packages/slim.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Guy Grant +;;; Copyright © 2014 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,6 +24,7 @@ #:use-module (guix download) #:use-module (guix build-system cmake) #:use-module (guix packages) + #:use-module (gnu packages) #:use-module (gnu packages gl) #:use-module (gnu packages xorg) #:use-module (gnu packages libpng) @@ -34,13 +36,17 @@ (define-public slim (package (name "slim") - (version "1.3.3") + (version "1.3.6") (source (origin (method url-fetch) - (uri (string-append "mirror://sourceforge/project/slim.berlios/slim-" + ;; Used to be available from + ;; mirror://sourceforge/project/slim.berlios/. + (uri (string-append "http://download.berlios.de/slim/slim-" version ".tar.gz")) (sha256 - (base32 "1fdvipj3658s8dm78djmfr8xhg6l8rr7kc4qcb34bjrnkkclhln1")))) + (base32 "1pqhk22jb4aja4hkrm7rjgbgzjyh7i4zswdgf5nw862l2znzxpi1")) + (patches (map search-patch + (list "slim-config.patch" "slim-session.patch"))))) (build-system cmake-build-system) (inputs `(("linux-pam" ,linux-pam) ("libpng" ,libpng) @@ -62,12 +68,23 @@ (lambda _ (substitute* "CMakeLists.txt" (("/etc") - (string-append - (assoc-ref %outputs "out") "/etc")))) + (string-append (assoc-ref %outputs "out") "/etc")) + (("install.*systemd.*") + ;; The build system's logic here is: if "Linux", then + ;; "systemd". Strip that. + ""))) %standard-phases) - #:configure-flags '("-DUSE_PAM=yes" "-DUSE_CONSOLEKIT=no") + #:configure-flags '("-DUSE_PAM=yes" "-DUSE_CONSOLEKIT=no" + + ;; Don't build libslim.so, because then the build + ;; system is unable to set the right RUNPATH on the + ;; 'slim' binary. + "-DBUILD_SHARED_LIBS=OFF" + + ;; Leave a valid RUNPATH upon install. + "-DCMAKE_SKIP_BUILD_RPATH=ON") #:tests? #f)) - (home-page "http://www.slim.berlios.de/") + (home-page "http://slim.berlios.de/") (synopsis "Desktop-independent graphcal login manager for X11") (description "SLiM is a Desktop-independent graphical login manager for X11, derived -- cgit v1.2.3 From b93afd5b53714cb896e2abdea1e0b405550fb67b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 6 Feb 2014 22:09:52 +0100 Subject: gnu: gdb: Upgrade to 7.7. * gnu/packages/gdb.scm (gdb): Upgrade to 7.7. Remove 'gdb-loongson-madd-fix.patch', no longer needed. * gnu/packages/patches/gdb-loongson-madd-fix.patch: Remove. * gnu-system.am (dist_patch_DATA): Adjust accordingly. --- gnu-system.am | 1 - gnu/packages/gdb.scm | 7 ++-- gnu/packages/patches/gdb-loongson-madd-fix.patch | 44 ------------------------ 3 files changed, 3 insertions(+), 49 deletions(-) delete mode 100644 gnu/packages/patches/gdb-loongson-madd-fix.patch (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 2e248c7df7..eb1e0d06dc 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -250,7 +250,6 @@ dist_patch_DATA = \ gnu/packages/patches/gawk-shell.patch \ gnu/packages/patches/gcc-cross-environment-variables.patch \ gnu/packages/patches/gd-mips64-deplibs-fix.patch \ - gnu/packages/patches/gdb-loongson-madd-fix.patch \ gnu/packages/patches/glib-tests-desktop.patch \ gnu/packages/patches/glib-tests-homedir.patch \ gnu/packages/patches/glib-tests-newnet.patch \ diff --git a/gnu/packages/gdb.scm b/gnu/packages/gdb.scm index 5a863e54aa..7a780d8ea2 100644 --- a/gnu/packages/gdb.scm +++ b/gnu/packages/gdb.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2013, 2014 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -33,15 +33,14 @@ (define-public gdb (package (name "gdb") - (version "7.6.2") + (version "7.7") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/gdb/gdb-" version ".tar.bz2")) (sha256 (base32 - "1s6hjqmq7xz10hqx45dgrpfh5mla578shn3zxgnrsv66w4n0wsig")) - (patches (list (search-patch "gdb-loongson-madd-fix.patch"))))) + "08vcb97j1b7vxwq6088wb6s3g3bm8iwikd922y0xsgbbxv3d2104")))) (build-system gnu-build-system) (arguments '(#:phases (alist-cons-after diff --git a/gnu/packages/patches/gdb-loongson-madd-fix.patch b/gnu/packages/patches/gdb-loongson-madd-fix.patch deleted file mode 100644 index 0d50dd2dd4..0000000000 --- a/gnu/packages/patches/gdb-loongson-madd-fix.patch +++ /dev/null @@ -1,44 +0,0 @@ -Fix the Loongson 2F specific fused multiply-add instructions on paired singles to -use the encoding recognized by the processor, as opposed to the mistaken english -Loongson 2F documentation. - -Patch by Mark H Weaver . - ---- gdb/opcodes/mips-opc.c.orig 2013-02-09 05:24:18.000000000 -0500 -+++ gdb/opcodes/mips-opc.c 2013-10-27 23:35:20.191997541 -0400 -@@ -956,7 +956,7 @@ - {"madd.s", "D,S,T", 0x4600001c, 0xffe0003f, RD_S|RD_T|WR_D|FP_S, 0, EE }, - {"madd.ps", "D,R,S,T", 0x4c000026, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5_33 }, - {"madd.ps", "D,S,T", 0x45600018, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2E }, --{"madd.ps", "D,S,T", 0x71600018, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, -+{"madd.ps", "D,S,T", 0x72c00018, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, - {"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, - {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, - {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 }, -@@ -1084,7 +1084,7 @@ - {"msub.s", "D,S,T", 0x4600001d, 0xffe0003f, RD_S|RD_T|WR_D|FP_S, 0, EE }, - {"msub.ps", "D,R,S,T", 0x4c00002e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5_33 }, - {"msub.ps", "D,S,T", 0x45600019, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2E }, --{"msub.ps", "D,S,T", 0x71600019, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, -+{"msub.ps", "D,S,T", 0x72c00019, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, - {"msub", "s,t", 0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 }, - {"msub", "s,t", 0x70000004, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 }, - {"msub", "7,s,t", 0x70000004, 0xfc00e7ff, MOD_a|RD_s|RD_t, 0, D32 }, -@@ -1218,7 +1218,7 @@ - {"nmadd.s", "D,S,T", 0x7200001a, 0xffe0003f, RD_S|RD_T|WR_D|FP_S, 0, IL2F }, - {"nmadd.ps","D,R,S,T", 0x4c000036, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5_33 }, - {"nmadd.ps", "D,S,T", 0x4560001a, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2E }, --{"nmadd.ps", "D,S,T", 0x7160001a, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, -+{"nmadd.ps", "D,S,T", 0x72c0001a, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, - {"nmsub.d", "D,R,S,T", 0x4c000039, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I4_33 }, - {"nmsub.d", "D,S,T", 0x4620001b, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2E }, - {"nmsub.d", "D,S,T", 0x7220001b, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, -@@ -1227,7 +1227,7 @@ - {"nmsub.s", "D,S,T", 0x7200001b, 0xffe0003f, RD_S|RD_T|WR_D|FP_S, 0, IL2F }, - {"nmsub.ps","D,R,S,T", 0x4c00003e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5_33 }, - {"nmsub.ps", "D,S,T", 0x4560001b, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2E }, --{"nmsub.ps", "D,S,T", 0x7160001b, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, -+{"nmsub.ps", "D,S,T", 0x72c0001b, 0xffe0003f, RD_S|RD_T|WR_D|FP_D, 0, IL2F }, - /* nop is at the start of the table. */ - {"nor", "d,v,t", 0x00000027, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 }, - {"nor", "t,r,I", 0, (int) M_NOR_I, INSN_MACRO, 0, I1 }, -- cgit v1.2.3 From 350b9b9933bdfd46efd3e9dee6f1dd1ec5889818 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Fri, 7 Feb 2014 17:04:58 -0600 Subject: gnu: moe: New module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/moe.scm: New file * gnu-system.am (GNU_SYSTEM_MODULES): Add moe.scm Signed-off-by: Ludovic Courtès --- gnu-system.am | 1 + gnu/packages/moe.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 gnu/packages/moe.scm (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index eb1e0d06dc..1ffeee5084 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -141,6 +141,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/make-bootstrap.scm \ gnu/packages/maths.scm \ gnu/packages/mit-krb5.scm \ + gnu/packages/moe.scm \ gnu/packages/mp3.scm \ gnu/packages/multiprecision.scm \ gnu/packages/mtools.scm \ diff --git a/gnu/packages/moe.scm b/gnu/packages/moe.scm new file mode 100644 index 0000000000..0dead5fe0c --- /dev/null +++ b/gnu/packages/moe.scm @@ -0,0 +1,52 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Eric Bavier +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages moe) + #:use-module (guix licenses) + #:use-module (gnu packages ncurses) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu)) + +(define-public moe + (package + (name "moe") + (version "1.5") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://gnu/moe/moe-" + version ".tar.gz")) + (sha256 + (base32 + "0hqag8022x68jmii1v6n7jb4fhp9icjkapgcpd2j3p9nzc8xch7s")))) + (build-system gnu-build-system) + (inputs + `(("ncurses" ,ncurses))) + (home-page "https://www.gnu.org/software/moe/moe.html") + (synopsis "Modeless, multiple-buffer, user-friendly 8-bit text editor") + (description + "GNU Moe is a powerful-but-simple-to-use text editor. It works in a +modeless manner, and features an intuitive set of key-bindings that +assign a degree of severity to each key; for example, key +combinations with the Alt key are for harmless commands like cursor +movements while combinations with the Control key are for commands +that will modify the text. Moe features multiple windows, unlimited +undo/redo, unlimited line length, global search and replace, and +more.") + (license gpl3+))) -- cgit v1.2.3 From 4cccb3617ee0e2344d0d986f3c60d97e77aa3249 Mon Sep 17 00:00:00 2001 From: Raimon Grau Date: Sun, 9 Feb 2014 16:28:39 +0100 Subject: gnu: Add stalonetray MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/stalonetray.scm: New file * gnu-system.am (GNU_SYSTEM_MODULES): Add stalonetray.scm Signed-off-by: Ludovic Courtès --- gnu-system.am | 1 + gnu/packages/stalonetray.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 gnu/packages/stalonetray.scm (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 1ffeee5084..cc34dbc7b3 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -190,6 +190,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/smalltalk.scm \ gnu/packages/sqlite.scm \ gnu/packages/ssh.scm \ + gnu/packages/stalonetray.scm \ gnu/packages/swig.scm \ gnu/packages/tcl.scm \ gnu/packages/tcsh.scm \ diff --git a/gnu/packages/stalonetray.scm b/gnu/packages/stalonetray.scm new file mode 100644 index 0000000000..5a53cd832e --- /dev/null +++ b/gnu/packages/stalonetray.scm @@ -0,0 +1,48 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Raimon Grau +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages stalonetray) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) #:select (gpl2+)) + #:use-module (gnu packages xorg)) + +(define-public stalonetray + (package + (name "stalonetray") + (version "0.8.1") + (source + (origin + (method url-fetch) + (uri + (string-append "mirror://sourceforge/stalonetray/stalonetray-" + version "/stalonetray-" version ".tar.bz2")) + (sha256 + (base32 + "1wp8pnlv34w7xizj1vivnc3fkwqq4qgb9dbrsg15598iw85gi8ll")))) + (inputs `(("libx11" ,libx11))) + (build-system gnu-build-system) + (home-page "stalonetray") + (synopsis "Standalone freedesktop.org and KDE systray implementation") + (description + "Stalonetray is a stand-alone freedesktop.org and KDE system +tray (notification area) for X Window System/X11 (e.g. X.Org or XFree86). It +has full XEMBED support and minimal dependencies: an X11 lib only. Stalonetray +works with virtually any EWMH-compliant window manager.") + (license gpl2+))) -- cgit v1.2.3 From f9ec07a9859c5b305105ab38bff3f3db0dcb842d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 9 Feb 2014 23:20:42 +0100 Subject: gnu: slim: Work around flaky synchronization with the X server. * gnu/packages/patches/slim-sigusr1.patch: New file. * gnu/packages/slim.scm (slim): Use it. * gnu-system.am (dist_patch_DATA): Add it. --- gnu-system.am | 1 + gnu/packages/patches/slim-sigusr1.patch | 33 +++++++++++++++++++++++++++++++++ gnu/packages/slim.scm | 3 ++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/slim-sigusr1.patch (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index cc34dbc7b3..a98ef250d0 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -299,6 +299,7 @@ dist_patch_DATA = \ gnu/packages/patches/scheme48-tests.patch \ gnu/packages/patches/slim-session.patch \ gnu/packages/patches/slim-config.patch \ + gnu/packages/patches/slim-sigusr1.patch \ gnu/packages/patches/tcsh-fix-autotest.patch \ gnu/packages/patches/teckit-cstdio.patch \ gnu/packages/patches/valgrind-glibc.patch \ diff --git a/gnu/packages/patches/slim-sigusr1.patch b/gnu/packages/patches/slim-sigusr1.patch new file mode 100644 index 0000000000..344b02933e --- /dev/null +++ b/gnu/packages/patches/slim-sigusr1.patch @@ -0,0 +1,33 @@ +This patch fixes SLiM so it really waits for the X server to be ready +before attempting to connect to it. Indeed, the X server notices that +its parent process has a handler for SIGUSR1, and consequently sends it +SIGUSR1 when it's ready to accept connections. + +The problem was that SLiM doesn't pay attention to SIGUSR1. So in practice, +if X starts slowly, then SLiM gets ECONNREFUSED a couple of time on +/tmp/.X11-unix/X0, then goes on trying to connect to localhost:6000, +where nobody answers; eventually, it times out and tries again on +/tmp/.X11-unix/X0, and finally it shows up on the screen. + +Patch by L. Courtès. + +--- slim-1.3.6/app.cpp 2014-02-05 15:27:20.000000000 +0100 ++++ slim-1.3.6/app.cpp 2014-02-09 22:42:04.000000000 +0100 +@@ -119,7 +119,9 @@ void CatchSignal(int sig) { + exit(ERR_EXIT); + } + ++static volatile int got_sigusr1 = 0; + void User1Signal(int sig) { ++ got_sigusr1 = 1; + signal(sig, User1Signal); + } + +@@ -884,6 +886,7 @@ int App::WaitForServer() { + int ncycles = 120; + int cycles; + ++ while (!got_sigusr1); + for(cycles = 0; cycles < ncycles; cycles++) { + if((Dpy = XOpenDisplay(DisplayName))) { + XSetIOErrorHandler(xioerror); diff --git a/gnu/packages/slim.scm b/gnu/packages/slim.scm index 1a1feadede..f25b070f3c 100644 --- a/gnu/packages/slim.scm +++ b/gnu/packages/slim.scm @@ -46,7 +46,8 @@ (sha256 (base32 "1pqhk22jb4aja4hkrm7rjgbgzjyh7i4zswdgf5nw862l2znzxpi1")) (patches (map search-patch - (list "slim-config.patch" "slim-session.patch"))))) + (list "slim-config.patch" "slim-session.patch" + "slim-sigusr1.patch"))))) (build-system cmake-build-system) (inputs `(("linux-pam" ,linux-pam) ("libpng" ,libpng) -- cgit v1.2.3 From 266b39fc26fff62e63c63f7f6bc8c92dfbc3f91a Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Fri, 31 Jan 2014 00:33:36 +0100 Subject: gnu: Add GNUnet. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnunet/packages/gnunet.scm (gnunet): New variable. * gnu/package/patches/gnunet-fix-scheduler.patch: New file. * gnu/package/patches/gnunet-fix-tests.patch: New file. * gnu-system.am (dist_patch_DATA): Add the above two patch files. Co-authored-by: Andreas Enge Signed-off-by: Ludovic Courtès --- gnu-system.am | 2 + gnu/packages/gnunet.scm | 69 +++++++++++++++++++++++++ gnu/packages/patches/gnunet-fix-scheduler.patch | 13 +++++ gnu/packages/patches/gnunet-fix-tests.patch | 46 +++++++++++++++++ 4 files changed, 130 insertions(+) create mode 100644 gnu/packages/patches/gnunet-fix-scheduler.patch create mode 100644 gnu/packages/patches/gnunet-fix-tests.patch (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index a98ef250d0..3e9108cd87 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -259,6 +259,8 @@ dist_patch_DATA = \ gnu/packages/patches/glibc-bootstrap-system.patch \ gnu/packages/patches/glibc-ldd-x86_64.patch \ gnu/packages/patches/glibc-make-4.0.patch \ + gnu/packages/patches/gnunet-fix-scheduler.patch \ + gnu/packages/patches/gnunet-fix-tests.patch \ gnu/packages/patches/gobject-introspection-cc.patch \ gnu/packages/patches/grub-gets-undeclared.patch \ gnu/packages/patches/gstreamer-0.10-bison3.patch \ diff --git a/gnu/packages/gnunet.scm b/gnu/packages/gnunet.scm index 6af9063f19..2bbe72ffe1 100644 --- a/gnu/packages/gnunet.scm +++ b/gnu/packages/gnunet.scm @@ -17,6 +17,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages gnunet) + #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages compression) #:use-module (gnu packages curl) @@ -30,10 +31,14 @@ #:use-module (gnu packages libidn) #:use-module (gnu packages libjpeg) #:use-module (gnu packages libtiff) + #:use-module (gnu packages libunistring) + #:use-module (gnu packages maths) #:use-module (gnu packages openssl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages perl) + #:use-module (gnu packages pulseaudio) #:use-module (gnu packages python) + #:use-module (gnu packages sqlite) #:use-module (gnu packages video) #:use-module (gnu packages xiph) #:use-module ((guix licenses) @@ -184,3 +189,67 @@ supports HTTPS, HTTPS and GnuTLS.") (license (license:bsd-style "file://COPYING" "See COPYING in the distribution.")) (home-page "https://gnunet.org/gnurl"))) + +(define-public gnunet + (package + (name "gnunet") + (version "0.10.0") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://gnu/gnunet/gnunet-" version + ".tar.gz")) + (sha256 (base32 + "0zqpc47kywhjrpphl0palz849khv00ra2gjrfkysp6p0gfsbvd0i")) + (patches + (list + ;; Patch to fix serious bug in scheduler; upstream commit: #31747 + (search-patch "gnunet-fix-scheduler.patch") + ;; Patch to fix bugs in testcases: + ;; * Disable peerinfo-tool tests as they depend on reverse DNS lookups + ;; * Allow revocation testcase to run on loopback; upstream: #32130 + ;; * Skip GNS testcases requiring DNS lookups; upstream: #32118 + (search-patch "gnunet-fix-tests.patch"))) + (patch-flags '("-p0")))) + (build-system gnu-build-system) + (inputs + `(("gnutls" ,gnutls) + ("glpk" ,glpk) + ("libextractor" ,libextractor) + ("libgcrypt" ,libgcrypt) + ("gnurl" ,gnurl) + ("libidn" ,libidn) + ("openssl" ,openssl) + ("opus" ,opus) + ("libtool" ,libtool) + ("libunistring" ,libunistring) + ("pulseaudio", pulseaudio) + ("sqlite" ,sqlite) + ("zlib" ,zlib))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python" ,python-2))) + (arguments + '(#:phases + ;; swap check and install phases and set paths to installed binaries + (alist-cons-before + 'check 'set-path-for-check + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (setenv "GNUNET_PREFIX" out) + (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin")))) + (alist-cons-after + 'install 'check + (assoc-ref %standard-phases 'check) + (alist-delete + 'check + %standard-phases))))) + (synopsis "Anonymous peer-to-peer file-sharing framework") + (description + "GNUnet is a framework for secure, peer-to-peer networking. It works in a +decentralized manner and does not rely on any notion of trusted services. One +service implemented on it is censorship-resistant file-sharing. Communication +is encrypted and anonymity is provided by making messages originating from a +peer indistinguishable from those that the peer is routing.") + (license license:gpl3+) + (home-page "https://gnunet.org/"))) diff --git a/gnu/packages/patches/gnunet-fix-scheduler.patch b/gnu/packages/patches/gnunet-fix-scheduler.patch new file mode 100644 index 0000000000..1e0aef2a1a --- /dev/null +++ b/gnu/packages/patches/gnunet-fix-scheduler.patch @@ -0,0 +1,13 @@ +Index: src/util/scheduler.c +=================================================================== +--- src/util/scheduler.c (revision 31745) ++++ src/util/scheduler.c (working copy) +@@ -1599,7 +1599,7 @@ + int real_fd; + + GNUNET_DISK_internal_file_handle_ (fd, &real_fd, sizeof (int)); +- GNUNET_assert (real_fd > 0); ++ GNUNET_assert (real_fd >= 0); + return add_without_sets ( + delay, priority, + on_read ? real_fd : -1, diff --git a/gnu/packages/patches/gnunet-fix-tests.patch b/gnu/packages/patches/gnunet-fix-tests.patch new file mode 100644 index 0000000000..1957b17119 --- /dev/null +++ b/gnu/packages/patches/gnunet-fix-tests.patch @@ -0,0 +1,46 @@ +diff -ru a/src/peerinfo-tool/Makefile.in b/src/peerinfo-tool/Makefile.in +--- src/peerinfo-tool/Makefile.in 2013-12-24 13:55:04.000000000 +0100 ++++ src/peerinfo-tool/Makefile.in 2014-01-30 13:07:52.275965484 +0100 +@@ -335,9 +335,6 @@ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/util/libgnunetutil.la + +-@HAVE_PYTHON_TRUE@check_SCRIPTS = \ +-@HAVE_PYTHON_TRUE@ test_gnunet_peerinfo.py +- + @ENABLE_TEST_RUN_TRUE@TESTS = $(check_SCRIPTS) + do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g' + EXTRA_DIST = \ +diff -ru a/src/revocation/test_revocation.conf b/src/revocation/test_revocation.conf +--- src/revocation/test_revocation.conf 2013-12-21 18:57:06.000000000 +0100 ++++ src/revocation/test_revocation.conf 2014-01-30 15:00:02.841340556 +0100 +@@ -20,6 +20,9 @@ + [transport-udp] + BROADCAST = NO + ++[nat] ++RETURN_LOCAL_ADDRESSES = YES ++ + [peerinfo] + USE_INCLUDED_HELLOS = NO + +Index: src/gns/test_gns_cname_lookup.sh +=================================================================== +--- src/gns/test_gns_cname_lookup.sh (revision 32117) ++++ src/gns/test_gns_cname_lookup.sh (revision 32118) +@@ -13,6 +13,15 @@ + exit 77 + fi + ++# permissive DNS resolver we will use for the test ++DNS_RESOLVER="8.8.8.8" ++if ! nslookup gnunet.org $DNS_RESOLVER &> /dev/null ++then ++ echo "Cannot reach DNS, skipping test" ++ exit 77 ++fi ++ ++ + rm -rf /tmp/test-gnunet-gns-peer-1/ + + TEST_DOMAIN_PLUS="www.gnu" -- cgit v1.2.3 From b6b29c7737147bf683eb61bdbc93ad712a228ca7 Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Tue, 11 Feb 2014 19:17:33 +0100 Subject: gnu: curl, gnurl: Fix failing testcase 172. * gnu/packages/patches/curl-fix-test172.patch: New file. * gnu-system.am (dist_patch_DATA): Add the patch file. * gnu/packages/gnunet.scm (gnurl): Apply the patch file. * gnu/packages/curl.scm (curl): Apply the patch file. Signed-off-by: Andreas Enge --- gnu-system.am | 1 + gnu/packages/curl.scm | 7 ++++++- gnu/packages/gnunet.scm | 5 ++++- gnu/packages/patches/curl-fix-test172.patch | 12 ++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/curl-fix-test172.patch (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 3e9108cd87..8229cf0cdd 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -242,6 +242,7 @@ dist_patch_DATA = \ gnu/packages/patches/cdparanoia-fpic.patch \ gnu/packages/patches/cmake-fix-tests.patch \ gnu/packages/patches/cpio-gets-undeclared.patch \ + gnu/packages/patches/curl-fix-test172.patch \ gnu/packages/patches/dbus-localstatedir.patch \ gnu/packages/patches/diffutils-gets-undeclared.patch \ gnu/packages/patches/dmd-getpw.patch \ diff --git a/gnu/packages/curl.scm b/gnu/packages/curl.scm index 7072ed3878..a9bfa76aa0 100644 --- a/gnu/packages/curl.scm +++ b/gnu/packages/curl.scm @@ -22,6 +22,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) + #:use-module (gnu packages) #:use-module (gnu packages compression) #:use-module (gnu packages gnutls) #:use-module (gnu packages groff) @@ -42,7 +43,11 @@ version ".tar.lzma")) (sha256 (base32 - "13bhfs41yf60ys2hrikqxjwfzaj0gm91kqzsgc5fr4grzmpm38nx")))) + "13bhfs41yf60ys2hrikqxjwfzaj0gm91kqzsgc5fr4grzmpm38nx")) + (patches + ;; This patch fixes testcase 172 which uses a hardcoded cookie + ;; expiration value which is expired as of Feb 1, 2014. + (list (search-patch "curl-fix-test172.patch"))))) (build-system gnu-build-system) (inputs `(("gnutls" ,gnutls) ("gss" ,gss) diff --git a/gnu/packages/gnunet.scm b/gnu/packages/gnunet.scm index 1529f96283..f3448a7e63 100644 --- a/gnu/packages/gnunet.scm +++ b/gnu/packages/gnunet.scm @@ -144,7 +144,10 @@ and support for SSL3 and TLS.") version ".tar.bz2")) (sha256 (base32 - "0kpi9wx9lg938b982smjg54acdwswdshs2bzf10sj5r6zmb05ygp")))) + "0kpi9wx9lg938b982smjg54acdwswdshs2bzf10sj5r6zmb05ygp")) + ;; This patch fixes testcase 172 which uses a hardcoded cookie + ;; expiration value which is expired as of Feb 1, 2014. + (patches (list (search-patch "curl-fix-test172.patch"))))) (build-system gnu-build-system) (inputs `(("gnutls" ,gnutls) ("libidn" ,libidn) diff --git a/gnu/packages/patches/curl-fix-test172.patch b/gnu/packages/patches/curl-fix-test172.patch new file mode 100644 index 0000000000..cc2c2705e7 --- /dev/null +++ b/gnu/packages/patches/curl-fix-test172.patch @@ -0,0 +1,12 @@ +diff --git a/tests/data/test172 b/tests/data/test172 +index b3efae9..3d53418 100644 +--- a/tests/data/test172 ++++ b/tests/data/test172 +@@ -36,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/we/want/172 -b log/jar172.txt -b "tool=curl; name=fool" + + .%HOSTIP TRUE /silly/ FALSE 0 ismatch this + .%HOSTIP TRUE / FALSE 0 partmatch present +-%HOSTIP FALSE /we/want/ FALSE 1391252187 nodomain value ++%HOSTIP FALSE /we/want/ FALSE 2139150993 nodomain value + + -- cgit v1.2.3 From 0193c004322821409e7130f601c0ece676b32665 Mon Sep 17 00:00:00 2001 From: Manolis Ragkousis Date: Sun, 16 Feb 2014 10:17:52 +0000 Subject: gnu: Add GNU Mach headers. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/hurd.scm: New file * gnu-system.am (GNU_SYSTEM_MODULES): Add hurd.scm Co-authored-by: Ludovic Courtès Signed-off-by: Ludovic Courtès --- gnu-system.am | 1 + gnu/packages/hurd.scm | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 gnu/packages/hurd.scm (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 8229cf0cdd..7e68290a95 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -105,6 +105,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/gxmessage.scm \ gnu/packages/help2man.scm \ gnu/packages/hugs.scm \ + gnu/packages/hurd.scm \ gnu/packages/icu4c.scm \ gnu/packages/idutils.scm \ gnu/packages/imagemagick.scm \ diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm new file mode 100644 index 0000000000..f915eda9cb --- /dev/null +++ b/gnu/packages/hurd.scm @@ -0,0 +1,57 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Manolis Fragkiskos Ragkousis +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages hurd) + #:use-module (guix licenses) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (guix build-system gnu)) + +(define-public gnumach-headers + (package + (name "gnumach-headers") + (version "1.4") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://gnu/gnumach/gnumach-" + version ".tar.gz")) + (sha256 + (base32 + "0r371wsm7imx356p0xsls5hifb1gf9y90rm1phr0qkahbmfk9hlv")))) + (build-system gnu-build-system) + (arguments + `(#:phases (alist-replace + 'install + (lambda _ + (zero? + (system* "make" "install-data"))) + (alist-delete + 'build + %standard-phases)) + + ;; GNU Mach supports only IA32 currently, so cheat so that we can at + ;; least install its headers. + #:configure-flags '("--build=i686-pc-gnu") + + #:tests? #f)) + (home-page "https://www.gnu.org/software/hurd/microkernel/mach/gnumach.html") + (synopsis "GNU Mach kernel headers") + (description + "Headers of the GNU Mach kernel.") + (license gpl2+))) -- cgit v1.2.3 From 445c5abad8032f000387f36cc0533556289e5175 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 13 Feb 2014 00:42:41 -0500 Subject: gnu: ratpoison: Patch to use $SHELL instead of /bin/sh. * gnu/packages/patches/ratpoison-shell.patch: New file. * gnu/packages/ratpoison.scm (ratpoison): Add patch. * gnu-system.am (dist_patch_DATA): Add patch. --- gnu-system.am | 1 + gnu/packages/patches/ratpoison-shell.patch | 91 ++++++++++++++++++++++++++++++ gnu/packages/ratpoison.scm | 4 +- 3 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/ratpoison-shell.patch (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 7e68290a95..44ecf86de8 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -298,6 +298,7 @@ dist_patch_DATA = \ gnu/packages/patches/qemu-make-4.0.patch \ gnu/packages/patches/qemu-multiple-smb-shares.patch \ gnu/packages/patches/qt4-tests.patch \ + gnu/packages/patches/ratpoison-shell.patch \ gnu/packages/patches/readline-link-ncurses.patch \ gnu/packages/patches/ripperx-libm.patch \ gnu/packages/patches/scheme48-tests.patch \ diff --git a/gnu/packages/patches/ratpoison-shell.patch b/gnu/packages/patches/ratpoison-shell.patch new file mode 100644 index 0000000000..63d265a382 --- /dev/null +++ b/gnu/packages/patches/ratpoison-shell.patch @@ -0,0 +1,91 @@ +Use $SHELL instead of hardcoding /bin/sh in ratpoison. + +Patch by Mark H Weaver . + +--- ratpoison/src/actions.c.orig 2013-04-06 21:37:43.000000000 -0400 ++++ ratpoison/src/actions.c 2014-02-13 00:34:10.992553710 -0500 +@@ -19,6 +19,7 @@ + */ + + #include ++#include + #include /* for isspace */ + #include + #include +@@ -223,12 +223,12 @@ + add_command ("escape", cmd_escape, 1, 1, 1, + "Key: ", arg_KEY); + add_command ("exec", cmd_exec, 1, 1, 1, +- "/bin/sh -c ", arg_SHELLCMD); ++ "$SHELL -c ", arg_SHELLCMD); + add_command ("execa", cmd_execa, 1, 1, 1, +- "/bin/sh -c ", arg_SHELLCMD); ++ "$SHELL -c ", arg_SHELLCMD); + add_command ("execf", cmd_execf, 2, 2, 2, + "frame to execute in:", arg_FRAME, +- "/bin/sh -c ", arg_SHELLCMD); ++ "$SHELL -c ", arg_SHELLCMD); + add_command ("fdump", cmd_fdump, 1, 0, 0, + "", arg_NUMBER); + add_command ("focus", cmd_next_frame, 0, 0, 0); +@@ -359,7 +359,7 @@ + add_command ("unsetenv", cmd_unsetenv, 1, 1, 1, + "Variable: ", arg_STRING); + add_command ("verbexec", cmd_verbexec, 1, 1, 1, +- "/bin/sh -c ", arg_SHELLCMD); ++ "$SHELL -c ", arg_SHELLCMD); + add_command ("version", cmd_version, 0, 0, 0); + add_command ("vsplit", cmd_v_split, 1, 0, 0, + "Split: ", arg_STRING); +@@ -2627,6 +2627,9 @@ + pid = fork(); + if (pid == 0) + { ++ char *shell_path; ++ char *shell_name; ++ + /* Some process setup to make sure the spawned process runs + in its own session. */ + putenv(current_screen()->display_string); +@@ -2641,7 +2644,18 @@ + /* raw means don't run it through sh. */ + if (raw) + execl (cmd, cmd, NULL); +- execl("/bin/sh", "sh", "-c", cmd, NULL); ++ ++ shell_path = getenv ("SHELL"); ++ if (shell_path == NULL) ++ shell_path = "/bin/sh"; ++ ++ shell_name = strrchr (shell_path, '/'); ++ if (shell_name == NULL) ++ shell_name = shell_path; ++ else ++ shell_name++; ++ ++ execl(shell_path, shell_name, "-c", cmd, NULL); + _exit(EXIT_FAILURE); + } + +--- ratpoison/src/events.c.orig 2013-04-06 20:05:48.000000000 -0400 ++++ ratpoison/src/events.c 2014-02-13 00:34:39.327758789 -0500 +@@ -920,7 +920,7 @@ + { + /* Report any child that didn't return 0. */ + if (cur->status != 0) +- marked_message_printf (0,0, "/bin/sh -c \"%s\" finished (%d)", ++ marked_message_printf (0,0, "$SHELL -c \"%s\" finished (%d)", + cur->cmd, cur->status); + list_del (&cur->node); + free (cur->cmd); +--- ratpoison/src/messages.h.orig 2012-07-20 20:25:33.000000000 -0400 ++++ ratpoison/src/messages.h 2014-02-13 00:34:28.608398437 -0500 +@@ -41,7 +41,7 @@ + + #define MESSAGE_PROMPT_SWITCH_TO_WINDOW "Switch to window: " + #define MESSAGE_PROMPT_NEW_WINDOW_NAME "Set window's title to: " +-#define MESSAGE_PROMPT_SHELL_COMMAND "/bin/sh -c " ++#define MESSAGE_PROMPT_SHELL_COMMAND "$SHELL -c " + #define MESSAGE_PROMPT_COMMAND ":" + #define MESSAGE_PROMPT_SWITCH_WM "Switch to wm: " + #define MESSAGE_PROMPT_XTERM_COMMAND MESSAGE_PROMPT_SHELL_COMMAND TERM_PROG " -e " diff --git a/gnu/packages/ratpoison.scm b/gnu/packages/ratpoison.scm index fb1bfd8516..aabd1d330c 100644 --- a/gnu/packages/ratpoison.scm +++ b/gnu/packages/ratpoison.scm @@ -21,6 +21,7 @@ #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module ((guix licenses) #:select (gpl2+)) + #:use-module (gnu packages) #:use-module (gnu packages xorg) #:use-module (gnu packages perl) #:use-module (gnu packages readline) @@ -37,7 +38,8 @@ version ".tar.xz")) (sha256 (base32 - "0v4mh8d3vsh5xbbycfdl3g8zfygi1rkslh1x7k5hi1d05bfq3cdr")))) + "0v4mh8d3vsh5xbbycfdl3g8zfygi1rkslh1x7k5hi1d05bfq3cdr")) + (patches (list (search-patch "ratpoison-shell.patch"))))) (build-system gnu-build-system) (inputs `(("libXi" ,libxi) -- cgit v1.2.3 From 436c95d9a73064d7884530928a6ebb331377a9e3 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 16 Feb 2014 02:23:18 -0500 Subject: gnu: dmd: Sleep longer in tests, for slower machines. * gnu/packages/patches/dmd-tests-longer-sleeps.patch: New file. * gnu/packages/admin.scm (dmd): Add the patch. * gnu-system.am (dist_patch_DATA): Add it. --- gnu-system.am | 1 + gnu/packages/admin.scm | 3 +- gnu/packages/patches/dmd-tests-longer-sleeps.patch | 52 ++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/dmd-tests-longer-sleeps.patch (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 44ecf86de8..9b0a6919d9 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -247,6 +247,7 @@ dist_patch_DATA = \ gnu/packages/patches/dbus-localstatedir.patch \ gnu/packages/patches/diffutils-gets-undeclared.patch \ gnu/packages/patches/dmd-getpw.patch \ + gnu/packages/patches/dmd-tests-longer-sleeps.patch \ gnu/packages/patches/emacs-configure-sh.patch \ gnu/packages/patches/findutils-absolute-paths.patch \ gnu/packages/patches/flac-fix-memcmp-not-declared.patch \ diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 928d752531..6998996523 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -49,7 +49,8 @@ (sha256 (base32 "07mddw0p62fcphwjzgb6rfa0pjz5sy6jzbha0sm2vc3rqf459jxg")) - (patches (list (search-patch "dmd-getpw.patch"))))) + (patches (list (search-patch "dmd-getpw.patch") + (search-patch "dmd-tests-longer-sleeps.patch"))))) (build-system gnu-build-system) (arguments '(#:configure-flags '("--localstatedir=/var"))) diff --git a/gnu/packages/patches/dmd-tests-longer-sleeps.patch b/gnu/packages/patches/dmd-tests-longer-sleeps.patch new file mode 100644 index 0000000000..708000f351 --- /dev/null +++ b/gnu/packages/patches/dmd-tests-longer-sleeps.patch @@ -0,0 +1,52 @@ +Increase sleep times in tests, for slower machines. + +Patch by Mark H Weaver . + +--- dmd/tests/basic.sh 2013-11-30 17:22:00.000000000 -0500 ++++ dmd/tests/basic.sh 2014-02-16 02:18:34.036376953 -0500 +@@ -46,7 +46,7 @@ + dmd -I -s "$socket" -c "$conf" -l "$log" & + dmd_pid=$! + +-sleep 1 # XXX: wait till it's up ++sleep 3 # XXX: wait till it's up + kill -0 $dmd_pid + test -S "$socket" + $deco status dmd | grep -E '(Start.*dmd|Stop.*test)' +--- dmd/tests/respawn.sh 2013-12-01 16:50:37.000000000 -0500 ++++ dmd/tests/respawn.sh 2014-02-16 02:19:16.958251953 -0500 +@@ -39,7 +39,7 @@ + i=0 + while ! test -f "$1" && test $i -lt 20 + do +- sleep 0.3 ++ sleep 1 + i=`expr $i + 1` + done + test -f "$1" +@@ -65,14 +65,14 @@ + #:provides '(test1) + #:start (make-forkexec-constructor + "$SHELL" "-c" +- "echo \$\$ > $service1_pid ; while true ; do sleep 1 ; done") ++ "echo \$\$ > $service1_pid ; while true ; do sleep 3 ; done") + #:stop (make-kill-destructor) + #:respawn? #t) + (make + #:provides '(test2) + #:start (make-forkexec-constructor + "$SHELL" "-c" +- "echo \$\$ > $service2_pid ; while true ; do sleep 1 ; done") ++ "echo \$\$ > $service2_pid ; while true ; do sleep 3 ; done") + #:stop (make-kill-destructor) + #:respawn? #t)) + (start 'test1) +@@ -82,7 +82,7 @@ + dmd -I -s "$socket" -c "$conf" -l "$log" & + dmd_pid=$! + +-sleep 1 # XXX: wait till it's up ++sleep 3 # XXX: wait till it's up + kill -0 $dmd_pid + test -S "$socket" + $deco status test1 | grep started -- cgit v1.2.3 From 98e7fc9b02f00f3f2324b12dec1a6cd9beafbe01 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 16 Feb 2014 23:09:18 -0500 Subject: gnu: Add xapian. * gnu/packages/search.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. --- gnu-system.am | 1 + gnu/packages/search.scm | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 gnu/packages/search.scm (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 9b0a6919d9..86bece3638 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -184,6 +184,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/scheme.scm \ gnu/packages/screen.scm \ gnu/packages/sdl.scm \ + gnu/packages/search.scm \ gnu/packages/serveez.scm \ gnu/packages/shishi.scm \ gnu/packages/skribilo.scm \ diff --git a/gnu/packages/search.scm b/gnu/packages/search.scm new file mode 100644 index 0000000000..282893d2e6 --- /dev/null +++ b/gnu/packages/search.scm @@ -0,0 +1,58 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Mark H Weaver +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages search) + #:use-module ((guix licenses) + #:select (gpl2+ bsd-3 x11)) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages compression) + #:use-module (gnu packages linux) + #:export (xapian)) + +(define-public xapian + (package + (name "xapian") + (version "1.2.17") + (source (origin + (method url-fetch) + (uri (string-append "http://oligarchy.co.uk/xapian/" version + "/xapian-core-" version ".tar.xz")) + (sha256 + (base32 "1pn65h06c23imck2pb42zhrrngch3clk39wl2bjwyqhfyfq4b7g7")))) + (build-system gnu-build-system) + (inputs `(("zlib" ,zlib) + ("util-linux" ,util-linux))) + (arguments + `(#:phases (alist-cons-after + 'unpack 'patch-remotetcp-harness + (lambda _ + (substitute* "tests/harness/backendmanager_remotetcp.cc" + (("/bin/sh") (which "bash")))) + %standard-phases))) + (synopsis "Search Engine Library") + (description + "Xapian is a highly adaptable toolkit which allows developers to easily +add advanced indexing and search facilities to their own applications. It +supports the Probabilistic Information Retrieval model and also supports a +rich set of boolean query operators.") + (home-page "http://xapian.org/") + (license (list gpl2+ bsd-3 x11)))) + +;;; search.scm ends here -- cgit v1.2.3 From 0841dcf7dd8e6c3e474f75cfa5b95a7feaf6f112 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 16 Feb 2014 20:20:10 -0500 Subject: gnu: patchelf: Fix platform page size determination. * gnu/packages/patches/patchelf-page-size.patch: New file. * gnu/packages/elf.scm (patchelf): Add the patch. * gnu-system.am (dist_patch_DATA): Add the patch. --- gnu-system.am | 1 + gnu/packages/elf.scm | 4 +- gnu/packages/patches/patchelf-page-size.patch | 69 +++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/patchelf-page-size.patch (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 86bece3638..d231cfa57b 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -291,6 +291,7 @@ dist_patch_DATA = \ gnu/packages/patches/make-impure-dirs.patch \ gnu/packages/patches/mcron-install.patch \ gnu/packages/patches/mit-krb5-init-fix.patch \ + gnu/packages/patches/patchelf-page-size.patch \ gnu/packages/patches/perl-no-sys-dirs.patch \ gnu/packages/patches/plotutils-libpng-jmpbuf.patch \ gnu/packages/patches/procps-make-3.82.patch \ diff --git a/gnu/packages/elf.scm b/gnu/packages/elf.scm index 1df9956f87..45714be70e 100644 --- a/gnu/packages/elf.scm +++ b/gnu/packages/elf.scm @@ -21,6 +21,7 @@ #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module ((guix licenses) #:select (gpl3+ lgpl3+ lgpl2.0+)) + #:use-module (gnu packages) #:use-module (gnu packages m4) #:use-module (gnu packages compression)) @@ -92,7 +93,8 @@ "/patchelf-" version ".tar.bz2")) (sha256 (base32 - "00bw29vdsscsili65wcb5ay0gvg1w0ljd00sb5xc6br8bylpyzpw")))) + "00bw29vdsscsili65wcb5ay0gvg1w0ljd00sb5xc6br8bylpyzpw")) + (patches (list (search-patch "patchelf-page-size.patch"))))) (build-system gnu-build-system) (home-page "http://nixos.org/patchelf.html") (synopsis "Modify the dynamic linker and RPATH of ELF executables") diff --git a/gnu/packages/patches/patchelf-page-size.patch b/gnu/packages/patches/patchelf-page-size.patch new file mode 100644 index 0000000000..2528b604e5 --- /dev/null +++ b/gnu/packages/patches/patchelf-page-size.patch @@ -0,0 +1,69 @@ +Improve the determination of pageSize in patchelf.cc. + +Patch by Mark H Weaver . + +--- patchelf/src/patchelf.cc.orig 1969-12-31 19:00:01.000000000 -0500 ++++ patchelf/src/patchelf.cc 2014-02-16 20:15:06.283203125 -0500 +@@ -21,11 +21,19 @@ + using namespace std; + + +-#ifdef MIPSEL +-/* The lemote fuloong 2f kernel defconfig sets a page size of 16KB */ +-const unsigned int pageSize = 4096*4; +-#else ++/* Note that some platforms support multiple page sizes. Therefore, ++ it is not enough to query the current page size. 'pageSize' must ++ be the maximum architectural page size for the platform, which is ++ typically defined in the corresponding ABI document. ++ ++ XXX FIXME: This won't work when we're cross-compiling. */ ++ ++#if defined __MIPSEL__ || defined __MIPSEB__ || defined __aarch64__ ++const unsigned int pageSize = 65536; ++#elif defined __x86_64__ || defined __i386__ || defined __arm__ + const unsigned int pageSize = 4096; ++#else ++# error maximum architectural page size unknown for this platform + #endif + + +--- patchelf/tests/no-rpath.sh.orig 1969-12-31 19:00:01.000000000 -0500 ++++ patchelf/tests/no-rpath.sh 2014-02-16 20:44:12.036376953 -0500 +@@ -1,22 +1,22 @@ + #! /bin/sh -e + +-rm -rf scratch +-mkdir -p scratch ++if [ "$(uname -m)" = i686 -a "$(uname -s)" = Linux ]; then ++ rm -rf scratch ++ mkdir -p scratch + +-cp no-rpath scratch/ ++ cp no-rpath scratch/ + +-oldRPath=$(../src/patchelf --print-rpath scratch/no-rpath) +-if test -n "$oldRPath"; then exit 1; fi +-../src/patchelf \ +- --set-interpreter "$(../src/patchelf --print-interpreter ../src/patchelf)" \ +- --set-rpath /foo:/bar:/xxxxxxxxxxxxxxx scratch/no-rpath ++ oldRPath=$(../src/patchelf --print-rpath scratch/no-rpath) ++ if test -n "$oldRPath"; then exit 1; fi ++ ../src/patchelf \ ++ --set-interpreter "$(../src/patchelf --print-interpreter ../src/patchelf)" \ ++ --set-rpath /foo:/bar:/xxxxxxxxxxxxxxx scratch/no-rpath + +-newRPath=$(../src/patchelf --print-rpath scratch/no-rpath) +-if ! echo "$newRPath" | grep -q '/foo:/bar'; then +- echo "incomplete RPATH" +- exit 1 +-fi ++ newRPath=$(../src/patchelf --print-rpath scratch/no-rpath) ++ if ! echo "$newRPath" | grep -q '/foo:/bar'; then ++ echo "incomplete RPATH" ++ exit 1 ++ fi + +-if [ "$(uname -m)" = i686 -a "$(uname -s)" = Linux ]; then + cd scratch && ./no-rpath + fi -- cgit v1.2.3 From db4fdc04cc05495788ee54ae25baf8cd056917dc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 19 Feb 2014 20:58:24 +0100 Subject: gnu: Introduce the (gnu services ...) modules. * gnu/system/dmd.scm: Remove file. Move contents to... * gnu/services.scm, gnu/services/base.scm, gnu/services/dmd.scm, gnu/services/networking.scm, gnu/services/xorg.scm: ... here. New files. * gnu/system.scm, gnu/system/vm.scm: Adjust accordingly. * guix/scripts/system.scm (%user-module): Likewise. * doc/guix.texi (Using the Configuration System): Likewise. (Defining Services): Likewise. --- doc/guix.texi | 8 +- gnu-system.am | 11 +- gnu/services.scm | 62 ++++++ gnu/services/base.scm | 176 +++++++++++++++++ gnu/services/dmd.scm | 77 ++++++++ gnu/services/networking.scm | 80 ++++++++ gnu/services/xorg.scm | 186 ++++++++++++++++++ gnu/system.scm | 6 +- gnu/system/dmd.scm | 470 -------------------------------------------- gnu/system/vm.scm | 2 +- guix/scripts/system.scm | 2 +- 11 files changed, 600 insertions(+), 480 deletions(-) create mode 100644 gnu/services.scm create mode 100644 gnu/services/base.scm create mode 100644 gnu/services/dmd.scm create mode 100644 gnu/services/networking.scm create mode 100644 gnu/services/xorg.scm delete mode 100644 gnu/system/dmd.scm (limited to 'gnu-system.am') diff --git a/doc/guix.texi b/doc/guix.texi index e6636dc71f..9a0deeac59 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2562,9 +2562,9 @@ Linux-Libre kernel, initial RAM disk, and boot loader looks like this: @findex operating-system @lisp -(use-modules (gnu system) +(use-modules (gnu services base) + (gnu services ssh) ; for 'lsh-service' (gnu system shadow) ; for 'user-account' - (gnu system service) ; for 'lsh-service' (gnu packages base) ; Coreutils, grep, etc. (gnu packages bash) ; Bash (gnu packages admin) ; dmd, Inetutils @@ -2603,7 +2603,7 @@ visible on the system, for all user accounts---i.e., in every user's The @code{services} field lists @dfn{system services} to be made available when the system starts. The @var{%standard-services} list, -from the @code{(gnu system)} module, provides the basic services one +from the @code{(gnu services base)} module, provides the basic services one would expect from a GNU system: a login service (mingetty) on each tty, syslogd, libc's name service cache daemon (nscd), etc. @@ -2666,7 +2666,7 @@ The VM shares its store with the host system. @node Defining Services @subsection Defining Services -The @code{(gnu system dmd)} module defines several procedures that allow +The @code{(gnu services @dots{})} modules define several procedures that allow users to declare the operating system's services (@pxref{Using the Configuration System}). These procedures are @emph{monadic procedures}---i.e., procedures that return a monadic value in the store diff --git a/gnu-system.am b/gnu-system.am index d231cfa57b..857c9bf663 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -70,7 +70,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/fonts.scm \ gnu/packages/fontutils.scm \ gnu/packages/freeipmi.scm \ - gnu/packages/games.scm \ + gnu/packages/games.scm \ gnu/packages/gawk.scm \ gnu/packages/gcal.scm \ gnu/packages/gcc.scm \ @@ -210,7 +210,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/vpn.scm \ gnu/packages/w3m.scm \ gnu/packages/wdiff.scm \ - gnu/packages/web.scm \ + gnu/packages/web.scm \ gnu/packages/wget.scm \ gnu/packages/which.scm \ gnu/packages/wordnet.scm \ @@ -223,8 +223,13 @@ GNU_SYSTEM_MODULES = \ gnu/packages/zile.scm \ gnu/packages/zip.scm \ \ + gnu/services.scm \ + gnu/services/base.scm \ + gnu/services/dmd.scm \ + gnu/services/networking.scm \ + gnu/services/xorg.scm \ + \ gnu/system.scm \ - gnu/system/dmd.scm \ gnu/system/grub.scm \ gnu/system/linux.scm \ gnu/system/linux-initrd.scm \ diff --git a/gnu/services.scm b/gnu/services.scm new file mode 100644 index 0000000000..eccde4e9a3 --- /dev/null +++ b/gnu/services.scm @@ -0,0 +1,62 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2013, 2014 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services) + #:use-module (guix records) + #:export (service? + service + service-documentation + service-provision + service-requirement + service-respawn? + service-start + service-stop + service-inputs + service-user-accounts + service-user-groups + service-pam-services)) + +;;; Commentary: +;;; +;;; System services as cajoled by dmd. +;;; +;;; Code: + +(define-record-type* + service make-service + service? + (documentation service-documentation ; string + (default "[No documentation.]")) + (provision service-provision) ; list of symbols + (requirement service-requirement ; list of symbols + (default '())) + (respawn? service-respawn? ; Boolean + (default #t)) + (start service-start) ; expression + (stop service-stop ; expression + (default #f)) + (inputs service-inputs ; list of inputs + (default '())) + (user-accounts service-user-accounts ; list of + (default '())) + (user-groups service-user-groups ; list of + (default '())) + (pam-services service-pam-services ; list of + (default '()))) + +;;; services.scm ends here. diff --git a/gnu/services/base.scm b/gnu/services/base.scm new file mode 100644 index 0000000000..3d684a5bec --- /dev/null +++ b/gnu/services/base.scm @@ -0,0 +1,176 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2013, 2014 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services base) + #:use-module (gnu services) + #:use-module (gnu system shadow) ; 'user-account', etc. + #:use-module (gnu system linux) ; 'pam-service', etc. + #:use-module (gnu packages admin) + #:use-module ((gnu packages base) + #:select (glibc-final)) + #:use-module (gnu packages package-management) + #:use-module (guix monads) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:use-module (ice-9 format) + #:export (host-name-service + mingetty-service + nscd-service + syslog-service + guix-service)) + +;;; Commentary: +;;; +;;; Base system services---i.e., services that 99% of the users will want to +;;; use. +;;; +;;; Code: + +(define (host-name-service name) + "Return a service that sets the host name to NAME." + (with-monad %store-monad + (return (service + (documentation "Initialize the machine's host name.") + (provision '(host-name)) + (start `(lambda _ + (sethostname ,name))) + (respawn? #f))))) + +(define* (mingetty-service tty + #:key + (motd (text-file "motd" "Welcome.\n")) + (allow-empty-passwords? #t)) + "Return a service to run mingetty on TTY." + (mlet %store-monad ((mingetty-bin (package-file mingetty "sbin/mingetty")) + (motd motd)) + (return + (service + (documentation (string-append "Run mingetty on " tty ".")) + (provision (list (symbol-append 'term- (string->symbol tty)))) + + ;; Since the login prompt shows the host name, wait for the 'host-name' + ;; service to be done. + (requirement '(host-name)) + + (start `(make-forkexec-constructor ,mingetty-bin "--noclear" ,tty)) + (stop `(make-kill-destructor)) + (inputs `(("mingetty" ,mingetty) + ("motd" ,motd))) + + (pam-services + ;; Let 'login' be known to PAM. All the mingetty services will have + ;; that PAM service, but that's fine because they're all identical and + ;; duplicates are removed. + (list (unix-pam-service "login" + #:allow-empty-passwords? allow-empty-passwords? + #:motd motd))))))) + +(define* (nscd-service #:key (glibc glibc-final)) + "Return a service that runs libc's name service cache daemon (nscd)." + (mlet %store-monad ((nscd (package-file glibc "sbin/nscd"))) + (return (service + (documentation "Run libc's name service cache daemon (nscd).") + (provision '(nscd)) + (start `(make-forkexec-constructor ,nscd "-f" "/dev/null" + "--foreground")) + (stop `(make-kill-destructor)) + + (respawn? #f) + (inputs `(("glibc" ,glibc))))))) + +(define (syslog-service) + "Return a service that runs 'syslogd' with reasonable default settings." + + ;; Snippet adapted from the GNU inetutils manual. + (define contents " + # Log all kernel messages, authentication messages of + # level notice or higher and anything of level err or + # higher to the console. + # Don't log private authentication messages! + *.err;kern.*;auth.notice;authpriv.none /dev/console + + # Log anything (except mail) of level info or higher. + # Don't log private authentication messages! + *.info;mail.none;authpriv.none /var/log/messages + + # Same, in a different place. + *.info;mail.none;authpriv.none /dev/tty12 + + # The authpriv file has restricted access. + authpriv.* /var/log/secure + + # Log all the mail messages in one place. + mail.* /var/log/maillog +") + + (mlet %store-monad + ((syslog.conf (text-file "syslog.conf" contents)) + (syslogd (package-file inetutils "libexec/syslogd"))) + (return + (service + (documentation "Run the syslog daemon (syslogd).") + (provision '(syslogd)) + (start `(make-forkexec-constructor ,syslogd "--no-detach" + "--rcfile" ,syslog.conf)) + (stop `(make-kill-destructor)) + (inputs `(("inetutils" ,inetutils) + ("syslog.conf" ,syslog.conf))))))) + +(define* (guix-build-accounts count #:key + (first-uid 30001) + (gid 30000) + (shadow shadow)) + "Return a list of COUNT user accounts for Guix build users, with UIDs +starting at FIRST-UID, and under GID." + (with-monad %store-monad + (return (unfold (cut > <> count) + (lambda (n) + (user-account + (name (format #f "guixbuilder~2,'0d" n)) + (password "!") + (uid (+ first-uid n -1)) + (gid gid) + (comment (format #f "Guix Build User ~2d" n)) + (home-directory "/var/empty") + (shell (package-file shadow "sbin/nologin")) + (inputs `(("shadow" ,shadow))))) + 1+ + 1)))) + +(define* (guix-service #:key (guix guix) (builder-group "guixbuild") + (build-user-gid 30000) (build-accounts 10)) + "Return a service that runs the build daemon from GUIX, and has +BUILD-ACCOUNTS user accounts available under BUILD-USER-GID." + (mlet %store-monad ((daemon (package-file guix "bin/guix-daemon")) + (accounts (guix-build-accounts build-accounts + #:gid build-user-gid))) + (return (service + (provision '(guix-daemon)) + (start `(make-forkexec-constructor ,daemon + "--build-users-group" + ,builder-group)) + (stop `(make-kill-destructor)) + (inputs `(("guix" ,guix))) + (user-accounts accounts) + (user-groups (list (user-group + (name builder-group) + (id build-user-gid) + (members (map user-account-name + user-accounts))))))))) + +;;; base.scm ends here diff --git a/gnu/services/dmd.scm b/gnu/services/dmd.scm new file mode 100644 index 0000000000..21719118eb --- /dev/null +++ b/gnu/services/dmd.scm @@ -0,0 +1,77 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2013, 2014 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services dmd) + #:use-module (guix monads) + #:use-module (gnu services) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:export (dmd-configuration-file)) + +;;; Commentary: +;;; +;;; Instantiating system services as a dmd configuration file. +;;; +;;; Code: + +(define (dmd-configuration-file services etc) + "Return the dmd configuration file for SERVICES, that initializes /etc from +ETC (the name of a directory in the store) on startup." + (define config + `(begin + (use-modules (ice-9 ftw)) + + (register-services + ,@(map (lambda (service) + `(make + #:docstring ',(service-documentation service) + #:provides ',(service-provision service) + #:requires ',(service-requirement service) + #:respawn? ',(service-respawn? service) + #:start ,(service-start service) + #:stop ,(service-stop service))) + services)) + + ;; /etc is a mixture of static and dynamic settings. Here is where we + ;; initialize it from the static part. + (format #t "populating /etc from ~a...~%" ,etc) + (let ((rm-f (lambda (f) + (false-if-exception (delete-file f))))) + (rm-f "/etc/static") + (symlink ,etc "/etc/static") + (for-each (lambda (file) + ;; TODO: Handle 'shadow' specially so that changed + ;; password aren't lost. + (let ((target (string-append "/etc/" file)) + (source (string-append "/etc/static/" file))) + (rm-f target) + (symlink source target))) + (scandir ,etc + (lambda (file) + (not (member file '("." "..")))))) + + ;; Prevent ETC from being GC'd. + (rm-f "/var/nix/gcroots/etc-directory") + (symlink ,etc "/var/nix/gcroots/etc-directory")) + + (format #t "starting services...~%") + (for-each start ',(append-map service-provision services)))) + + (text-file "dmd.conf" (object->string config))) + +;;; dmd.scm ends here diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm new file mode 100644 index 0000000000..317800db50 --- /dev/null +++ b/gnu/services/networking.scm @@ -0,0 +1,80 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2013, 2014 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services networking) + #:use-module (gnu services) + #:use-module (gnu packages admin) + #:use-module (gnu packages linux) + #:use-module (guix monads) + #:export (static-networking-service)) + +;;; Commentary: +;;; +;;; Networking services. +;;; +;;; Code: + +(define* (static-networking-service interface ip + #:key + gateway + (name-servers '()) + (inetutils inetutils) + (net-tools net-tools)) + "Return a service that starts INTERFACE with address IP. If GATEWAY is +true, it must be a string specifying the default network gateway." + + ;; TODO: Eventually we should do this using Guile's networking procedures, + ;; like 'configure-qemu-networking' does, but the patch that does this is + ;; not yet in stock Guile. + (mlet %store-monad ((ifconfig (package-file inetutils "bin/ifconfig")) + (route (package-file net-tools "sbin/route"))) + (return + (service + (documentation + (string-append "Set up networking on the '" interface + "' interface using a static IP address.")) + (provision '(networking)) + (start `(lambda _ + ;; Return #t if successfully started. + (and (zero? (system* ,ifconfig ,interface ,ip "up")) + ,(if gateway + `(zero? (system* ,route "add" "-net" "default" + "gw" ,gateway)) + #t) + ,(if (pair? name-servers) + `(call-with-output-file "/etc/resolv.conf" + (lambda (port) + (display + "# Generated by 'static-networking-service'.\n" + port) + (for-each (lambda (server) + (format port "nameserver ~a~%" + server)) + ',name-servers))) + #t)))) + (stop `(lambda _ + ;; Return #f is successfully stopped. + (not (and (system* ,ifconfig ,interface "down") + (system* ,route "del" "-net" "default"))))) + (respawn? #f) + (inputs `(("inetutils" ,inetutils) + ,@(if gateway + `(("net-tools" ,net-tools)) + '()))))))) + +;;; networking.scm ends here diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm new file mode 100644 index 0000000000..702be27714 --- /dev/null +++ b/gnu/services/xorg.scm @@ -0,0 +1,186 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2013, 2014 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services xorg) + #:use-module (gnu services) + #:use-module (gnu system linux) ; 'pam-service' + #:use-module ((gnu packages base) #:select (guile-final)) + #:use-module (gnu packages xorg) + #:use-module (gnu packages gl) + #:use-module (gnu packages slim) + #:use-module (gnu packages ratpoison) + #:use-module (gnu packages admin) + #:use-module (gnu packages bash) + #:use-module (guix monads) + #:use-module (guix derivations) + #:export (xorg-start-command + slim-service)) + +;;; Commentary: +;;; +;;; Services that relate to the X Window System. +;;; +;;; Code: + +(define* (xorg-start-command #:key + (guile guile-final) + (xorg-server xorg-server)) + "Return a derivation that builds a GUILE script to start the X server from +XORG-SERVER. Usually the X server is started by a login manager." + + (define (xserver.conf) + (text-file* "xserver.conf" " +Section \"Files\" + FontPath \"" font-adobe75dpi "/share/font/X11/75dpi\" + ModulePath \"" xf86-video-vesa "/lib/xorg/modules/drivers\" + ModulePath \"" xf86-input-mouse "/lib/xorg/modules/input\" + ModulePath \"" xf86-input-keyboard "/lib/xorg/modules/input\" + ModulePath \"" xorg-server "/lib/xorg/modules\" + ModulePath \"" xorg-server "/lib/xorg/modules/extensions\" + ModulePath \"" xorg-server "/lib/xorg/modules/multimedia\" +EndSection + +Section \"ServerFlags\" + Option \"AllowMouseOpenFail\" \"on"" +EndSection + +Section \"Monitor\" + Identifier \"Monitor[0]\" +EndSection + +Section \"InputClass\" + Identifier \"Generic keyboard\" + MatchIsKeyboard \"on\" + Option \"XkbRules\" \"base\" + Option \"XkbModel\" \"pc104\" +EndSection + +Section \"ServerLayout\" + Identifier \"Layout\" + Screen \"Screen-vesa\" +EndSection + +Section \"Device\" + Identifier \"Device-vesa\" + Driver \"vesa\" +EndSection + +Section \"Screen\" + Identifier \"Screen-vesa\" + Device \"Device-vesa\" +EndSection")) + + (mlet %store-monad ((guile-bin (package-file guile "bin/guile")) + (xorg-bin (package-file xorg-server "bin/X")) + (dri (package-file mesa "lib/dri")) + (xkbcomp-bin (package-file xkbcomp "bin")) + (xkb-dir (package-file xkeyboard-config + "share/X11/xkb")) + (config (xserver.conf))) + (define builder + ;; Write a small wrapper around the X server. + `(let ((out (assoc-ref %outputs "out"))) + (call-with-output-file out + (lambda (port) + (format port "#!~a --no-auto-compile~%!#~%" ,guile-bin) + (write '(begin + (setenv "XORG_DRI_DRIVER_PATH" ,dri) + (setenv "XKB_BINDIR" ,xkbcomp-bin) + + (apply execl + + ,xorg-bin "-ac" "-logverbose" "-verbose" + "-xkbdir" ,xkb-dir + "-config" ,(derivation->output-path config) + "-nolisten" "tcp" "-terminate" + + ;; Note: SLiM and other display managers add the + ;; '-auth' flag by themselves. + (cdr (command-line)))) + port))) + (chmod out #o555) + #t)) + + (mlet %store-monad ((inputs (lower-inputs + `(("xorg" ,xorg-server) + ("xkbcomp" ,xkbcomp) + ("xkeyboard-config" ,xkeyboard-config) + ("mesa" ,mesa) + ("guile" ,guile) + ("xorg.conf" ,config))))) + (derivation-expression "start-xorg" builder + #:inputs inputs)))) + +(define* (slim-service #:key (slim slim) + (allow-empty-passwords? #t) auto-login? + (default-user "") + (xauth xauth) (dmd dmd) (bash bash) + startx) + "Return a service that spawns the SLiM graphical login manager, which in +turn start the X display server with STARTX, a command as returned by +'xorg-start-command'. + +When ALLOW-EMPTY-PASSWORDS? is true, allow logins with an empty password. +When AUTO-LOGIN? is true, log in automatically as DEFAULT-USER." + (define (slim.cfg) + ;; TODO: Run "bash -login ~/.xinitrc %session". + (mlet %store-monad ((startx (or startx (xorg-start-command)))) + (text-file* "slim.cfg" " +default_path /run/current-system/bin +default_xserver " startx " +xserver_arguments :0 vt7 +xauth_path " xauth "/bin/xauth +authfile /var/run/slim.auth + +# The login command. '%session' is replaced by the chosen session name, one +# of the names specified in the 'sessions' setting: 'wmaker', 'xfce', etc. +login_cmd exec " ratpoison "/bin/ratpoison + +halt_cmd " dmd "/sbin/halt +reboot_cmd " dmd "/sbin/reboot +" (if auto-login? + (string-append "auto_login yes\ndefault_user " default-user) + "")))) + + (mlet %store-monad ((slim-bin (package-file slim "bin/slim")) + (bash-bin (package-file bash "bin/bash")) + (slim.cfg (slim.cfg))) + (return + (service + (documentation "Xorg display server") + (provision '(xorg-server)) + (requirement '(host-name)) + (start + ;; XXX: Work around the inability to specify env. vars. directly. + `(make-forkexec-constructor + ,bash-bin "-c" + ,(string-append "SLIM_CFGFILE=" (derivation->output-path slim.cfg) + " " slim-bin + " -nodaemon"))) + (stop `(make-kill-destructor)) + (inputs `(("slim" ,slim) + ("slim.cfg" ,slim.cfg) + ("bash" ,bash))) + (respawn? #t) + (pam-services + ;; Tell PAM about 'slim'. + (list (unix-pam-service + "slim" + #:allow-empty-passwords? allow-empty-passwords?))))))) + +;;; xorg.scm ends here diff --git a/gnu/system.scm b/gnu/system.scm index 6918d5bcb8..f05b7a092a 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -26,7 +26,11 @@ #:use-module (gnu packages bash) #:use-module (gnu packages admin) #:use-module (gnu packages package-management) - #:use-module (gnu system dmd) + #:use-module (gnu services) + #:use-module (gnu services dmd) + #:use-module (gnu services base) + #:use-module ((gnu services networking) + #:select (static-networking-service)) #:use-module (gnu system grub) #:use-module (gnu system shadow) #:use-module (gnu system linux) diff --git a/gnu/system/dmd.scm b/gnu/system/dmd.scm deleted file mode 100644 index c1ddec88d6..0000000000 --- a/gnu/system/dmd.scm +++ /dev/null @@ -1,470 +0,0 @@ -;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès -;;; -;;; This file is part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see . - -(define-module (gnu system dmd) - #:use-module (guix store) - #:use-module (guix packages) - #:use-module (guix derivations) - #:use-module (guix records) - #:use-module ((gnu packages base) - #:select (glibc-final guile-final)) - #:use-module ((gnu packages admin) - #:select (dmd mingetty inetutils shadow)) - #:use-module ((gnu packages package-management) - #:select (guix)) - #:use-module ((gnu packages linux) - #:select (net-tools)) - #:use-module (gnu packages xorg) - #:use-module (gnu packages bash) - #:use-module (gnu packages gl) - #:use-module (gnu packages slim) - #:use-module (gnu packages ratpoison) - - #:use-module (gnu system shadow) ; for user accounts/groups - #:use-module (gnu system linux) ; for PAM services - #:use-module (ice-9 match) - #:use-module (ice-9 format) - #:use-module (srfi srfi-1) - #:use-module (srfi srfi-26) - #:use-module (guix monads) - #:export (service? - service - service-provision - service-requirement - service-respawn? - service-start - service-stop - service-inputs - service-user-accounts - service-user-groups - service-pam-services - - host-name-service - syslog-service - mingetty-service - nscd-service - guix-service - static-networking-service - xorg-start-command - slim-service - - dmd-configuration-file)) - -;;; Commentary: -;;; -;;; System services as cajoled by dmd. -;;; -;;; Code: - -(define-record-type* - service make-service - service? - (documentation service-documentation ; string - (default "[No documentation.]")) - (provision service-provision) ; list of symbols - (requirement service-requirement ; list of symbols - (default '())) - (respawn? service-respawn? ; Boolean - (default #t)) - (start service-start) ; expression - (stop service-stop ; expression - (default #f)) - (inputs service-inputs ; list of inputs - (default '())) - (user-accounts service-user-accounts ; list of - (default '())) - (user-groups service-user-groups ; list of - (default '())) - (pam-services service-pam-services ; list of - (default '()))) - -(define (host-name-service name) - "Return a service that sets the host name to NAME." - (with-monad %store-monad - (return (service - (documentation "Initialize the machine's host name.") - (provision '(host-name)) - (start `(lambda _ - (sethostname ,name))) - (respawn? #f))))) - -(define* (mingetty-service tty - #:key - (motd (text-file "motd" "Welcome.\n")) - (allow-empty-passwords? #t)) - "Return a service to run mingetty on TTY." - (mlet %store-monad ((mingetty-bin (package-file mingetty "sbin/mingetty")) - (motd motd)) - (return - (service - (documentation (string-append "Run mingetty on " tty ".")) - (provision (list (symbol-append 'term- (string->symbol tty)))) - - ;; Since the login prompt shows the host name, wait for the 'host-name' - ;; service to be done. - (requirement '(host-name)) - - (start `(make-forkexec-constructor ,mingetty-bin "--noclear" ,tty)) - (stop `(make-kill-destructor)) - (inputs `(("mingetty" ,mingetty) - ("motd" ,motd))) - - (pam-services - ;; Let 'login' be known to PAM. All the mingetty services will have - ;; that PAM service, but that's fine because they're all identical and - ;; duplicates are removed. - (list (unix-pam-service "login" - #:allow-empty-passwords? allow-empty-passwords? - #:motd motd))))))) - -(define* (nscd-service #:key (glibc glibc-final)) - "Return a service that runs libc's name service cache daemon (nscd)." - (mlet %store-monad ((nscd (package-file glibc "sbin/nscd"))) - (return (service - (documentation "Run libc's name service cache daemon (nscd).") - (provision '(nscd)) - (start `(make-forkexec-constructor ,nscd "-f" "/dev/null" - "--foreground")) - (stop `(make-kill-destructor)) - - (respawn? #f) - (inputs `(("glibc" ,glibc))))))) - -(define (syslog-service) - "Return a service that runs 'syslogd' with reasonable default settings." - - ;; Snippet adapted from the GNU inetutils manual. - (define contents " - # Log all kernel messages, authentication messages of - # level notice or higher and anything of level err or - # higher to the console. - # Don't log private authentication messages! - *.err;kern.*;auth.notice;authpriv.none /dev/console - - # Log anything (except mail) of level info or higher. - # Don't log private authentication messages! - *.info;mail.none;authpriv.none /var/log/messages - - # Same, in a different place. - *.info;mail.none;authpriv.none /dev/tty12 - - # The authpriv file has restricted access. - authpriv.* /var/log/secure - - # Log all the mail messages in one place. - mail.* /var/log/maillog -") - - (mlet %store-monad - ((syslog.conf (text-file "syslog.conf" contents)) - (syslogd (package-file inetutils "libexec/syslogd"))) - (return - (service - (documentation "Run the syslog daemon (syslogd).") - (provision '(syslogd)) - (start `(make-forkexec-constructor ,syslogd "--no-detach" - "--rcfile" ,syslog.conf)) - (stop `(make-kill-destructor)) - (inputs `(("inetutils" ,inetutils) - ("syslog.conf" ,syslog.conf))))))) - -(define* (guix-build-accounts count #:key - (first-uid 30001) - (gid 30000) - (shadow shadow)) - "Return a list of COUNT user accounts for Guix build users, with UIDs -starting at FIRST-UID, and under GID." - (with-monad %store-monad - (return (unfold (cut > <> count) - (lambda (n) - (user-account - (name (format #f "guixbuilder~2,'0d" n)) - (password "!") - (uid (+ first-uid n -1)) - (gid gid) - (comment (format #f "Guix Build User ~2d" n)) - (home-directory "/var/empty") - (shell (package-file shadow "sbin/nologin")) - (inputs `(("shadow" ,shadow))))) - 1+ - 1)))) - -(define* (guix-service #:key (guix guix) (builder-group "guixbuild") - (build-user-gid 30000) (build-accounts 10)) - "Return a service that runs the build daemon from GUIX, and has -BUILD-ACCOUNTS user accounts available under BUILD-USER-GID." - (mlet %store-monad ((daemon (package-file guix "bin/guix-daemon")) - (accounts (guix-build-accounts build-accounts - #:gid build-user-gid))) - (return (service - (provision '(guix-daemon)) - (start `(make-forkexec-constructor ,daemon - "--build-users-group" - ,builder-group)) - (stop `(make-kill-destructor)) - (inputs `(("guix" ,guix))) - (user-accounts accounts) - (user-groups (list (user-group - (name builder-group) - (id build-user-gid) - (members (map user-account-name - user-accounts))))))))) - -(define* (static-networking-service interface ip - #:key - gateway - (name-servers '()) - (inetutils inetutils) - (net-tools net-tools)) - "Return a service that starts INTERFACE with address IP. If GATEWAY is -true, it must be a string specifying the default network gateway." - - ;; TODO: Eventually we should do this using Guile's networking procedures, - ;; like 'configure-qemu-networking' does, but the patch that does this is - ;; not yet in stock Guile. - (mlet %store-monad ((ifconfig (package-file inetutils "bin/ifconfig")) - (route (package-file net-tools "sbin/route"))) - (return - (service - (documentation - (string-append "Set up networking on the '" interface - "' interface using a static IP address.")) - (provision '(networking)) - (start `(lambda _ - ;; Return #t if successfully started. - (and (zero? (system* ,ifconfig ,interface ,ip "up")) - ,(if gateway - `(zero? (system* ,route "add" "-net" "default" - "gw" ,gateway)) - #t) - ,(if (pair? name-servers) - `(call-with-output-file "/etc/resolv.conf" - (lambda (port) - (display - "# Generated by 'static-networking-service'.\n" - port) - (for-each (lambda (server) - (format port "nameserver ~a~%" - server)) - ',name-servers))) - #t)))) - (stop `(lambda _ - ;; Return #f is successfully stopped. - (not (and (system* ,ifconfig ,interface "down") - (system* ,route "del" "-net" "default"))))) - (respawn? #f) - (inputs `(("inetutils" ,inetutils) - ,@(if gateway - `(("net-tools" ,net-tools)) - '()))))))) - -(define* (xorg-start-command #:key - (guile guile-final) - (xorg-server xorg-server)) - "Return a derivation that builds a GUILE script to start the X server from -XORG-SERVER. Usually the X server is started by a login manager." - - (define (xserver.conf) - (text-file* "xserver.conf" " -Section \"Files\" - FontPath \"" font-adobe75dpi "/share/font/X11/75dpi\" - ModulePath \"" xf86-video-vesa "/lib/xorg/modules/drivers\" - ModulePath \"" xf86-input-mouse "/lib/xorg/modules/input\" - ModulePath \"" xf86-input-keyboard "/lib/xorg/modules/input\" - ModulePath \"" xorg-server "/lib/xorg/modules\" - ModulePath \"" xorg-server "/lib/xorg/modules/extensions\" - ModulePath \"" xorg-server "/lib/xorg/modules/multimedia\" -EndSection - -Section \"ServerFlags\" - Option \"AllowMouseOpenFail\" \"on"" -EndSection - -Section \"Monitor\" - Identifier \"Monitor[0]\" -EndSection - -Section \"InputClass\" - Identifier \"Generic keyboard\" - MatchIsKeyboard \"on\" - Option \"XkbRules\" \"base\" - Option \"XkbModel\" \"pc104\" -EndSection - -Section \"ServerLayout\" - Identifier \"Layout\" - Screen \"Screen-vesa\" -EndSection - -Section \"Device\" - Identifier \"Device-vesa\" - Driver \"vesa\" -EndSection - -Section \"Screen\" - Identifier \"Screen-vesa\" - Device \"Device-vesa\" -EndSection")) - - (mlet %store-monad ((guile-bin (package-file guile "bin/guile")) - (xorg-bin (package-file xorg-server "bin/X")) - (dri (package-file mesa "lib/dri")) - (xkbcomp-bin (package-file xkbcomp "bin")) - (xkb-dir (package-file xkeyboard-config - "share/X11/xkb")) - (config (xserver.conf))) - (define builder - ;; Write a small wrapper around the X server. - `(let ((out (assoc-ref %outputs "out"))) - (call-with-output-file out - (lambda (port) - (format port "#!~a --no-auto-compile~%!#~%" ,guile-bin) - (write '(begin - (setenv "XORG_DRI_DRIVER_PATH" ,dri) - (setenv "XKB_BINDIR" ,xkbcomp-bin) - - (apply execl - - ,xorg-bin "-ac" "-logverbose" "-verbose" - "-xkbdir" ,xkb-dir - "-config" ,(derivation->output-path config) - "-nolisten" "tcp" "-terminate" - - ;; Note: SLiM and other display managers add the - ;; '-auth' flag by themselves. - (cdr (command-line)))) - port))) - (chmod out #o555) - #t)) - - (mlet %store-monad ((inputs (lower-inputs - `(("xorg" ,xorg-server) - ("xkbcomp" ,xkbcomp) - ("xkeyboard-config" ,xkeyboard-config) - ("mesa" ,mesa) - ("guile" ,guile) - ("xorg.conf" ,config))))) - (derivation-expression "start-xorg" builder - #:inputs inputs)))) - -(define* (slim-service #:key (slim slim) - (allow-empty-passwords? #t) auto-login? - (default-user "") - (xauth xauth) (dmd dmd) (bash bash) - startx) - "Return a service that spawns the SLiM graphical login manager, which in -turn start the X display server with STARTX, a command as returned by -'xorg-start-command'. - -When ALLOW-EMPTY-PASSWORDS? is true, allow logins with an empty password. -When AUTO-LOGIN? is true, log in automatically as DEFAULT-USER." - (define (slim.cfg) - ;; TODO: Run "bash -login ~/.xinitrc %session". - (mlet %store-monad ((startx (or startx (xorg-start-command)))) - (text-file* "slim.cfg" " -default_path /run/current-system/bin -default_xserver " startx " -xserver_arguments :0 vt7 -xauth_path " xauth "/bin/xauth -authfile /var/run/slim.auth - -# The login command. '%session' is replaced by the chosen session name, one -# of the names specified in the 'sessions' setting: 'wmaker', 'xfce', etc. -login_cmd exec " ratpoison "/bin/ratpoison - -halt_cmd " dmd "/sbin/halt -reboot_cmd " dmd "/sbin/reboot -" (if auto-login? - (string-append "auto_login yes\ndefault_user " default-user) - "")))) - - (mlet %store-monad ((slim-bin (package-file slim "bin/slim")) - (bash-bin (package-file bash "bin/bash")) - (slim.cfg (slim.cfg))) - (return - (service - (documentation "Xorg display server") - (provision '(xorg-server)) - (requirement '(host-name)) - (start - ;; XXX: Work around the inability to specify env. vars. directly. - `(make-forkexec-constructor - ,bash-bin "-c" - ,(string-append "SLIM_CFGFILE=" (derivation->output-path slim.cfg) - " " slim-bin - " -nodaemon"))) - (stop `(make-kill-destructor)) - (inputs `(("slim" ,slim) - ("slim.cfg" ,slim.cfg) - ("bash" ,bash))) - (respawn? #t) - (pam-services - ;; Tell PAM about 'slim'. - (list (unix-pam-service - "slim" - #:allow-empty-passwords? allow-empty-passwords?))))))) - - -(define (dmd-configuration-file services etc) - "Return the dmd configuration file for SERVICES, that initializes /etc from -ETC on startup." - (define config - `(begin - (use-modules (ice-9 ftw)) - - (register-services - ,@(map (match-lambda - (($ documentation provision requirement - respawn? start stop) - `(make - #:docstring ,documentation - #:provides ',provision - #:requires ',requirement - #:respawn? ,respawn? - #:start ,start - #:stop ,stop))) - services)) - - ;; /etc is a mixture of static and dynamic settings. Here is where we - ;; initialize it from the static part. - (format #t "populating /etc from ~a...~%" ,etc) - (let ((rm-f (lambda (f) - (false-if-exception (delete-file f))))) - (rm-f "/etc/static") - (symlink ,etc "/etc/static") - (for-each (lambda (file) - ;; TODO: Handle 'shadow' specially so that changed - ;; password aren't lost. - (let ((target (string-append "/etc/" file)) - (source (string-append "/etc/static/" file))) - (rm-f target) - (symlink source target))) - (scandir ,etc - (lambda (file) - (not (member file '("." "..")))))) - - ;; Prevent ETC from being GC'd. - (rm-f "/var/nix/gcroots/etc-directory") - (symlink ,etc "/var/nix/gcroots/etc-directory")) - - (format #t "starting services...~%") - (for-each start ',(append-map service-provision services)))) - - (text-file "dmd.conf" (object->string config))) - -;;; dmd.scm ends here diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index dea7d0599b..3c0ea8a351 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -44,8 +44,8 @@ #:use-module (gnu system linux) #:use-module (gnu system linux-initrd) #:use-module (gnu system grub) - #:use-module (gnu system dmd) #:use-module (gnu system) + #:use-module (gnu services) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 5bb14c4383..7799ccbc47 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -36,7 +36,7 @@ (for-each (lambda (iface) (module-use! module (resolve-interface iface))) '((gnu system) - (gnu system dmd) + (gnu services) (gnu system shadow))) module)) -- cgit v1.2.3 From a438d540b11f380d9dc69ccebeb1d444311b488c Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Wed, 19 Feb 2014 16:02:32 -0600 Subject: gnu: calcurse: New module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/calcurse.scm: New file * gnu-system.am (GNU_SYSTEM_MODULES): Add it Signed-off-by: Ludovic Courtès --- gnu-system.am | 1 + gnu/packages/calcurse.scm | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 gnu/packages/calcurse.scm (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 857c9bf663..897cc443a1 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -42,6 +42,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/bison.scm \ gnu/packages/boost.scm \ gnu/packages/bootstrap.scm \ + gnu/packages/calcurse.scm \ gnu/packages/cdrom.scm \ gnu/packages/cflow.scm \ gnu/packages/check.scm \ diff --git a/gnu/packages/calcurse.scm b/gnu/packages/calcurse.scm new file mode 100644 index 0000000000..84dab0c53c --- /dev/null +++ b/gnu/packages/calcurse.scm @@ -0,0 +1,49 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Eric Bavier +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages autogen) + #:use-module (guix packages) + #:use-module (guix licenses) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages ncurses)) + +(define-public calcurse + (package + (name "calcurse") + (version "3.1.4") + (source + (origin + (method url-fetch) + (uri (string-append "http://calcurse.org/files/calcurse-" + version ".tar.gz")) + (sha256 + (base32 + "1qwhffwhfg7bjxrviwlcrhnfw0976d39da8kfspq6dgd9nqv68a1")))) + (build-system gnu-build-system) + (inputs `(("ncurses" ,ncurses))) + (home-page "http://www.calcurse.org") + (synopsis "Text-based calendar and scheduling") + (description + "Calcurse is a text-based calendar and scheduling application. It helps +keep track of events, appointments and everyday tasks. A configurable +notification system reminds user of upcoming deadlines, and the curses based +interface can be customized to suit user needs. All of the commands are +documented within an online help system.") + (license bsd-2))) -- cgit v1.2.3 From 8ec773a8b841966422777599bd18f05492f19d7b Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Fri, 21 Feb 2014 03:21:57 -0500 Subject: gnu: Add giflib. * gnu/packages/giflib.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. --- gnu-system.am | 1 + gnu/packages/giflib.scm | 76 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 gnu/packages/giflib.scm (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 897cc443a1..8308480c42 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -81,6 +81,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/geeqie.scm \ gnu/packages/gettext.scm \ gnu/packages/ghostscript.scm \ + gnu/packages/giflib.scm \ gnu/packages/gkrellm.scm \ gnu/packages/gl.scm \ gnu/packages/glib.scm \ diff --git a/gnu/packages/giflib.scm b/gnu/packages/giflib.scm new file mode 100644 index 0000000000..849586ed71 --- /dev/null +++ b/gnu/packages/giflib.scm @@ -0,0 +1,76 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Mark H Weaver +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages giflib) + #:use-module (guix licenses) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (srfi srfi-1) + #:use-module (gnu packages xorg) + #:use-module (gnu packages perl)) + +(define-public giflib + (package + (name "giflib") + (version "4.2.3") + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/giflib/giflib-" + (first (string-split version #\.)) + ".x/giflib-" version ".tar.bz2")) + (sha256 + (base32 "0rmp7ipzk42r841bggd7bfqk4p8qsssbp4wcck4qnz7p4rkxbj0a")))) + (build-system gnu-build-system) + (outputs '("bin" ; utility programs + "out")) ; library + (inputs `(("libx11" ,libx11) + ("libice" ,libice) + ("libsm" ,libsm) + ("perl" ,perl))) + (arguments + `(#:phases (alist-cons-after + 'unpack 'disable-html-doc-gen + (lambda _ + (substitute* "doc/Makefile.in" + (("^all: allhtml manpages") ""))) + (alist-cons-after + 'install 'install-manpages + (lambda* (#:key outputs #:allow-other-keys) + (let* ((bin (assoc-ref outputs "bin")) + (man1dir (string-append bin "/share/man/man1"))) + (mkdir-p man1dir) + (for-each (lambda (file) + (let ((base (basename file))) + (format #t "installing `~a' to `~a'~%" + base man1dir) + (copy-file file + (string-append + man1dir "/" base)))) + (find-files "doc" "\\.1")))) + %standard-phases)))) + (synopsis "Tools and library for working with GIF images") + (description + "giflib is a library for reading and writing GIF images. It is API and +ABI compatible with libungif which was in wide use while the LZW compression +algorithm was patented. Tools are also included to convert, manipulate, +compose, and analyze GIF images.") + (home-page "http://giflib.sourceforge.net/") + (license x11))) + +;;; giflib.scm ends here -- cgit v1.2.3 From 86d07a5514d859772980ef87e39f6e2b668655c0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 21 Feb 2014 01:00:49 +0100 Subject: gnu: mpc123: Add patch that fixes a segfault. * gnu/packages/patches/mpc123-initialize-ao.patch: New file. * gnu/packages/mp3.scm (mpc123): Use it. * gnu-system.am (dist_patch_DATA): Add it. --- gnu-system.am | 1 + gnu/packages/mp3.scm | 3 ++- gnu/packages/patches/mpc123-initialize-ao.patch | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/mpc123-initialize-ao.patch (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index 8308480c42..e7c7bb2141 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -298,6 +298,7 @@ dist_patch_DATA = \ gnu/packages/patches/make-impure-dirs.patch \ gnu/packages/patches/mcron-install.patch \ gnu/packages/patches/mit-krb5-init-fix.patch \ + gnu/packages/patches/mpc123-initialize-ao.patch \ gnu/packages/patches/patchelf-page-size.patch \ gnu/packages/patches/perl-no-sys-dirs.patch \ gnu/packages/patches/plotutils-libpng-jmpbuf.patch \ diff --git a/gnu/packages/mp3.scm b/gnu/packages/mp3.scm index 7e324703a6..c64efe4c03 100644 --- a/gnu/packages/mp3.scm +++ b/gnu/packages/mp3.scm @@ -298,7 +298,8 @@ format.") version "/mpc123-" version ".tar.gz")) (sha256 (base32 - "0sf4pns0245009z6mbxpx7kqy4kwl69bc95wz9v23wgappsvxgy1")))) + "0sf4pns0245009z6mbxpx7kqy4kwl69bc95wz9v23wgappsvxgy1")) + (patches (list (search-patch "mpc123-initialize-ao.patch"))))) (build-system gnu-build-system) (arguments '(#:phases (alist-replace diff --git a/gnu/packages/patches/mpc123-initialize-ao.patch b/gnu/packages/patches/mpc123-initialize-ao.patch new file mode 100644 index 0000000000..85e461f896 --- /dev/null +++ b/gnu/packages/patches/mpc123-initialize-ao.patch @@ -0,0 +1,19 @@ +Description: Zero ao_sample_format structure to cope with libao 1.0.0 +Author: Colin Watson +Bug-Debian: http://bugs.debian.org/591396 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/710268 +Forwarded: no +Last-Update: 2013-05-07 + +Index: b/ao.c +=================================================================== +--- a/ao.c ++++ b/ao.c +@@ -123,6 +123,7 @@ + + /* initialize ao_format struct */ + /* XXX VERY WRONG */ ++ memset(&ao_fmt, 0, sizeof(ao_fmt)); + ao_fmt.bits=16; /*tmp_stream_info.average_bitrate;*/ + ao_fmt.rate=streaminfo->sample_freq; + ao_fmt.channels=streaminfo->channels; -- cgit v1.2.3 From 93cc13aabbbac3341a06a27bb8016d94622350cd Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 21 Feb 2014 23:44:52 +0100 Subject: gnu: Add libwebsockets. * gnu/packages/libwebsockets.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. --- gnu-system.am | 1 + gnu/packages/libwebsockets.scm | 83 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 gnu/packages/libwebsockets.scm (limited to 'gnu-system.am') diff --git a/gnu-system.am b/gnu-system.am index e7c7bb2141..d63a80f62a 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -132,6 +132,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/libunistring.scm \ gnu/packages/libusb.scm \ gnu/packages/libunwind.scm \ + gnu/packages/libwebsockets.scm \ gnu/packages/lightning.scm \ gnu/packages/linux.scm \ gnu/packages/lout.scm \ diff --git a/gnu/packages/libwebsockets.scm b/gnu/packages/libwebsockets.scm new file mode 100644 index 0000000000..3f900aef72 --- /dev/null +++ b/gnu/packages/libwebsockets.scm @@ -0,0 +1,83 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2014 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages libwebsockets) + #:use-module (guix packages) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) + #:select (lgpl2.1)) + #:use-module (gnu packages autotools) + #:use-module ((gnu packages compression) #:select (zlib)) + #:use-module (gnu packages perl) + #:use-module (gnu packages openssl)) + +(define-public libwebsockets + (package + (name "libwebsockets") + (version "1.2") + (source (origin + ;; The project does not publish tarballs, so we have to take + ;; things from Git. + (method git-fetch) + (uri (git-reference + (url "git://git.libwebsockets.org/libwebsockets") + (commit (string-append "v" version + "-chrome26-firefox18")))) + (sha256 + (base32 + "1293hbz8qj4p27m1qjf8dn97r10xjyiwdpq491m87zi025s558cl")) + (file-name (string-append name "-" version)))) + + ;; The package has both CMake and GNU build systems, but the latter is + ;; apparently better supported (CMake-generated makefiles lack an + ;; 'install' target, for instance.) + (build-system gnu-build-system) + + (arguments + '(#:phases (alist-replace + 'unpack + ;; FIXME: Remove this when gnu-build-system handles that + ;; case correctly. + (lambda* (#:key source #:allow-other-keys) + (mkdir "source") + (chdir "source") + (copy-recursively source ".") + #t) + + (alist-cons-before + 'configure 'bootstrap + (lambda _ + (chmod "libwebsockets-api-doc.html" #o666) + (zero? (system* "./autogen.sh"))) + %standard-phases)))) + (native-inputs `(("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool "bin") + ("perl" ,perl))) ; to build the HTML doc + (inputs `(("zlib" ,zlib) + ("openssl" ,openssl))) + (synopsis "WebSockets library written in C") + (description + "libwebsockets is a library that allows C programs to establish client +and server WebSockets connections---a protocol layered above HTTP that allows +for efficient socket-like bidirectional reliable communication channels.") + (home-page "http://libwebsockets.org/") + + ;; This is LGPLv2.1-only with extra exceptions specified in 'LICENSE'. + (license lgpl2.1))) -- cgit v1.2.3