[PATCH] gnu: Add emacs-lua-mode.

2016-10-20 Thread David Thompson
* gnu/packages/emacs.scm (emacs-lua-mode): New variable.
---
 gnu/packages/emacs.scm | 21 +
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 6e9c181..fbde046 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -3252,3 +3252,24 @@ This package contains the library runtime.")
 (description "This package provides an Emacs major mode for
 editing nginx config files.")
 (license license:gpl2+)))
+
+(define-public emacs-lua-mode
+  (package
+(name "emacs-lua-mode")
+(version "20151025")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "https://github.com/immerrr/lua-mode/archive/;
+   version ".tar.gz"))
+   (sha256
+(base32
+ "0sbhfny5ib65cnx6xcy6h9bbw27mw034s8m9cca00bhxqaqi6p4v"))
+   (file-name (string-append name "-" version ".tar.gz"
+(build-system emacs-build-system)
+(home-page "http://immerrr.github.com/lua-mode;)
+(synopsis "Major mode for editing Lua source code")
+(description "Lua-mode provides support for editing Lua, including 
automatic
+indentation, syntactical font-locking, running interactive shell, interacting
+with hs-minor-mode and online documentation lookup.")
+(license license:gpl3+)))
-- 
2.8.3




[PATCH] gnu: Add glfw.

2016-08-22 Thread David Thompson
* gnu/packages/gl.scm (glfw): New variable.
---
 gnu/packages/gl.scm | 36 +++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index a4bffe4..4b5646e 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2015 Andreas Enge <andr...@enge.fr>
 ;;; Copyright © 2013 Joshua Grant <ta...@riseup.net>
-;;; Copyright © 2014 David Thompson <da...@gnu.org>
+;;; Copyright © 2014, 2016 David Thompson <da...@gnu.org>
 ;;; Copyright © 2014, 2015 Mark H Weaver <m...@netris.org>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -22,6 +22,7 @@
 (define-module (gnu packages gl)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages freedesktop)
@@ -538,3 +539,36 @@ OpenGL graphics API.")
  "SOIL is a tiny C library used primarily for uploading textures into
 OpenGL.")
 (license license:public-domain)))
+
+(define-public glfw
+  (package
+(name "glfw")
+(version "3.2.1")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://github.com/glfw/glfw;
+  "/releases/download/" version
+  "/glfw-" version ".zip"))
+  (sha256
+   (base32
+"09kk5yc1zhss9add8ryqrngrr16hdmc94rszgng135bhw09mxmdp"
+(build-system cmake-build-system)
+(arguments
+ '(#:tests? #f ; no test target
+   #:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
+(native-inputs
+ `(("doxygen" ,doxygen)
+   ("unzip" ,unzip)))
+(inputs
+ `(("mesa" ,mesa)
+   ("libx11" ,libx11)
+   ("libxrandr" ,libxrandr)
+   ("libxinerama" ,libxinerama)
+   ("libxcursor" ,libxcursor)))
+(home-page "http://www.glfw.org;)
+(synopsis "OpenGL application development library")
+(description
+ "GLFW is a library for OpenGL, OpenGL ES and Vulkan development for
+desktop computers.  It provides a simple API for creating windows, contexts
+and surfaces, receiving input and events.")
+(license license:zlib)))
-- 
2.8.3




[PATCH] download: Use basic authentication when userinfo is present in URI.

2016-06-28 Thread David Thompson
From: David Thompson <da...@gnu.org>

* guix/download.scm (url-fetch): Include (guix base64) module on the
  build-side.
* guix/build/download.scm (http-fetch): Add "Authorization" header when
  userinfo is present in the URI.
---
 guix/build/download.scm | 14 --
 guix/download.scm   |  3 ++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/guix/build/download.scm b/guix/build/download.scm
index bd011ce..103e784 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -23,9 +23,11 @@
   #:use-module (web http)
   #:use-module ((web client) #:hide (open-socket-for-uri))
   #:use-module (web response)
+  #:use-module (guix base64)
   #:use-module (guix ftp-client)
   #:use-module (guix build utils)
   #:use-module (rnrs io ports)
+  #:use-module (rnrs bytevectors)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-19)
@@ -598,14 +600,22 @@ FILE on success."
 (string>? (version) "2.0.7")))
 
   (define headers
-'(;; Some web sites, such as http://dist.schmorp.de, would block you if
+`(;; Some web sites, such as http://dist.schmorp.de, would block you if
   ;; there's no 'User-Agent' header, presumably on the assumption that
   ;; you're a spammer.  So work around that.
   (User-Agent . "GNU Guile")
 
   ;; Some servers, such as https://alioth.debian.org, return "406 Not
   ;; Acceptable" when not explicitly told that everything is accepted.
-  (Accept . "*/*")))
+  (Accept . "*/*")
+
+  ;; Basic authentication, if needed.
+  ,@(match (uri-userinfo uri)
+  ((? string? str)
+   `((Authorization . ,(string-append "Basic "
+  (base64-encode
+   (string->utf8 str))
+  (_ '()
 
   (let*-values (((connection)
  (open-connection-for-uri uri #:timeout timeout))
diff --git a/guix/download.scm b/guix/download.scm
index 9b238dc..c3f34f5 100644
--- a/guix/download.scm
+++ b/guix/download.scm
@@ -328,7 +328,8 @@ in the store."
 #:modules '((guix build download)
 (guix build utils)
 (guix ftp-client)
-(guix base32))
+(guix base32)
+(guix base64))
 
 ;; Use environment variables and a fixed script
 ;; name so there's only one script in store for
-- 
2.8.3




[PATCH] gnu: boost: Allow for customizable build flags.

2016-06-13 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/packages/boost.scm (boost)[arguments]: Extract build flags to 
#:make-flags argument.
---
 gnu/packages/boost.scm | 80 +-
 1 file changed, 40 insertions(+), 40 deletions(-)

diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm
index 0a644e8..882f9cc 100644
--- a/gnu/packages/boost.scm
+++ b/gnu/packages/boost.scm
@@ -51,50 +51,50 @@
("python" ,python-2)
("tcsh" ,tcsh)))
 (arguments
- (let ((build-flags
-`("threading=multi" "link=shared"
+ `(#:tests? #f
+   #:make-flags
+   (list "threading=multi" "link=shared"
 
-  ;; Set the RUNPATH to $libdir so that the libs find each other.
-  (string-append "linkflags=-Wl,-rpath="
- (assoc-ref outputs "out") "/lib")
+ ;; Set the RUNPATH to $libdir so that the libs find each other.
+ (string-append "linkflags=-Wl,-rpath="
+(assoc-ref %outputs "out") "/lib")
 
-  ;; Boost's 'context' library is not yet supported on mips64, so
-  ;; we disable it.  The 'coroutine' library depends on 'context',
-  ;; so we disable that too.
-  ,@(if (string-prefix? "mips64" (or (%current-target-system)
- (%current-system)))
-'("--without-context"
-  "--without-coroutine" "--without-coroutine2")
-'()
-   `(#:tests? #f
- #:phases
- (modify-phases %standard-phases
-   (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/doc/bjam.qbk"
-   "tools/build/src/engine/execunix.c"
-   "tools/build/src/engine/Jambase"
-   "tools/build/src/engine/jambase.c")
-  (("/bin/sh") (which "sh")))
+ ;; Boost's 'context' library is not yet supported on mips64, so
+ ;; we disable it.  The 'coroutine' library depends on 'context',
+ ;; so we disable that too.
+ ,@(if (string-prefix? "mips64" (or (%current-target-system)
+(%current-system)))
+   '("--without-context"
+ "--without-coroutine" "--without-coroutine2")
+   '()))
+   #:phases
+   (modify-phases %standard-phases
+ (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/doc/bjam.qbk"
+  "tools/build/src/engine/execunix.c"
+  "tools/build/src/engine/Jambase"
+  "tools/build/src/engine/jambase.c")
+ (("/bin/sh") (which "sh")))
 
-(setenv "SHELL" (which "sh"))
-(setenv "CONFIG_SHELL" (which "sh"))
+   (setenv "SHELL" (which "sh"))
+   (setenv "CONFIG_SHELL" (which "sh"))
 
-(zero? (system* "./bootstrap.sh"
-(string-append "--prefix=" out)
-"--with-toolset=gcc")
-   (replace
-'build
-(lambda* (#:key outputs #:allow-other-keys)
-  (zero? (system* "./b2" ,@build-flags
-   (replace
-'install
-(lambda* (#:key outputs #:allow-other-keys)
-  (zero? (system* "./b2" "install" ,@build-flags
+   (zero? (system* "./bootstrap.sh"
+   (string-append "--prefix=" out)
+   "--with-toolset=gcc")
+ (replace
+ 'build
+   (lambda* (#:key outputs make-flags #:allow-other-keys)
+ (zero? (apply system* "./b2" make-flags
+ (replace
+ 'install
+   (lambda* (#:key outputs make-flags #:allow-other-keys)
+ (zero? (apply system* "./b2" "install" make-flags)))
 
 (home-page "http://boost.org;)
 (synopsis "Peer-reviewed portable C++ source libraries")
-- 
2.8.3




[PATCH] gnu: Add gnome-shell-extensions.

2016-06-11 Thread David Thompson
* gnu/packages/gnome.scm (gnome-shell-extensions): New variable.
---
 gnu/packages/gnome.scm | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index c87c371..0b80ebb 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5183,6 +5183,33 @@ alternative user interface themes, changes in window 
management behavior,
 GNOME Shell appearance and extension, etc.")
 (license license:gpl3+)))
 
+(define-public gnome-shell-extensions
+  (package
+(name "gnome-shell-extensions")
+(version "3.20.1")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "mirror://gnome/sources/" name "/"
+  (version-major+minor version)  "/"
+  name "-" version ".tar.xz"))
+  (sha256
+   (base32
+"18rr55krnqx1nzrzlj6kfzh4n67f3crakmwh28rr95y7cg0jwhxw"
+(build-system gnu-build-system)
+(arguments
+ '(#:configure-flags '("--enable-extensions=all")))
+(native-inputs
+ `(("intltool" ,intltool)
+   ("pkg-config" ,pkg-config)))
+(propagated-inputs
+ `(("glib" ,glib)
+   ("glib" ,glib "bin")))
+(synopsis "Extensions for GNOME Shell")
+(description "GNOME Shell extensions modify and extend GNOME Shell
+functionality and behavior.")
+(home-page "https://extensions.gnome.org/;)
+(license license:gpl3+)))
+
 (define-public arc-theme
   (package
 (name "arc-theme")
-- 
2.8.3




[PATCH 1/3] gnu: Add arc-theme.

2016-06-07 Thread David Thompson
* gnu/packages/gnome.scm (arc-theme): New variable.
---
 gnu/packages/gnome.scm | 33 +
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 8384c76..227dec1 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5182,3 +5182,36 @@ GNOME 3.  This includes things like the fonts used in 
user interface elements,
 alternative user interface themes, changes in window management behavior,
 GNOME Shell appearance and extension, etc.")
 (license license:gpl3+)))
+
+(define-public arc-theme
+  (package
+(name "arc-theme")
+(version "20160605")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://github.com/horst3180/arc-theme;
+  "/archive/" version ".tar.gz"))
+  (file-name (string-append name "-" version ".tar.gz"))
+  (sha256
+   (base32
+"0sq2031xda8jn2ws0x2bvhq77jfh7xy0c3kg86v6vm2kbrrss7y6"
+(build-system gnu-build-system)
+(arguments
+ '(#:phases
+   (modify-phases %standard-phases
+ (add-after 'unpack 'bootstrap
+   (lambda _
+ (zero? (system* "autoreconf" "-vif")))
+(native-inputs
+ `(("autoconf" ,autoconf)
+   ("automake" ,automake)
+   ("pkg-config" ,pkg-config)))
+(inputs
+ `(("gtk+" ,gtk+)))
+(synopsis "A flat GTK theme with transparent elements")
+(description "Arc is a flat theme with transparent elements for GTK 3, GTK
+2 and Gnome-Shell which supports GTK 3 and GTK 2 based desktop environments
+like Gnome, Unity, Budgie, Pantheon, XFCE, Mate, etc.")
+(home-page "https://github.com/horst3180/arc-theme;)
+;; No "or later" language found.
+(license license:gpl3)))
-- 
2.8.3




[PATCH 2/3] gnu: Add moka-icon-theme.

2016-06-07 Thread David Thompson
* gnu/packages/gnome.scm (moka-icon-theme): New variable.
---
 gnu/packages/gnome.scm | 35 +++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 227dec1..2ce1f18 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5215,3 +5215,38 @@ like Gnome, Unity, Budgie, Pantheon, XFCE, Mate, etc.")
 (home-page "https://github.com/horst3180/arc-theme;)
 ;; No "or later" language found.
 (license license:gpl3)))
+
+(define-public moka-icon-theme
+  (package
+(name "moka-icon-theme")
+(version "5.3.1")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://github.com/moka-project;
+  "/moka-icon-theme/archive/v"
+  version ".tar.gz"))
+  (file-name (string-append name "-" version ".tar.gz"))
+  (sha256
+   (base32
+"1lnk7p8dsd9xh6cgz5krvlcr457w8yl4m6p6s5c2g5narsjswzrm"
+(build-system gnu-build-system)
+(arguments
+ '(#:phases
+   (modify-phases %standard-phases
+ (add-after 'unpack 'patch-makefile.am
+   (lambda _
+ (substitute* '("Makefile.am")
+   (("\\$\\(DESTDIR\\)/usr/share")
+"$(datadir)"))
+ #t))
+ (add-after 'patch-makefile.am 'bootstrap
+   (lambda _
+ (zero? (system* "autoreconf" "-vif")))
+(native-inputs
+ `(("autoconf" ,autoconf)
+   ("automake" ,automake)))
+(synopsis "Moka icon theme")
+(description "Moka is a stylized desktop icon set, designed to be clear,
+simple and consistent.")
+(home-page "http://snwh.org/moka;)
+(license license:gpl3+)))
-- 
2.8.3




[PATCH 02/10] gnu: Add emacs-js2-mode.

2016-06-01 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/packages/emacs.scm (emacs-js2-mode): New variable.
---
 gnu/packages/emacs.scm | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 71f2f8b..cad843c 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1817,3 +1817,26 @@ agree upon.")
 convenient interface to your recently and most frequently used commands.  And
 to all the other commands, too.")
 (license license:gpl3+)))
+
+(define-public emacs-js2-mode
+  (package
+(name "emacs-js2-mode")
+(version "20150909")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://github.com/mooz/js2-mode/archive/;
+  version ".tar.gz"))
+  (file-name (string-append name "-" version ".tar.gz"))
+  (sha256
+   (base32
+"1nsm36c4kwb473p13i58fgrnlk8fbn3rdhj47d9xz70az4ra44q0"
+(build-system emacs-build-system)
+(home-page "https://github.com/mooz/js2-mode/;)
+(synopsis "Improved JavaScript editing mode for Emacs")
+(description
+ "Js2-mode provides a JavaScript major mode for Emacs that is more
+advanced than the built-in javascript-mode.  Features include accurate syntax
+highlighting using a recursive-descent parser, on-the-fly reporting of syntax
+errors and strict-mode warnings, smart line-wrapping within comments and
+strings, and code folding.")
+(license license:gpl3+)))
-- 
2.8.3




[PATCH 06/10] gnu: Add emacs-rainbow-delimiters.

2016-06-01 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/packages/emacs.scm (emacs-rainbow-delimiters): New variable.
---
 gnu/packages/emacs.scm | 24 
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 04dc759..54885f4 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1907,3 +1907,27 @@ If you want to mark a folder manually as a project just 
create an empty
  "Elfeed is an extensible web feed reader for Emacs, supporting both Atom
 and RSS, with a user interface inspired by notmuch.")
 (license license:gpl3+)))
+
+(define-public emacs-rainbow-delimiters
+  (package
+(name "emacs-rainbow-delimiters")
+(version "2.1.3")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://raw.githubusercontent.com/Fanael;
+  "/rainbow-delimiters/" version
+  "/rainbow-delimiters.el"))
+  (file-name (string-append "rainbow-delimiters-" version ".el"))
+  (sha256
+   (base32
+"1b3kampwsjabhcqdp0khgff13wc5jqhy3rbvaa12vnv7qy22l9ck"
+(build-system emacs-build-system)
+(home-page "https://github.com/Fanael/rainbow-delimiters;)
+(synopsis "Highlight brackets according to their depth")
+(description
+ "Rainbow-delimiters is a \"rainbow parentheses\"-like mode for Emacs which
+highlights parentheses, brackets, and braces according to their depth.  Each
+successive level is highlighted in a different color, making it easy to spot
+matching delimiters, orient yourself in the code, and tell which statements
+are at a given level.")
+(license license:gpl3+)))
-- 
2.8.3




[PATCH 01/10] gnu: Add emacs-smex.

2016-06-01 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/packages/emacs.scm (emacs-smex): New variable.
---
 gnu/packages/emacs.scm | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index b7c0a1f..71f2f8b 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2015, 2016 Christopher Allan Webber <cweb...@dustycloud.org>
 ;;; Copyright © 2016 humanitiesNerd <caton...@gmail.com>
 ;;; Copyright © 2016 Efraim Flashner <efr...@flashner.co.il>
+;;; Copyright © 2016 David Thompson <da...@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1795,3 +1796,24 @@ work on lists, strings and vectors.")
 Emacs default configuration in uncontroversial ways that nearly everyone can
 agree upon.")
 (license license:gpl3+)))
+
+(define-public emacs-smex
+  (package
+(name "emacs-smex")
+(version "3.0")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://raw.githubusercontent.com;
+  "/nonsequitur/smex/" version "/smex.el"))
+  (file-name (string-append "smex-" version ".el"))
+  (sha256
+   (base32
+"0ar310zx9k5y4i1vl2rawvi712xj9gx77160860jbs691p77cxqp"
+(build-system emacs-build-system)
+(home-page "http://github.com/nonsequitur/smex/;)
+(synopsis "M-x interface with Ido-style fuzzy matching")
+(description
+ "Smex is a M-x enhancement for Emacs.  Built on top of Ido, it provides a
+convenient interface to your recently and most frequently used commands.  And
+to all the other commands, too.")
+(license license:gpl3+)))
-- 
2.8.3




[PATCH 05/10] gnu: Add emacs-elfeed.

2016-06-01 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/pacakges/emacs.scm (emacs-elfeed): New variable.
---
 gnu/packages/emacs.scm | 20 
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 1b54439..04dc759 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1887,3 +1887,23 @@ Currently git, mercurial and bazaar repos are considered 
projects by default.
 If you want to mark a folder manually as a project just create an empty
 .projectile file in it.")
 (license license:gpl3+)))
+
+(define-public emacs-elfeed
+  (package
+(name "emacs-elfeed")
+(version "1.4.1")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://github.com/skeeto/elfeed/archive/;
+  version ".tar.gz"))
+  (file-name (string-append name "-" version ".tar.gz"))
+  (sha256
+   (base32
+"0i75r8x9ypbfjlnym04h16ikcrlks86p7wsgawrx7mh1lk4inp89"
+(build-system emacs-build-system)
+(home-page "https://github.com/skeeto/elfeed;)
+(synopsis "Atom/RSS feed reader for Emacs")
+(description
+ "Elfeed is an extensible web feed reader for Emacs, supporting both Atom
+and RSS, with a user interface inspired by notmuch.")
+(license license:gpl3+)))
-- 
2.8.3




[PATCH 04/10] gnu: Add emacs-projectile.

2016-06-01 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/packages/emacs.scm (emacs-projectile): New variable.
---
 gnu/packages/emacs.scm | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index cd64383..1b54439 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1861,3 +1861,29 @@ strings, and code folding.")
  "Markdown-mode is a major mode for editing Markdown-formatted text files
 in Emacs.")
 (license license:gpl3+)))
+
+(define-public emacs-projectile
+  (package
+(name "emacs-projectile")
+(version "0.13.0")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://raw.githubusercontent.com/bbatsov;
+  "/projectile/v" version "/projectile.el"))
+  (file-name (string-append "projectile-" version ".el"))
+  (sha256
+   (base32
+"1pc6xb61hzxzc5hkqkli1ab0s7wz0rfgx4kcn9y30ksvhw18smbz"
+(build-system emacs-build-system)
+(propagated-inputs
+ `(("emacs-dash" ,emacs-dash)
+   ("emacs-pkg-info" ,emacs-pkg-info)))
+(home-page "https://github.com/bbatsov/projectile;)
+(synopsis "Manage and navigate projects in Emacs easily")
+(description
+ "This library provides easy project management and navigation.  The
+concept of a project is pretty basic - just a folder containing special file.
+Currently git, mercurial and bazaar repos are considered projects by default.
+If you want to mark a folder manually as a project just create an empty
+.projectile file in it.")
+(license license:gpl3+)))
-- 
2.8.3




[PATCH 10/10] gnu: Add emacs-web-mode.

2016-06-01 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/packages/emacs.scm (emacs-web-mode): New variable.
---
 gnu/packages/emacs.scm | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index bfa46c4..95e6bea 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -2000,3 +2000,26 @@ features were added by Marshall Vandegrift.  As YAML and 
Python share the fact
 that indentation determines structure, this mode provides indentation and
 indentation command behavior very similar to that of python-mode.")
 (license license:gpl3+)))
+
+(define-public emacs-web-mode
+  (package
+(name "emacs-web-mode")
+(version "14")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://raw.githubusercontent.com/fxbois;
+  "/web-mode/v" version "/web-mode.el"))
+  (file-name (string-append "web-mode-" version ".el"))
+  (sha256
+   (base32
+"086hik5fmxg3kx74qmransx9cz961qd22d4m6ah2dw6cwaj1s3s5"
+(build-system emacs-build-system)
+(synopsis "Major mode for editing web templates")
+(description "Web-mode is an Emacs major mode for editing web templates
+aka HTML files embedding parts (CSS/JavaScript) and blocks (pre rendered by
+client/server side engines).  Web-mode is compatible with many template
+engines: PHP, JSP, ASP, Django, Twig, Jinja, Mustache, ERB, FreeMarker,
+Velocity, Cheetah, Smarty, CTemplate, Mustache, Blade, ErlyDTL, Go Template,
+Dust.js, React/JSX, Angularjs, ejs, etc.")
+(home-page "http://web-mode.org/;)
+(license license:gpl3+)))
-- 
2.8.3




[PATCH 07/10] gnu: Add emacs-ido-completing-read+.

2016-06-01 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/packages/emacs.scm (emacs-ido-completing-read+): New variable.
---
 gnu/packages/emacs.scm | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 54885f4..ee875ef 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1931,3 +1931,26 @@ successive level is highlighted in a different color, 
making it easy to spot
 matching delimiters, orient yourself in the code, and tell which statements
 are at a given level.")
 (license license:gpl3+)))
+
+(define-public emacs-ido-completing-read+
+  (package
+(name "emacs-ido-completing-read+")
+(version "3.12")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://raw.githubusercontent.com;
+  "/DarwinAwardWinner/ido-ubiquitous/v"
+  version "/ido-completing-read+.el"))
+  (file-name (string-append "ido-completing-read+-" version ".el"))
+  (sha256
+   (base32
+"1cyalb0p7nfsm4n6n9q6rjmvn6adqc0fq8ybnlj3n41n289dkfjf"
+(build-system emacs-build-system)
+(home-page "https://github.com/DarwinAwardWinner/ido-ubiquitous;)
+(synopsis "Replacement for completing-read using ido")
+(description
+ "The ido-completing-read+ function is a wrapper for ido-completing-read.
+Importantly, it detects edge cases that ordinary ido cannot handle and either
+adjusts them so ido can handle them, or else simply falls back to the standard
+Emacs completion function instead.")
+(license license:gpl3+)))
-- 
2.8.3




[PATCH 08/10] gnu: Add emacs-ido-ubiquitous.

2016-06-01 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/packages/emacs.scm (emacs-ido-ubiquitous): New variable.
---
 gnu/packages/emacs.scm | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index ee875ef..0ea317a 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1954,3 +1954,26 @@ Importantly, it detects edge cases that ordinary ido 
cannot handle and either
 adjusts them so ido can handle them, or else simply falls back to the standard
 Emacs completion function instead.")
 (license license:gpl3+)))
+
+(define-public emacs-ido-ubiquitous
+  (package
+(name "emacs-ido-ubiquitous")
+(version "3.12")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://raw.githubusercontent.com;
+  "/DarwinAwardWinner/ido-ubiquitous/v"
+  version "/ido-ubiquitous.el"))
+  (file-name (string-append "ido-ubiquitous-" version ".el"))
+  (sha256
+   (base32
+"197ypji0fb6jsdcq40rpnknwlh3imas6s6jbsvkfm0pz9988c3q2"
+(build-system emacs-build-system)
+(propagated-inputs
+ `(("emacs-ido-completing-read+" ,emacs-ido-completing-read+)))
+(home-page "https://github.com/DarwinAwardWinner/ido-ubiquitous;)
+(synopsis "Use ido (nearly) everywhere")
+(description
+ "Ido-ubiquitous enables ido-style completion for almost every function
+that uses the standard completion function completing-read.")
+  (license license:gpl3+)))
-- 
2.8.3




[PATCH 03/10] gnu: Add emacs-markdown-mode.

2016-06-01 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/packages/emacs.scm (emacs-markdown-mode): New variable.
---
 gnu/packages/emacs.scm | 21 +
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index cad843c..cd64383 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1840,3 +1840,24 @@ highlighting using a recursive-descent parser, 
on-the-fly reporting of syntax
 errors and strict-mode warnings, smart line-wrapping within comments and
 strings, and code folding.")
 (license license:gpl3+)))
+
+(define-public emacs-markdown-mode
+  (package
+(name "emacs-markdown-mode")
+(version "2.1")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://raw.githubusercontent.com/jrblevin;
+  "/markdown-mode/v" version
+  "/markdown-mode.el"))
+  (file-name (string-append "markdown-mode-" version ".el"))
+  (sha256
+   (base32
+"1faibar32jnjia9202swblw91q6z1g5s4k9xmypwjahfh8yznl6w"
+(build-system emacs-build-system)
+(home-page "http://jblevins.org/projects/markdown-mode/;)
+(synopsis "Emacs Major mode for Markdown files")
+(description
+ "Markdown-mode is a major mode for editing Markdown-formatted text files
+in Emacs.")
+(license license:gpl3+)))
-- 
2.8.3




[PATCH 09/10] gnu: Add emacs-yaml-mode.

2016-06-01 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/packages/emacs.scm (emacs-yaml-mode): New variable.
---
 gnu/packages/emacs.scm | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 0ea317a..bfa46c4 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1977,3 +1977,26 @@ Emacs completion function instead.")
  "Ido-ubiquitous enables ido-style completion for almost every function
 that uses the standard completion function completing-read.")
   (license license:gpl3+)))
+
+(define-public emacs-yaml-mode
+  (package
+(name "emacs-yaml-mode")
+(version "0.0.12")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://raw.githubusercontent.com/yoshiki;
+  "/yaml-mode/v" version "/yaml-mode.el"))
+  (file-name (string-append "yaml-mode-" version ".el"))
+  (sha256
+   (base32
+"05zbb7l5j0jhn1z65lhy1f6yf77rd3rsf5ayvwm5a6dfkhr9zwnm"
+(build-system emacs-build-system)
+(home-page "https://github.com/yoshiki/yaml-mode;)
+(synopsis "Major mode for editing YAML files")
+(description
+ "Yaml-mode is an Emacs major mode for editing files in the YAML data
+serialization format.  It was initially developed by Yoshiki Kurihara and many
+features were added by Marshall Vandegrift.  As YAML and Python share the fact
+that indentation determines structure, this mode provides indentation and
+indentation command behavior very similar to that of python-mode.")
+(license license:gpl3+)))
-- 
2.8.3




[PATCH 2/2] gnu: Add emacs-better-defaults.

2016-05-27 Thread David Thompson
* gnu/packages/emacs.scm (emacs-better-defaults): New variable.
---
 gnu/packages/emacs.scm | 21 +
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 5d6db5a..105c25d 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -1706,3 +1706,24 @@ It is recommended to use @code{clojure-mode} with 
paredit or smartparens.")
 The purpose of this library is to wrap all the quirks and hassle of
 @code{package.el} into a sane API.")
 (license license:gpl3+)))
+
+(define-public emacs-better-defaults
+  (package
+(name "emacs-better-defaults")
+(version "0.1.3")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "http://stable.melpa.org/packages/better-defaults-;
+   version ".el"))
+   (sha256
+(base32
+ "0lvpmja8i8v10lbcvzj6pd7vn9c7gnlbcddd416g2pjq0yydydgf"
+(build-system emacs-build-system)
+(home-page "https://github.com/technomancy/better-defaults;)
+(synopsis "Better defaults for Emacs")
+(description
+ "Better defaults attempts to address the most obvious deficiencies of the
+Emacs default configuration in uncontroversial ways that nearly everyone can
+agree upon.")
+(license license:gpl3+)))
-- 
2.7.3




[PATCH] gnu: lapack: Build the LAPACKE library.

2016-05-25 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/packages/maths.scm (lapack)[arguments]: Add "-DLAPACKE=ON".
---
 gnu/packages/maths.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 19ed44f..c844db2 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -333,7 +333,8 @@ large scale eigenvalue problems.")
 (inputs `(("fortran" ,gfortran)
   ("python" ,python-2)))
 (arguments
- `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")
+ `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
+   "-DLAPACKE=ON")
#:phases (alist-cons-before
  'check 'patch-python
  (lambda* (#:key inputs #:allow-other-keys)
-- 
2.7.3




[PATCH] gnu: Add mitlm.

2016-05-25 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/packages/speech.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk|  1 +
 gnu/packages/speech.scm | 51 +
 2 files changed, 52 insertions(+)
 create mode 100644 gnu/packages/speech.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 9cd9699..0c33934 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -311,6 +311,7 @@ GNU_SYSTEM_MODULES =\
   %D%/packages/slang.scm   \
   %D%/packages/slim.scm\
   %D%/packages/smalltalk.scm   \
+  %D%/packages/speech.scm  \
   %D%/packages/ssh.scm \
   %D%/packages/stalonetray.scm \
   %D%/packages/statistics.scm  \
diff --git a/gnu/packages/speech.scm b/gnu/packages/speech.scm
new file mode 100644
index 000..60ebf67
--- /dev/null
+++ b/gnu/packages/speech.scm
@@ -0,0 +1,51 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 Ricardo Wurmus <rek...@elephly.net>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages speech)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages gcc))
+
+(define-public mitlm
+  (package
+(name "mitlm")
+(version "0.4.1")
+;; No official release tarballs, so for now we use the one from Debian
+;; that is maintained by one of the project developers.
+;;
+;; See: https://github.com/mitlm/mitlm/issues/54
+(source (origin
+  (method url-fetch)
+  (uri (string-append "http://http.debian.net/debian/pool/main/m/;
+  "mitlm/mitlm_" version ".orig.tar.gz"))
+  (sha256
+   (base32
+"12m09xxx8jbir9cnzzaysvni5sfijpfj96z1x1520qqvmpc8lmn7"
+(build-system gnu-build-system)
+(native-inputs
+ `(("gfortran" ,gfortran)))
+(synopsis "The MIT Language Modeling toolkit")
+(description "The MIT Language Modeling (MITLM) toolkit is a set of
+tools designed for the efficient estimation of statistical n-gram language
+models involving iterative parameter estimation.  It achieves much of its
+efficiency through the use of a compact vector representation of n-grams.")
+(home-page "https://github.com/mitlm/mitlm;)
+(license license:expat)))
-- 
2.7.3




[PATCH] gnu: Add autoconf-archive.

2016-05-25 Thread David Thompson
From: David Thompson <da...@gnu.org>

* gnu/packages/autotools.scm (autoconf-archive): New variable.
---
 gnu/packages/autotools.scm | 20 
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm
index ddc628d..1f0c2af 100644
--- a/gnu/packages/autotools.scm
+++ b/gnu/packages/autotools.scm
@@ -159,6 +159,26 @@ exec ~a --no-auto-compile \"$0\" \"$@\"
 port)))
(chmod (string-append bin "/autoconf") #o555)))
 
+(define-public autoconf-archive
+  (package
+(name "autoconf-archive")
+(version "2016.03.20")
+(source
+ (origin
+  (method url-fetch)
+  (uri (string-append "mirror://gnu/autoconf-archive/autoconf-archive-"
+  version ".tar.xz"))
+  (sha256
+   (base32
+"0dz4fnc723jqn3by22ds5fys7g31apzm1r9allldvva0yvzjxyw8"
+(build-system gnu-build-system)
+(home-page "https://www.gnu.org/software/autoconf-archive;)
+(synopsis "Additional macros for GNU Autoconf")
+(description
+ "The GNU Autoconf Archive is a collection of more than 500 macros for GNU
+Autoconf.")
+(license gpl3+)))
+
 (define-public autobuild
   (package
 (name "autobuild")
-- 
2.7.3




[PATCH 0/6] Fix AVR toolchain.

2016-04-14 Thread David Thompson

Manolis and I spend quite a lot of time figuring out why our GCC AVR
cross-compilation toolchain is so broken and we were finally able to fix it!
So here's a patch set that fixes things, updates avr-libc to 2.0.0, and adds a
handy avr-toolchain package inspired by the gcc-toolchain package.

Happy firmware hacking!

- Dave



[PATCH 4/5] gnu: Add avr-toolchain.

2016-04-14 Thread David Thompson
* gnu/packages/avr.scm (avr-toolchain): New variable.
---
 gnu/packages/avr.scm | 21 +
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm
index 81ca162..94776d8 100644
--- a/gnu/packages/avr.scm
+++ b/gnu/packages/avr.scm
@@ -24,8 +24,10 @@
   #:use-module (guix download)
   #:use-module (guix packages)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system trivial)
   #:use-module (gnu packages)
   #:use-module (gnu packages cross-base)
+  #:use-module (gnu packages flashing-tools)
   #:use-module (gnu packages vim)
   #:use-module (gnu packages zip))
 
@@ -102,6 +104,25 @@ for use with GCC on Atmel AVR microcontrollers.")
 (license
  (license:non-copyleft "http://www.nongnu.org/avr-libc/LICENSE.txt;
 
+(define-public avr-toolchain
+  (package
+(name "avr-toolchain")
+(version (package-version avr-gcc))
+(source #f)
+(build-system trivial-build-system)
+(arguments '(#:builder (mkdir %output)))
+(propagated-inputs
+ `(("avrdude" ,avrdude)
+   ("binutils" ,avr-binutils)
+   ("gcc" ,avr-gcc)
+   ("libc" ,avr-libc)))
+(synopsis "Complete GCC tool chain for AVR microcontroller development")
+(description "This package provides a complete GCC tool chain for AVR
+microcontroller development.  This includes the GCC AVR cross compiler and
+avrdude for firmware flashing.  The supported programming languages are C and
+C++.")
+(home-page (package-home-page avr-libc))
+(license (package-license avr-gcc
 
 (define-public microscheme
   (package
-- 
2.7.3




[PATCH 5/5] gnu: Remove xgcc-avr.

2016-04-14 Thread David Thompson
We now have a dedicated package module for the AVR toolchain with
important modifications on top of what cross-gcc produces.

* gnu/packages/cross-base.scm (xgcc-avr): Delete.
---
 gnu/packages/cross-base.scm | 6 --
 1 file changed, 6 deletions(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index aa67d21..9b97e75 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -352,12 +352,6 @@ XBINUTILS and the cross tool chain."
(package-supported-systems xgcc)
'("mips64el-linux" "i686-linux"))
 
-(define-public xgcc-avr
-  ;; AVR cross-compiler, used to build AVR-Libc.
-  (let ((triplet "avr"))
-(cross-gcc triplet
-   (cross-binutils triplet
-
 (define-public xgcc-xtensa
   ;; Bare-bones Xtensa cross-compiler, used to build the Atheros firmware.
   (cross-gcc "xtensa-elf"))
-- 
2.7.3




[PATCH 3/5] gnu: avr-libc: Fix build.

2016-04-14 Thread David Thompson
* gnu/packages/avr.scm (avr-libc): Update to 2.0.0.
[native-inputs]: Use new avr-gcc and avr-binutils.
[arguments]: Add phase to unset C_INCLUDE_PATH.
---
 gnu/packages/avr.scm | 32 +---
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm
index 0ec115e..81ca162 100644
--- a/gnu/packages/avr.scm
+++ b/gnu/packages/avr.scm
@@ -70,28 +70,38 @@
 (define-public avr-libc
   (package
 (name "avr-libc")
-(version "1.8.1")
+(version "2.0.0")
 (source (origin
   (method url-fetch)
-  (uri (string-append
-"mirror://savannah//avr-libc/avr-libc-"
-version ".tar.bz2"))
+  (uri (string-append "mirror://savannah//avr-libc/avr-libc-"
+  version ".tar.bz2"))
   (sha256
(base32
-"0sd9qkvhmk9av4g1f8dsjwc309hf1g0731bhvicnjb3b3d42l1n3"
+"15svr2fx8j6prql2il2fc0ppwlv50rpmyckaxx38d3gxxv97zpdj"
 (build-system gnu-build-system)
 (arguments
- `(#:out-of-source? #t
-   #:configure-flags '("--host=avr")))
-
-(native-inputs `(("cross-binutils" ,(cross-binutils "avr"))
- ("cross-gcc" ,xgcc-avr)))
+ '(#:out-of-source? #t
+   #:configure-flags '("--host=avr")
+   #:phases
+   (modify-phases %standard-phases
+ (add-before 'unpack 'fix-cpath
+   (lambda _
+ ;; C_INCLUDE_PATH poses issues for cross-building, leading to
+ ;; failures when building avr-libc on 64-bit systems.  Simply
+ ;; unsetting it allows the build to succeed because it doesn't
+ ;; try to use any of the native system's headers.
+ (unsetenv "C_INCLUDE_PATH")
+ #t)
+(native-inputs `(("avr-binutils" ,avr-binutils)
+ ("avr-gcc" ,avr-gcc)))
 (home-page "http://www.nongnu.org/avr-libc/;)
 (synopsis "The AVR C Library")
 (description
  "AVR Libc is a project whose goal is to provide a high quality C library
 for use with GCC on Atmel AVR microcontrollers.")
-(license (license:non-copyleft 
"http://www.nongnu.org/avr-libc/LICENSE.txt;
+(license
+ (license:non-copyleft "http://www.nongnu.org/avr-libc/LICENSE.txt;
+
 
 (define-public microscheme
   (package
-- 
2.7.3




[PATCH 1/5] gnu: Add avr-binutils.

2016-04-14 Thread David Thompson
* gnu/packages/avr.scm (avr-binutils): New variable.
---
 gnu/packages/avr.scm | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm
index d59816b..b30c64e 100644
--- a/gnu/packages/avr.scm
+++ b/gnu/packages/avr.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis...@gmail.com>
+;;; Copyright © 2014, 2016 Manolis Fragkiskos Ragkousis <manolis...@gmail.com>
 ;;; Copyright © 2015 Ricardo Wurmus <rek...@elephly.net>
+;;; Copyright © 2016 David Thompson <da...@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -27,6 +28,14 @@
   #:use-module (gnu packages vim)
   #:use-module (gnu packages zip))
 
+(define-public avr-binutils
+  (package
+(inherit (cross-binutils "avr"))
+(name "avr-binutils")
+(arguments
+ '(#:configure-flags '("--target=avr"
+   "--disable-nls")
+
 (define-public avr-libc
   (package
 (name "avr-libc")
-- 
2.7.3




[PATCH] environment: Set a default value for PS1.

2016-03-27 Thread David Thompson
Here's a hopefully uncontroversial patch that sets PS1 in 'guix
environment' containers to something more friendly than what bash shows
by default when PS1 is unset.  OK to push?

>From 10741ce4e09c5990e70c94f5ed650b3561d042a0 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Sun, 27 Mar 2016 21:20:19 -0400
Subject: [PATCH] environment: Set a default value for PS1.

* guix/scripts/environment.scm (launch-environment/container): Set PS1
  during container initialization.
---
 guix/scripts/environment.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index fc75d78..6aa5ad0 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -425,6 +425,9 @@ host file systems to mount inside the container."
 (mkdir-p "/bin")
 (symlink bash "/bin/sh")
 
+;; Set a reasonable default PS1.
+(setenv "PS1" "[ENV] \\u@\\h \\w\\$ ")
+
 ;; Setup directory for temporary files.
 (mkdir-p "/tmp")
     (for-each (lambda (var)
-- 
2.7.3


-- 
David Thompson


[PATCH] scripts: environment: Properly handle SIGINT.

2016-03-26 Thread David Thompson
Has anyone ever been really annoyed that C-c doesn't work in a bash
shell spawned by 'guix environment'?  Me too!  And I finally got around
to fixing it.  I would like to get this in before 0.10.0 is released.

Ludo, I removed one of the tests in guix-environment-container.sh
because it seems obsolete to me now.  Let me know if you think of
another test to replace it.

Thanks!

>From ec7994eec73d322386abbcd901da1b1d2f6f7733 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Sat, 26 Mar 2016 08:45:08 -0400
Subject: [PATCH] scripts: environment: Properly handle SIGINT.

Switching to execlp means that the process spawned in a container is PID
1, which obsoleted one of the 'guix environment --container' tests
because the init process can't be killed in the usual manner.

* guix/scripts/environment.scm (launch-environment/fork): New procedure.
(launch-environment): Switch from system* to execlp.  Add handler for
SIGINT.
(guix-environment): Use launch-environment/fork.
* tests/guix-environment-container.sh: Remove obsolete test.
---
 guix/scripts/environment.scm| 19 +--
 tests/guix-environment-container.sh |  7 ---
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index ee8f6b1..d554ca2 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -358,8 +358,22 @@ and suitable for 'exit'."
   "Run COMMAND in a new environment containing INPUTS, using the native search
 paths defined by the list PATHS.  When PURE?, pre-existing environment
 variables are cleared before setting the new ones."
+  ;; Properly handle SIGINT, so pressing C-c in an interactive terminal
+  ;; application works.
+  (sigaction SIGINT SIG_DFL)
   (create-environment inputs paths pure?)
-  (apply system* command))
+  (match command
+((program . args)
+ (apply execlp program program args
+
+(define (launch-environment/fork command inputs paths pure?)
+  "Run COMMAND in a new process with an environment containing INPUTS, using
+the native search paths defined by the list PATHS.  When PURE?, pre-existing
+environment variables are cleared before setting the new ones."
+  (match (primitive-fork)
+(0 (launch-environment command inputs paths pure?))
+(pid (match (waitpid pid)
+   ((_ . status) status)
 
 (define* (launch-environment/container #:key command bash user-mappings
profile paths network?)
@@ -582,4 +596,5 @@ message if any test fails."
  (else
   (return
(exit/status
-(launch-environment command profile paths pure?)
+(launch-environment/fork command profile
+ paths pure?)
diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh
index aba34a3..da4c6fc 100644
--- a/tests/guix-environment-container.sh
+++ b/tests/guix-environment-container.sh
@@ -81,10 +81,3 @@ grep $(guix build guile-bootstrap) $tmpdir/mounts
 grep -e "$NIX_STORE_DIR/.*-bash" $tmpdir/mounts # bootstrap bash
 
 rm $tmpdir/mounts
-
-if guix environment --bootstrap --container \
-	--ad-hoc bootstrap-binaries -- kill -SEGV 2
-then false;
-else
-test $? -gt 127
-fi
-- 
2.7.3


-- 
David Thompson


[PATCHES] Upgrade Kodi to 16.0

2016-03-12 Thread David Thompson
This patch set adds 2 new dependencies for Kodi, dcadec and crossguid,
and upgrades Kodi to 16.0.

TIA for review,

>From 80f08dde121610dcc832f4e6ecdd11341166580c Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Sat, 12 Mar 2016 12:23:47 -0500
Subject: [PATCH 1/3] gnu: Add crossguid.

* gnu/packages/kodi.scm (crossguid): New variable.
---
 gnu/packages/kodi.scm | 50 ++
 1 file changed, 50 insertions(+)

diff --git a/gnu/packages/kodi.scm b/gnu/packages/kodi.scm
index 4a9cebd..fd56af6 100644
--- a/gnu/packages/kodi.scm
+++ b/gnu/packages/kodi.scm
@@ -21,6 +21,7 @@
   #:use-module (guix utils)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages audio)
@@ -68,6 +69,55 @@
   #:use-module (gnu packages yasm)
   #:use-module (gnu packages zip))
 
+(define-public crossguid
+  (let ((commit "8f399e8bd4252be9952f3dfa8199924cc8487ca4"))
+(package
+  (name "crossguid")
+  (version (string-append "0.0-1." (string-take commit 7)))
+  ;; There's no official release.  Just a Git repository.
+  (source (origin
+(method git-fetch)
+(uri (git-reference
+  (url "https://github.com/graeme-hill/crossguid.git;)
+  (commit commit)))
+(sha256
+ (base32
+  "1i29y207qqddvaxbn39pk2fbh3gx8zvdprfp35wasj9rw2wjk3s9"
+  (build-system gnu-build-system)
+  (arguments
+   '(#:phases
+ (modify-phases %standard-phases
+   (delete 'configure) ; no configure script
+   ;; There's no build system here, so we have to do it ourselves.
+   (replace 'build
+ (lambda _
+   (and (zero? (system* "g++" "-c" "guid.cpp" "-o" "guid.o"
+"-std=c++11" "-DGUID_LIBUUID"))
+(zero? (system* "ar" "rvs" "libcrossguid.a" "guid.o")
+   (replace 'check
+ (lambda _
+   (and (zero? (system* "g++" "-c" "test.cpp" "-o" "test.o"
+"-std=c++11"))
+(zero? (system* "g++" "-c" "testmain.cpp" "-o" "testmain.o"
+"-std=c++11"))
+(zero? (system* "g++" "test.o" "guid.o" "testmain.o"
+"-o" "test" "-luuid"))
+(zero? (system* (string-append (getcwd) "/test"))
+   (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+   (let ((out (assoc-ref outputs "out")))
+ (install-file "guid.h" (string-append out "/include"))
+ (install-file "libcrossguid.a"
+   (string-append out "/lib"))
+ #t))
+  (inputs
+   `(("util-linux" ,util-linux)))
+  (synopsis "Lightweight GUID/UUID library")
+  (description "CrossGuid is a minimal GUID/UUID generator library for
+C++.")
+  (home-page "https://github.com/graeme-hill/crossguid;)
+  (license license:expat
+
 (define-public kodi
   (package
 (name "kodi")
-- 
2.6.3

>From c7a1e349381a36080fb72a31f32665be157d22fe Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Tue, 1 Mar 2016 10:04:14 -0500
Subject: [PATCH 2/3] gnu: Add dcadec.

* gnu/packages/audio.scm (dcadec): New variable.
---
 gnu/packages/audio.scm | 34 ++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 10c2632..f489bc3 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -2073,3 +2073,37 @@ module to handle that particular file type.")
 (home-page "http://etree.org/shnutils/shntool/;)
 ;; 'install-sh' bears the x11 license
 (license (list license:gpl2+ license:x11
+
+(define-public dcadec
+  (package
+(name "dcadec")
+(version "0.2.0")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://github.com/foo86/dcadec/archive/v;
+  version ".tar.gz"))
+  (sha256
+   (base32
+"0i0dpypgqkhhi4v1fmsp2way6w9kbcix3c7q79pmg39yvrzj17gd"
+(build-system gnu-build-system)
+

[PATCH] gnu: Add byzanz.

2016-02-27 Thread David Thompson
Here's a package for a convenient little program to capture desktop
recordings as animated GIFs.  It hasn't seen a stable release in 5 years
so we use what's in the Git repo instead.

>From 2192e78f9b46901c581a4288d5dc28fa820871ed Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Sat, 27 Feb 2016 09:58:50 -0500
Subject: [PATCH] gnu: Add byzanz.

* gnu/packages/gnome.scm (byzanz): New variable.
---
 gnu/packages/gnome.scm | 54 ++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 578b431..2006fb6 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -34,6 +34,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system glib-or-gtk)
@@ -4811,3 +4812,56 @@ software that do not provide their own configuration interface.")
  "GNOME is an intutive and attractive desktop environment.  It aims to be
 an easy and elegant way to use your computer.")
 (license license:gpl2+)))
+
+(define-public byzanz
+  ;; The last stable release of Byzanz was in 2011, but there have been many
+  ;; useful commits made to the Byzanz repository since then that it would be
+  ;; silly to use such an old release.
+  (let ((commit "f7af3a5bd252db84af8365bd059c117a7aa5c4af"))
+(package
+  (name "byzanz")
+  (version (string-append "0.2-1." (string-take commit 7)))
+  (source (origin
+(method git-fetch)
+(uri (git-reference
+  (url "git://git.gnome.org/byzanz")
+  (commit commit)))
+(sha256
+ (base32
+  "1l60myzxf9cav27v5v3nsijlslz9r7ip6d5kiirfpkf9k0w26hz3"
+  (build-system glib-or-gtk-build-system)
+  (arguments
+   '(#:phases
+ (modify-phases %standard-phases
+   (add-after 'unpack 'bootstrap
+ (lambda _
+   ;; The build system cleverly detects that we're not building from
+   ;; a release tarball and turns on -Werror for GCC.
+   ;; Unsurprisingly, there is a warning during compilation that
+   ;; causes the build to fail unnecessarily, so we remove the flag.
+   (substitute* '("configure.ac")
+ (("-Werror") ""))
+   ;; The autogen.sh script in gnome-common will run ./configure
+   ;; by default, which is problematic because source shebangs
+   ;; have not yet been patched.
+   (setenv "NOCONFIGURE" "t")
+   (zero? (system* "sh" "autogen.sh")))
+  (native-inputs
+   `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("gnome-common" ,gnome-common)
+ ("intltool" ,intltool)
+ ("libtool" ,libtool)
+ ("pkg-config" ,pkg-config)
+ ("which" ,which)))
+  (inputs
+   `(("glib" ,glib)
+ ("gstreamer" ,gstreamer)
+ ("gst-plugins-base" ,gst-plugins-base)
+ ("gtk+" ,gtk+)))
+  (synopsis "Desktop recording program")
+  (description "Byzanz is a simple desktop recording program with a
+command-line interface.  It can record part or all of an X display for a
+specified duration and save it as a GIF encoded animated image file.")
+  (home-page "https://git.gnome.org/browse/byzanz;)
+  (license license:gpl2+
-- 
2.6.3


-- 
David Thompson
GPG Key: 0FF1D807


[PATCHES] Add Aseprite and Allegro 4

2016-01-29 Thread David Thompson
Hello Guix!

I found out about a really neat little pixel art editing tool called
Aseprite, so I packaged it!

Allegro 4 is licensed under a weird license called the "giftware"
license that is *very* similar to the Expat license.  But fear not, it
is a free license and Allegro 4 is included in Debian and fully free
distros like Trisquel.  I named the Allegro 4 variable "allegro-4"
instead of just "allegro" because Allegro 5 is the latest and greatest
version of Allegro but I just haven't packaged it yet.

TIA for review!

P.S. - Have a happy FOSDEM!

- Dave

>From 15327686420a477b91d11377a1586188592ec431 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Fri, 29 Jan 2016 16:03:50 -0500
Subject: [PATCH 1/3] license: Add giftware.

* guix/licenses.scm (giftware): New variable.
---
 guix/licenses.scm | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/guix/licenses.scm b/guix/licenses.scm
index 1def1ac..cb23734 100644
--- a/guix/licenses.scm
+++ b/guix/licenses.scm
@@ -40,6 +40,7 @@
 epl1.0
 expat
 freetype
+giftware
 gpl1 gpl1+ gpl2 gpl2+ gpl3 gpl3+
 gfl1.0
 fdl1.3+
@@ -201,6 +202,11 @@ at URI, which may be a file:// URI pointing the package's tree."
"http://directory.fsf.org/wiki/License:Freetype;
"https://www.gnu.org/licenses/license-list.html#freetype;))
 
+(define giftware
+  (license "Giftware"
+   "http://liballeg.org/license.html;
+   "The Allegro 4 license"))
+
 (define gpl1
   (license "GPL 1"
"https://www.gnu.org/licenses/old-licenses/gpl-1.0.html;
-- 
2.5.0

>From 027f4108e5b4e982dfc72b8216e910d5f504cb30 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Fri, 29 Jan 2016 16:08:12 -0500
Subject: [PATCH 2/3] gnu: Add allegro-4.

* gnu/packages/game-development.scm (allegro-4): New variable.
---
 gnu/packages/game-development.scm | 38 ++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 0274904..71543e1 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -295,3 +295,41 @@ archive on a per-file basis.")
 programming language.")
 (home-page "https://love2d.org/;)
 (license license:zlib)))
+
+(define-public allegro-4
+  (package
+(name "allegro")
+(version "4.4.2")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "http://download.gna.org/allegro/allegro/;
+  version "/allegro-" version ".tar.gz"))
+  (sha256
+   (base32
+"1p0ghkmpc4kwij1z9rzxfv7adnpy4ayi0ifahlns1bdzgmbyf88v"
+(build-system cmake-build-system)
+(arguments
+ '(#:phases
+   (modify-phases %standard-phases
+ (add-after 'unpack 'patch-build-system
+   (lambda _
+ ;; Build addons as shared libraries.  Trying to set ADDON_LINKAGE
+ ;; via a command line option doesn't work because it is
+ ;; unconditionally clobbered in the build script.
+ (substitute* '("CMakeLists.txt")
+   (("ADDON_LINKAGE STATIC")
+"ADDON_LINKAGE SHARED"))
+ #t)
+(inputs
+ `(("glu" ,glu)
+   ("libpng" ,libpng)
+   ("libvorbis" ,libvorbis)
+   ("mesa" ,mesa)
+   ("zlib" ,zlib)))
+(synopsis "Game programming library")
+(description "Allegro is a library mainly aimed at video game and
+multimedia programming.  It handles common, low-level tasks such as creating
+windows, accepting user input, loading data, drawing images, playing sounds,
+etc.")
+(home-page "http://liballeg.org;)
+(license license:giftware)))
-- 
2.5.0

>From 0678e9501403b55f6cb3ba772070e91a9aa48127 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Fri, 29 Jan 2016 16:17:45 -0500
Subject: [PATCH 3/3] gnu: Add aseprite.

* gnu/packages/game-development.scm (aseprite): New variable.
---
 gnu/packages/game-development.scm | 72 ++-
 1 file changed, 71 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 71543e1..f7ec9e8 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -24,9 +24,11 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-modul

[PATCH] gnu: Add obs.

2015-12-17 Thread David Thompson
>From 5eed082c01499482812c6a7b89f82dda8550e25d Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Thu, 17 Dec 2015 13:36:42 -0500
Subject: [PATCH] gnu: Add obs.

* gnu/packages/video.scm (obs): New variable.
---
 gnu/packages/video.scm | 38 ++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 4f6ef6d..5d118ca 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -42,6 +42,7 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages cdrom)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages doxygen)
   #:use-module (gnu packages elf)
@@ -1270,3 +1271,40 @@ players, transcoders, web streamers and many more types of applications.  The
 functionality of the system is provided via an assortment of ready to use
 tools, XML authoring components, and an extensible plug-in based API.")
 (license license:lgpl2.1+)))
+
+(define-public obs
+  (package
+(name "obs")
+(version "0.12.4")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "https://github.com/jp9000/obs-studio;
+  "/archive/" version ".tar.gz"))
+  (file-name (string-append name "-" version ".tar.gz"))
+  (sha256
+   (base32
+"0b1xb5vd3g4h7m1hsjzsq3bbbnqb2n6mpmq6ix4yyy72g087rjk1"
+(build-system cmake-build-system)
+(arguments '(#:tests? #f)) ; no tests
+(native-inputs
+ `(("pkg-config" ,pkg-config)))
+(inputs
+ `(("curl" ,curl)
+   ("eudev" ,eudev)
+   ("ffmpeg" ,ffmpeg)
+   ("freetype" ,freetype)
+   ("jack" ,jack-1)
+   ("jansson" ,jansson)
+   ("libx264" ,libx264)
+   ("libxcomposite" ,libxcomposite)
+   ("mesa" ,mesa)
+   ("pulseaudio" ,pulseaudio)
+   ("qt" ,qt)
+   ("zlib" ,zlib)))
+(synopsis "Live streaming software")
+(description "Open Broadcaster Software provides a graphical interface for
+video recording and live streaming.  OBS supports capturing audio and video
+from many input sources such as webcams, X11 (for screencasting), PulseAudio,
+and JACK.")
+(home-page "https://obsproject.com;)
+(license license:gpl2+)))
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[DMD] [PATCH] service: Change gid before uid when dropping privileges.

2015-12-03 Thread David Thompson
Found this little order of operations issue when trying to button up the
Transmission service.

>From 552eafe882e3c059525e79c0f222becb9d73eb93 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Thu, 3 Dec 2015 10:09:34 -0500
Subject: [PATCH] service: Change gid before uid when dropping privileges.

---
 modules/dmd/service.scm | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/dmd/service.scm b/modules/dmd/service.scm
index aece069..34826b1 100644
--- a/modules/dmd/service.scm
+++ b/modules/dmd/service.scm
@@ -614,23 +614,25 @@ false."
(catch-system-error (close-fdes i))
(loop (+ i 1)
 
- (when user
+ ;; setgid must be done *before* setuid, otherwise the user will
+ ;; likely no longer have permissions to setgid.
+ (when group
(catch #t
  (lambda ()
-   (setuid (passwd:uid (getpw user
+   (setgid (group:gid (getgr group
  (lambda (key . args)
(format (current-error-port)
-   "failed to change to user ~s:~%" user)
+   "failed to change to group ~s:~%" group)
(print-exception (current-error-port) #f key args)
(primitive-exit 1
 
- (when group
+ (when user
(catch #t
  (lambda ()
-   (setgid (group:gid (getgr group
+   (setuid (passwd:uid (getpw user
  (lambda (key . args)
(format (current-error-port)
-   "failed to change to group ~s:~%" group)
+   "failed to change to user ~s:~%" user)
(print-exception (current-error-port) #f key args)
    (primitive-exit 1
 
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] services: nginx: Allow for server extensions.

2015-12-01 Thread David Thompson
Hey folks,

Looking for some feedback on my first stab at making the nginx service
extensible.  With this extension mechanism, future web applications
(such as GNU MediaGoblin) that use nginx as a front-end web server will
be able to extend nginx with the server configuration that they need in
order to work.

Here's a useless service that adds nginx configuration to serve the
contents of /tmp:

(define server
  (plain-file "foo.conf"
  "
server {
  listen 80;
  root /tmp;
  index index.html;
  server_name dthompson.us;
}
"))

(define foo-service-type
  (service-type (name 'foo)
(extensions
 (list (service-extension nginx-service-type
  (const (list server)))

(define foo-service
  (service foo-service-type #f))

One big question I have is whether I should enforce that configuration
be in file-like objects or if I should allow strings, too.  Thoughts?

>From 108db2d183526c42b53060e55f7fb292b53663cb Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Mon, 30 Nov 2015 08:49:08 -0500
Subject: [PATCH] services: nginx: Allow for server extensions.

* gnu/services/web.scm ()[servers]: New field.
  (nginx-configuration-servers): New accessor.
  (default-nginx-config): Delete.
  (nginx-configuration-file*): New procedure.
  (nginx-activation): Perform the syntax check on the full computed
  configuration file.
  (nginx-dmd-service): Use the full computed configuration file when
  starting the service.
  (extend-nginx): New procedure.
  (nginx-service-type): Specify extension procedures.
  (nginx-service): Add #:servers argument.
---
 gnu/services/web.scm | 97 
 1 file changed, 60 insertions(+), 37 deletions(-)

diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 84bb30d..a5bc364 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -26,7 +26,16 @@
   #:use-module (guix records)
   #:use-module (guix gexp)
   #:use-module (ice-9 match)
-  #:export (nginx-service))
+  #:use-module (srfi srfi-1)
+  #:export (nginx-configuration
+nginx-configuration?
+nginx-configuration-log-directory
+nginx-configuration-run-directory
+nginx-configuration-file
+nginx-configuration-servers
+
+nginx-service-type
+nginx-service))
 
 ;;; Commentary:
 ;;;
@@ -37,23 +46,26 @@
 (define-record-type* 
   nginx-configuration make-nginx-configuration
   nginx-configuration?
-  (nginx nginx-configuration-nginx) ;
-  (log-directory nginx-configuration-log-directory) ;string
-  (run-directory nginx-configuration-run-directory) ;string
-  (file  nginx-configuration-file)) ;string | file-like
+  (nginx nginx-configuration-nginx) ; 
+  (log-directory nginx-configuration-log-directory) ; string
+  (run-directory nginx-configuration-run-directory) ; string
+  (file  nginx-configuration-file)  ; file-like
+  (servers   nginx-configuration-servers))  ; list of file-like
 
-(define (default-nginx-config log-directory run-directory)
-  (plain-file "nginx.conf"
-  (string-append
-   "user nginx nginx;\n"
-   "pid " run-directory "/pid;\n"
-   "error_log " log-directory "/error.log info;\n"
-   "http {\n"
-   "access_log " log-directory "/access.log;\n"
-   "root /var/www;\n"
-   "server {}\n"
-   "}\n"
-   "events {}\n")))
+(define (nginx-configuration-file* config)
+  (match config
+(($  _ log run file servers)
+ (apply mixed-text-file "nginx.conf"
+`("user nginx nginx;\n"
+  "pid " ,run "/pid;\n"
+  "error_log " ,log "/error.log info;\n"
+  "include " ,file ";\n"
+  "http {\n"
+  "  access_log " ,log "/access.log;\n"
+  ,@(append-map (lambda (server-config)
+  (list "include " server-config ";\n"))
+servers)
+  "}\n")
 
 (define %nginx-accounts
   (list (user-group (name "nginx") (system? #t))
@@ -66,37 +78,43 @@
  (shell #~(string-append #$shadow "/sbin/nologin")
 
 (define nginx-activation
-  (match-lambda
-(($  nginx log-directory run-directory config-file)
- #~(begin
- (use-modules (guix build utils))
+  (lambda (config)
+(match config
+  (($  nginx log-directory run-directory _)
+   #~(be

[PATCH] services: Add transmission-service.

2015-11-27 Thread David Thompson
My first service since the big service API rewrite.  How did I do?

>From 6f483d37bf157ee0d253d2aaa919d6900d23453c Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Fri, 27 Nov 2015 20:40:59 -0500
Subject: [PATCH] services: Add transmission-service.

* gnu/services/bittorrent.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* doc/guix.texi ("BitTorrent Services"): Document it.
---
 doc/guix.texi   |  19 +++
 gnu-system.am   |   1 +
 gnu/services/bittorrent.scm | 122 
 3 files changed, 142 insertions(+)
 create mode 100644 gnu/services/bittorrent.scm

diff --git a/doc/guix.texi b/doc/guix.texi
index b404453..847d196 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -6292,6 +6292,7 @@ declaration.
 * Desktop Services::D-Bus and desktop services.
 * Database Services::   SQL databases.
 * Web Services::Web servers.
+* BitTorrent Services:: BitTorrent services.
 * Various Services::Other services.
 @end menu
 
@@ -7013,6 +7014,24 @@ directories are created when the service is activated.
 
 @end deffn
 
+@node BitTorrent Services
+@subsubsection BitTorrent Services
+
+The @code{(gnu services bittorrent)} module provides the following service:
+
+@deffn {Scheme Procedure} transmission-service [#:transmission transmission] @
+   [#:port 9091] [#:peer-port 51413]@
+   [#:download-directory ``/var/lib/transmission/downloads'']
+
+Return a service that runs @var{transmission}, a daemon that downloads
+and shares files via the BitTorrent protocol.
+
+The daemon will serve the web user interface over @var{port}, handle
+BitTorrent tasks over @var{peer-port}, and save downloaded files to
+@var{download-directory}.
+
+@end deffn
+
 @node Various Services
 @subsubsection Various Services
 
diff --git a/gnu-system.am b/gnu-system.am
index f69645b..da1b359 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -354,6 +354,7 @@ GNU_SYSTEM_MODULES =\
   gnu/services.scm\
   gnu/services/avahi.scm			\
   gnu/services/base.scm\
+  gnu/services/bittorrent.scm			\
   gnu/services/databases.scm			\
   gnu/services/dbus.scm\
   gnu/services/desktop.scm			\
diff --git a/gnu/services/bittorrent.scm b/gnu/services/bittorrent.scm
new file mode 100644
index 000..140df53
--- /dev/null
+++ b/gnu/services/bittorrent.scm
@@ -0,0 +1,122 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 David Thompson <da...@gnu.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu services bittorrent)
+  #:use-module (gnu services)
+  #:use-module (gnu services dmd)
+  #:use-module (gnu system shadow)
+  #:use-module (gnu packages admin)
+  #:use-module (gnu packages bittorrent)
+  #:use-module (guix records)
+  #:use-module (guix gexp)
+  #:use-module (ice-9 match)
+  #:export (%transmission-state-directory
+
+transmission-configuration
+transmission-configuration?
+transmission-configuration-transmission
+transmission-configuration-port
+transmission-configuration-peer-port
+transmission-configuration-download-directory
+
+transmission-service-type
+transmission-service))
+
+;;; Commentary:
+;;;
+;;; BitTorrent services.
+;;;
+;;; Code:
+
+(define %transmission-state-directory "/var/lib/transmission")
+
+(define-record-type* 
+  transmission-configuration make-transmission-configuration
+  transmission-configuration?
+  (transmission   transmission-configuration-transmission) ; 
+  (port   transmission-configuration-port) ; integer
+  (peer-port  transmission-configuration-peer-port) ; integer
+  (download-directory transmission-configuration-download-directory)) ; string
+
+(define %transmission-accounts
+  (list (user-group (name "transmission") (system? #t))
+(user-account
+ (name "transmission")
+ (group "transmission")
+ (system? #t)
+ (comment "transmission daemon user")
+ (home-directory "/var/empty")
+ (shell #~(string-append #$shadow "/sbin/nologin")
+
+(define (transmission-activation 

[PATCHES] Add Kodi

2015-11-24 Thread David Thompson
This one was a real hairball, but here is a patch set that adds the Kodi
media center!  I hope that I've explained all the craziness relatively
well in the comments.

>From d708d0c36e202bbad7255c3b8a55ca0afdd18cb3 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Tue, 24 Nov 2015 13:35:44 -0500
Subject: [PATCH 1/3] gnu: Add tinyxml.

* gnu/packages/xml.scm (tinyxml): New variable.
* gnu/packages/patches/tinyxml-use-stl.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am  |  1 +
 gnu/packages/patches/tinyxml-use-stl.patch | 38 +
 gnu/packages/xml.scm   | 67 ++
 3 files changed, 106 insertions(+)
 create mode 100644 gnu/packages/patches/tinyxml-use-stl.patch

diff --git a/gnu-system.am b/gnu-system.am
index 61dfced..c97430f 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -695,6 +695,7 @@ dist_patch_DATA =		\
   gnu/packages/patches/texi2html-document-encoding.patch	\
   gnu/packages/patches/texi2html-i18n.patch			\
   gnu/packages/patches/tidy-CVE-2015-5522+5523.patch		\
+  gnu/packages/patches/tinyxml-use-stl.patch			\
   gnu/packages/patches/torsocks-dns-test.patch			\
   gnu/packages/patches/tvtime-gcc41.patch			\
   gnu/packages/patches/tvtime-pngoutput.patch			\
diff --git a/gnu/packages/patches/tinyxml-use-stl.patch b/gnu/packages/patches/tinyxml-use-stl.patch
new file mode 100644
index 000..ddc21d8
--- /dev/null
+++ b/gnu/packages/patches/tinyxml-use-stl.patch
@@ -0,0 +1,38 @@
+From a53b6ee4519a7657164610ac14a82c57b1273bf6 Mon Sep 17 00:00:00 2001
+From: David Thompson <dthomps...@worcester.edu>
+Date: Mon, 23 Nov 2015 06:54:36 -0500
+Subject: [PATCH] Use STL.
+
+---
+ tinyxml.h   | 2 ++
+ xmltest.cpp | 1 +
+ 2 files changed, 3 insertions(+)
+
+diff --git a/tinyxml.h b/tinyxml.h
+index a3589e5..6cbfc7d 100644
+--- a/tinyxml.h
 b/tinyxml.h
+@@ -43,6 +43,8 @@ distribution.
+ #define DEBUG
+ #endif
+ 
++#define TIXML_USE_STL 1
++
+ #ifdef TIXML_USE_STL
+ 	#include 
+  	#include 
+diff --git a/xmltest.cpp b/xmltest.cpp
+index 663c157..057dbfe 100644
+--- a/xmltest.cpp
 b/xmltest.cpp
+@@ -2,6 +2,7 @@
+Test program for TinyXML.
+ */
+ 
++#define TIXML_USE_STL 1
+ 
+ #ifdef TIXML_USE_STL
+ 	#include 
+-- 
+2.5.0
+
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index a296e0a..7d7e167 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -511,3 +511,70 @@ Libxml2).")
 UTF-8 and UTF-16 encoding.")
 ;; LGPL 2.0+ with additional exceptions for static linking
 (license license:lgpl2.0+)))
+
+;; TinyXML is an unmaintained piece of software, so the patches and build
+;; system massaging have no upstream potential.
+(define-public tinyxml
+  (package
+(name "tinyxml")
+(version "2.6.2")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "mirror://sourceforge/tinyxml/tinyxml_"
+  (string-join (string-split version #\.) "_")
+  ".tar.gz"))
+  (sha256
+   (base32
+"14smciid19lvkxqznfig77jxn5s4iq3jpb47vh5a6zcaqp7gvg8m"))
+  (patches (list (search-patch "tinyxml-use-stl.patch")
+(build-system gnu-build-system)
+;; This library is missing *a lot* of the steps to make it usable, so we
+;; have to add them here, like every other distro must do.
+(arguments
+ `(#:phases
+   (modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'build 'build-shared-library
+   (lambda _
+ (zero? (system* "g++" "-Wall" "-O2" "-shared" "-fpic"
+ "tinyxml.cpp" "tinyxmlerror.cpp"
+ "tinyxmlparser.cpp" "tinystr.cpp"
+ "-o" "libtinyxml.so"
+ (replace 'check
+   (lambda _ (zero? (system "./xmltest"
+ (replace 'install
+   (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+(include (string-append out "/include"))
+(lib (string-append out "/lib"))
+(pkgconfig (string-append out "/lib/pkgconfig"))
+(doc (string-append out "/share/doc")))
+   ;; Install libs and headers.
+   (install-file "libtinyxml.so" lib)
+   (install-file "tinystr.h" include)
+   (install-file "tinyxml.h" include)
+   ;; Generate and install pkg-config file.
+   (mkdir-p pkgconfig)
+   (call-with-output-file (string-append pkg

Including additional modules in dmd services

2015-11-19 Thread David Thompson
Hello hackers,

I am finally getting up to speed on the new service API, and I believe
I've run into a limitation of dmd services.  I wanted to use 'match'
from (ice-9 match) in the "start" action for a dmd service, like so:

(dmd-service
 (provision '(foo))
 (documentation "Foo service.")
 (requirement '(user-processes))
 (start #~(begin
(use-modules (ice-9 match))
(match #$something
  (foo ...
 (stop #~(const #t)))

The problem is that, while the module is successfully imported, the
'match' form is not treated as syntax, and thus the service fails with
an unbound variable 'foo' exception.  I hacked 'dmd-configuration-file'
in gnu/services/dmd.scm to import (ice-9 match) in the top-most
'use-modules' form of the 'config' gexp and then my service worked as
intended.

Am I just doing it wrong?  If it's a real limitation, what would be the
best way to specify the additional modules needed?  I looked around at
the various dmd services and couldn't find any other examples of needing
macros from another module.  I would love to know how to resolve this so
that I can continue my quest of managing user SSH keys with a dmd
service.

Thanks,

-- 
David Thompson
GPG Key: 0FF1D807



[PATCH] gnu: Add emulation-station.

2015-11-18 Thread David Thompson
>From 83cfad5d6e182ce1b31a983a10d109b087642537 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Wed, 18 Nov 2015 23:17:02 -0500
Subject: [PATCH] gnu: Add emulation-station.

* gnu/packages/games.scm (emulation-station): New variable.
---
 gnu/packages/games.scm | 35 ++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 8dcedc1..8e12ffd 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 John Darrington <j...@gnu.org>
-;;; Copyright © 2014 David Thompson <dthomps...@worcester.edu>
+;;; Copyright © 2014, 2015 David Thompson <dthomps...@worcester.edu>
 ;;; Copyright © 2014, 2015 Eric Bavier <bav...@member.fsf.org>
 ;;; Copyright © 2014 Cyrill Schenkel <cyrill.schen...@gmail.com>
 ;;; Copyright © 2014 Sylvain Beucler <b...@beuc.net>
@@ -38,6 +38,7 @@
   #:use-module (guix git-download)
   #:use-module (guix svn-download)
   #:use-module (gnu packages)
+  #:use-module (gnu packages algebra)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages backup)
   #:use-module (gnu packages base)
@@ -1820,3 +1821,35 @@ towards a working Mupen64Plus for casual users.")
 System (NES/Famicom) emulator Nestopia, with enhancements from members of the
 emulation community.  It provides highly accurate emulation.")
 (license license:gpl2+)))
+
+(define-public emulation-station
+  (package
+(name "emulation-station")
+(version "2.0.1")
+(source (origin
+  (method git-fetch) ; no tarball available
+  (uri (git-reference
+(url "https://github.com/Aloshi/EmulationStation.git;)
+(commit "646bede"))) ; no version tag
+  (sha256
+   (base32
+"0cm0sq2wri2l9cvab1l0g02za59q7klj0h3p028vr96n6njj4w9v"
+(build-system cmake-build-system)
+(arguments
+ '(#:tests? #f)) ; no tests
+(inputs
+ `(("alsa-lib" ,alsa-lib)
+   ("boost" ,boost)
+   ("curl" ,curl)
+   ("eigin" ,eigen)
+   ("freeimage" ,freeimage)
+   ("freetype" ,freetype)
+   ("mesa" ,mesa)
+   ("sdl2" ,sdl2)))
+(synopsis "Video game console emulator front-end")
+(description "EmulationStation provides a graphical front-end to a large
+number of video game console emulators.  It features an interface that is
+usable with any game controller that has at least 4 buttons, theming support,
+and a game metadata scraper.")
+(home-page "http://www.emulationstation.org;)
+(license license:expat)))
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[PATCHES] Add love and devil

2015-11-15 Thread David Thompson
Yes, these are real software packages!  LÖVE is a neat game framework
that uses Lua and depends on DevIL for image loading.

>From fa226c57a531436e387055440f71d04c1b73a7aa Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Sat, 14 Nov 2015 13:56:40 -0500
Subject: [PATCH 1/2] gnu: Add devil.

* gnu/packages/image.scm (devil): New variable.
* gnu/packages/patches/devil-fix-libpng.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am   |  1 +
 gnu/packages/image.scm  | 52 +
 gnu/packages/patches/devil-fix-libpng.patch | 36 
 3 files changed, 89 insertions(+)
 create mode 100644 gnu/packages/patches/devil-fix-libpng.patch

diff --git a/gnu-system.am b/gnu-system.am
index c80f086..ec9f778 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -432,6 +432,7 @@ dist_patch_DATA =		\
   gnu/packages/patches/cursynth-wave-rand.patch			\
   gnu/packages/patches/dbus-helper-search-path.patch		\
   gnu/packages/patches/dealii-p4est-interface.patch		\
+  gnu/packages/patches/devil-fix-libpng.patch			\
   gnu/packages/patches/diffutils-gets-undeclared.patch		\
   gnu/packages/patches/dfu-programmer-fix-libusb.patch		\
   gnu/packages/patches/doxygen-test.patch			\
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index bde327c..a564ada8 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -627,3 +627,55 @@ channels.")
 (description
  "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
 (license license:bsd-3)))
+
+(define-public devil
+  (package
+(name "devil")
+(version "1.7.8")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "http://downloads.sourceforge.net/openil/;
+  "DevIL-" version ".tar.gz"))
+  (sha256
+   (base32
+"1zd850nn7nvkkhasrv7kn17kzgslr5ry933v6db62s4lr0zzlbv8"))
+  ;; Backported from upstream:
+  ;; https://github.com/DentonW/DevIL/commit/724194d7a9a91221a564579f64bdd6f0abd64219.patch
+  (patches (list (search-patch "devil-fix-libpng.patch")))
+  (modules '((guix build utils)))
+  (snippet
+   ;; Fix old lcms include directives and lib flags.
+   '(substitute* '("configure" "src-IL/src/il_profiles.c")
+  (("-llcms") "-llcms2")
+  (("lcms/lcms\\.h") "lcms2/lcms2.h")
+  (("lcms\\.h") "lcms2.h")
+(build-system gnu-build-system)
+(arguments
+ '(#:configure-flags '("--enable-ILUT=yes") ; build utility library
+   #:phases
+   (modify-phases %standard-phases
+ (add-before 'check 'fix-tests
+   (lambda* (#:key inputs #:allow-other-keys)
+ ;; Fix hard-coded /bin/bash reference.
+ (substitute* '("test/Makefile")
+   (("TESTS_ENVIRONMENT = /bin/bash")
+(string-append "TESTS_ENVIRONMENT = "
+   (assoc-ref inputs "bash")
+   "/bin/bash")))
+ #t)
+(native-inputs
+ `(("pkg-config" ,pkg-config)))
+(inputs
+ `(("lcms" ,lcms)
+   ("libjpeg" ,libjpeg)
+   ("libmng" ,libmng)
+   ("libpng" ,libpng)
+   ("libtiff" ,libtiff)
+   ("openexr" ,openexr)
+   ("zlib" ,zlib)))
+(synopsis "Library for manipulating many image formats")
+(description "Developer's Image Library (DevIL) is a library to develop
+applications with support for many types of images.  DevIL can load, save,
+convert, manipulate, filter and display a wide variety of image formats.")
+(home-page "http://openil.sourceforge.net;)
+(license license:lgpl2.1+)))
diff --git a/gnu/packages/patches/devil-fix-libpng.patch b/gnu/packages/patches/devil-fix-libpng.patch
new file mode 100644
index 000..a8e9033
--- /dev/null
+++ b/gnu/packages/patches/devil-fix-libpng.patch
@@ -0,0 +1,36 @@
+From 724194d7a9a91221a564579f64bdd6f0abd64219 Mon Sep 17 00:00:00 2001
+From: Noah Mayr <max9...@gmail.com>
+Date: Sun, 1 Mar 2015 10:10:56 +0100
+Subject: [PATCH] Fixed deprecated libpng API usage.
+
+---
+ src-IL/src/il_icon.c | 2 +-
+ src-IL/src/il_png.c  | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src-IL/src/il_icon.c b/src-IL/src/il_icon.c
+index 2ccb1a3..fd9475d 100644
+--- a/src-IL/src/il_icon.c
 b/src-IL/src/il_icon.c
+@@ -525,7 +525,7 @@ ILboolean ico_readpng_get_image(ICOIMAGE *Icon, ILdouble display_exponent)
+
+ 	// Expand low-bit-

[PATCH] gnu: Add guile-sly.

2015-11-13 Thread David Thompson
>From 3b02add7830f8d1bcd8e0a7a693d4650635fb246 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Fri, 13 Nov 2015 18:07:21 -0500
Subject: [PATCH] gnu: Add guile-sly.

* gnu/packages/guile.scm (guile-sly): New variable.
---
 gnu/packages/guile.scm | 39 +++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 82776e6..8714332 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -41,6 +41,10 @@
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages gl)
+  #:use-module (gnu packages sdl)
+  #:use-module (gnu packages maths)
+  #:use-module (gnu packages image)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -802,4 +806,39 @@ whitespace-significant language.  It may be easier on the eyes for some
 users and in some situations.")
 (license gpl3+)))
 
+(define-public guile-sly
+  (package
+(name "guile-sly")
+(version "0.1")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "http://files.dthompson.us/sly/sly-;
+  version ".tar.gz"))
+  (sha256
+   (base32
+"1svzlbz2vripmyq2kjh0rig16bsrnbkwbsm558pjln9l65mcl4qq"
+(build-system gnu-build-system)
+(arguments
+ '(#:configure-flags
+   (list (string-append "--with-libfreeimage-prefix="
+(assoc-ref %build-inputs "freeimage"))
+ (string-append "--with-libgslcblas-prefix="
+(assoc-ref %build-inputs "gsl")
+(native-inputs
+ `(("pkg-config" ,pkg-config)))
+(propagated-inputs
+ `(("guile" ,guile-2.0)
+   ("guile-sdl" ,guile-sdl)
+   ("guile-opengl" ,guile-opengl)))
+(inputs
+ `(("gsl" ,gsl)
+   ("freeimage" ,freeimage)
+   ("mesa" ,mesa)))
+(synopsis "2D/3D game engine for GNU Guile")
+(description "Sly is a 2D/3D game engine written in Guile Scheme.  Sly
+features a functional reactive programming interface and live coding
+capabilities.")
+(home-page "http://dthompson.us/pages/software/sly.html;)
+(license gpl3+)))
+
 ;;; guile.scm ends here
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] tests: Skip 'guix environment --container' tests in some cases.

2015-11-03 Thread David Thompson
Hey Ludo,

Took a stab at fixing the guix-environment-container.sh tests when the
necessary features aren't available.  GuixSD systems don't have
/proc/sys/kernel/unprivileged_userns_clone so I couldn't verify that
code path works as intended.  All I can say is that the tests still pass
on my machine as they did before.

WDYT?  Did I make it in time for the release?

Thanks,

- Dave



[PATCH] scripts: environment: Ignore user shell when spawning container.

2015-11-01 Thread David Thompson
Cross this one off the TODO list, Ludo. ;)

>From 655edf899710544d681acacab93f4f671962fc49 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Sun, 1 Nov 2015 18:34:53 -0500
Subject: [PATCH] scripts: environment: Ignore user shell when spawning
 container.

* guix/scripts/environment.scm (%default-options): Remove 'exec'
  association.
  (guix-environment): If the user didn't specify a command, use the
  default shell, or use /bin/sh when a container is requested.
---
 guix/scripts/environment.scm | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index f9ab9a4..45b54a9 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -160,8 +160,7 @@ COMMAND or an interactive shell in that environment.\n"))
 
 (define %default-options
   ;; Default to opening a new shell.
-  `((exec . (,%default-shell))
-(system . ,(%current-system))
+  `((system . ,(%current-system))
 (substitutes? . #t)
 (max-silent-time . 3600)
 (verbosity . 0)))
@@ -447,7 +446,14 @@ Otherwise, return the derivation for the Bash package."
(network?   (assoc-ref opts 'network?))
(bootstrap? (assoc-ref opts 'bootstrap?))
(system (assoc-ref opts 'system))
-   (command(assoc-ref opts 'exec))
+   (command(or (assoc-ref opts 'exec)
+   ;; Spawn a shell if the user didn't specify
+   ;; anything in particular.
+   (if container?
+   ;; The user's shell is likely not available
+   ;; within the container.
+   '("/bin/sh")
+   (list %default-shell
(packages   (options/resolve-packages opts))
(mappings   (pick-all opts 'file-system-mapping))
(inputs (delete-duplicates
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] scripts: environment: Allow lists of packages in expressions.

2015-10-30 Thread David Thompson
Thanks to avoine on freenode for motivating me to finally add this
feature.  I've wanted it for awhile, but not badly enough to actually
implement it until now.  This is a cool feature because you can do stuff
like this now:

guix environment --ad-hoc -e '(@ (gnu) %base-packages)'

Pretty cool!

>From c9c282cea04ec5a3ee7bd17e6ad8846600220feb Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Fri, 30 Oct 2015 21:02:51 -0400
Subject: [PATCH] scripts: environment: Allow lists of packages in expressions.

* guix/scripts/environment.scm (options/resolve-packages): Match against
  lists of packages when evaluating expressions.
* tests/guix-environment.sh: Add test.
* doc/guix.texi ("invoking guix environment"): Add docs.
---
 doc/guix.texi| 15 ---
 guix/scripts/environment.scm | 24 +++-
 tests/guix-environment.sh| 11 +++
 3 files changed, 38 insertions(+), 12 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index a164608..84f194b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4730,7 +4730,8 @@ The available options are summarized below.
 @table @code
 @item --expression=@var{expr}
 @itemx -e @var{expr}
-Create an environment for the package that @var{expr} evaluates to.
+Create an environment for the package or list of packages that
+@var{expr} evaluates to.
 
 For example, running:
 
@@ -4741,10 +4742,18 @@ guix environment -e '(@@ (gnu packages maths) petsc-openmpi)'
 starts a shell with the environment for this specific variant of the
 PETSc package.
 
+Running:
+
+@example
+guix environment --ad-hoc -e '(@ (gnu) %base-packages)'
+@end example
+
+starts a shell with all the GuixSD base packages available.
+
 @item --load=@var{file}
 @itemx -l @var{file}
-Create an environment for the package that the code within @var{file}
-evaluates to.
+Create an environment for the package or list of packages that the code
+within @var{file} evaluates to.
 
 As an example, @var{file} might contain a definition like this
 (@pxref{Defining Packages}):
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 1888385..f9ab9a4 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -253,6 +253,18 @@ COMMAND or an interactive shell in that environment.\n"))
 (define (options/resolve-packages opts)
   "Return OPTS with package specification strings replaced by actual
 packages."
+  (define (package->outputs package mode)
+(map (lambda (output)
+   (list mode package output))
+ (package-outputs package)))
+
+  (define (packages->outputs packages mode)
+(match packages
+  ((? package? package)
+   (package->outputs package mode))
+  (((? package? packages) ...)
+   (append-map (cut package->outputs <> mode) packages
+
   (compact
(append-map (match-lambda
  (('package mode (? string? spec))
@@ -261,17 +273,11 @@ packages."
 (list (list mode package output
  (('expression mode str)
   ;; Add all the outputs of the package STR evaluates to.
-  (match (read/eval str)
-((? package? package)
- (map (lambda (output)
-(list mode package output))
-  (package-outputs package)
+  (packages->outputs (read/eval str) mode))
  (('load mode file)
   ;; Add all the outputs of the package defined in FILE.
-  (let ((package (load* file (make-user-module '()
-(map (lambda (output)
-   (list mode package output))
- (package-outputs package
+  (let ((module (make-user-module '(
+(packages->outputs (load* file module) mode)))
  (_ '(#f)))
opts)))
 
diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh
index 49b3b1c..f7b0259 100644
--- a/tests/guix-environment.sh
+++ b/tests/guix-environment.sh
@@ -111,4 +111,15 @@ then
 grep -E '^export CPATH=.*-gcc-bootstrap-0/include'  "$tmpdir/a"
 grep -E '^export CPATH=.*-glibc-bootstrap-0/include'"$tmpdir/a"
 grep -E '^export LIBRARY_PATH=.*-glibc-bootstrap-0/lib' "$tmpdir/a"
+
+# Make sure a package list can be used with -e.
+expr_list_test_code="
+(list (@@ (gnu packages commencement) gnu-make-boot0)
+  (@ (gnu packages bootstrap) %bootstrap-guile))"
+
+guix environment --ad-hoc --no-substitutes --search-paths --pure \
+ -e "$expr_list_test_code" > "$tmpdir/a"
+
+grep -E '^export PATH=.*-make-boot0-4.1/bin'  "$tmpdir/a"
+grep -E '^export PATH=.*-guile-bootstrap-2.0/bin' "$tmpdir/a"
 fi
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] system: container: Update to new service API.

2015-10-26 Thread David Thompson
Getting up to speed with the changes that were made during the service
API rewrite.

>From d3dd1b2d05f17702f7fa6095132db00e2146e702 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Mon, 26 Oct 2015 18:09:28 -0400
Subject: [PATCH] scripts: build: Add --file option.

* guix/scripts/build.scm (show-help): Add help text for --file option.
  (%options): Add --file option.
  (options/resolve-packages): Handle 'file' options.
* tests/guix-build.sh: Add tests.
* doc/guix.texi ("invoking guix build"): Add doc.
---
 doc/guix.texi  | 13 +
 guix/scripts/build.scm | 45 -
 tests/guix-build.sh| 27 +++
 3 files changed, 68 insertions(+), 17 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 7715b72..abd8de3 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3615,6 +3615,19 @@ The @var{options} may be zero or more of the following:
 
 @table @code
 
+@item --file=@var{file}
+@itemx -e @var{file}
+
+Build the package or derivation that the code within @var{file}
+evaluates to.
+
+As an example, @var{file} might contain a package definition like this
+(@pxref{Defining Packages}):
+
+@example
+@verbatiminclude package-hello.scm
+@end example
+
 @item --expression=@var{expr}
 @itemx -e @var{expr}
 Build the package or derivation @var{expr} evaluates to.
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index a357cf8..ee7e5b9 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -290,6 +290,9 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n"))
   (display (_ "
   -e, --expression=EXPR  build the package or derivation EXPR evaluates to"))
   (display (_ "
+  -f, --file=FILEbuild the package or derivation that the code within
+ FILE evaluates to"))
+  (display (_ "
   -S, --source   build the packages' source derivations"))
   (display (_ "
   --sources[=TYPE]   build source derivations; TYPE may optionally be one
@@ -359,6 +362,9 @@ must be one of 'package', 'all', or 'transitive'~%")
  (option '(#\e "expression") #t #f
  (lambda (opt name arg result)
(alist-cons 'expression arg result)))
+ (option '(#\f "file") #t #f
+ (lambda (opt name arg result)
+   (alist-cons 'file arg result)))
  (option '(#\n "dry-run") #f #f
  (lambda (opt name arg result)
(alist-cons 'dry-run? #t result)))
@@ -422,29 +428,34 @@ packages."
   (define system
 (or (assoc-ref opts 'system) (%current-system)))
 
+  (define (object->argument obj)
+(match obj
+  ((? package? p)
+   `(argument . ,p))
+  ((? procedure? proc)
+   (let ((drv (run-with-store store
+(mbegin %store-monad
+  (set-guile-for-build (default-guile))
+  (proc))
+#:system system)))
+ `(argument . ,drv)))
+  ((? gexp? gexp)
+   (let ((drv (run-with-store store
+(mbegin %store-monad
+  (set-guile-for-build (default-guile))
+  (gexp->derivation "gexp" gexp
+#:system system)
+ `(argument . ,drv)
+
   (map (match-lambda
 (('argument . (? string? spec))
  (if (store-path? spec)
  `(argument . ,spec)
  `(argument . ,(specification->package spec
+(('file . file)
+ (object->argument (load* file (make-user-module '()
 (('expression . str)
- (match (read/eval str)
-   ((? package? p)
-`(argument . ,p))
-   ((? procedure? proc)
-(let ((drv (run-with-store store
- (mbegin %store-monad
-   (set-guile-for-build (default-guile))
-   (proc))
- #:system system)))
-  `(argument . ,drv)))
-   ((? gexp? gexp)
-(let ((drv (run-with-store store
- (mbegin %store-monad
-   (set-guile-for-build (default-guile))
-   (gexp->derivation "gexp" gexp
- #:system system)
-  `(argument . ,drv)
+ (object->argument (read/eval str)))
 (opt opt))
opts))
 
diff --git a/tests/guix-build.sh b/tests/guix-build.sh
index a72ce09..f7fb3c5 100644
--- a/tests/guix-build.sh
+++ b/tests/guix-build.sh
@@ -167,6 +167,33 @@ guix build -e "(begin
 guix build -e '#~(mkdir #$output)' -d
 guix build -e '#~(mkdir #$output)' -d | grep 'gexp\.drv'
 
+# Building from a package file.
+cat > "$module_dir/package.scm&quo

[PATCH] scripts: environment: Allow mixing regular and ad-hoc packages.

2015-10-25 Thread David Thompson
Thanks to Leo for bringing up this missing feature on IRC.  I've been
meaning to implement this for awhile but lacked motivation. ;)

With this patch, you can freely compose packages whose inputs should be
in the environment with ad-hoc packages that should be added to the
environment directly.  For example, here's how to create a Guix
development environment that additionally has strace:

guix environment guix --ad-hoc strace

The --load and --expression options are --ad-hoc aware as well.  Yay,
composability!

>From 6a1c0b03a0083cc521be5c28a438ed5ecafd2b9d Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Sun, 25 Oct 2015 22:33:33 -0400
Subject: [PATCH] scripts: environment: Allow mixing regular and ad-hoc
 packages.

This patch changes the --ad-hoc flag to be positional.  That is, the
packages that appear before --ad-hoc are interpreted as packages whose
inputs should be in the environment; the packages that appear after are
interpreted as packages to be directly added to the environment.

* guix/scripts/environment.scm (tag-package-arg, compact): New
  procedures.
  (%options): Tweak the handlers for --load and --expression options.
  (options/resolve-packages): Preserve package mode tag.
  (parse-args): Tweak argument handler to use package tagging procedure.
  (guix-environment): Apply ad-hoc behavior on a per package basis.
* doc/guix.texi ("invoking guix environment"): Document new behavior of
  --ad-hoc.
---
 doc/guix.texi| 20 +++
 guix/scripts/environment.scm | 85 ++--
 2 files changed, 71 insertions(+), 34 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 7715b72..dfd377c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4681,6 +4681,20 @@ NumPy:
 guix environment --ad-hoc python2-numpy python-2.7 -- python
 @end example
 
+Furthermore, one might want the dependencies of a package and also some
+additional packages that are not build-time or runtime dependencies, but
+are useful when developing nonetheless.  Because of this, the
+@code{--ad-hoc} flag is positional.  Packages appearing before
+@code{--ad-hoc} are interpreted as packages whose dependencies will be
+added to the environment.  Packages appearing after are interpreted as
+packages that will be added to the environment directly.  For example,
+the following command creates a Guix development environment that
+additionally includes Git and strace:
+
+@example
+guix environment guix --ad-hoc git strace
+@end example
+
 Sometimes it is desirable to isolate the environment as much as
 possible, for maximal purity and reproducibility.  In particular, when
 using Guix on a host distro that is not GuixSD, it is desirable to
@@ -4741,6 +4755,12 @@ Note that this example implicitly asks for the default output of
 specific output---e.g., @code{glib:bin} asks for the @code{bin} output
 of @code{glib} (@pxref{Packages with Multiple Outputs}).
 
+This option may be composed with the default behavior of @command{guix
+environment}.  Packages appearing before @code{--ad-hoc} are interpreted
+as packages whose dependencies will be added to the environment, the
+default behavior.  Packages appearing after are interpreted as packages
+that will be added to the environment directly.
+
 @item --pure
 Unset existing environment variables when building the new environment.
 This has the effect of creating an environment in which search paths
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 1d21a76..1888385 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -166,6 +166,16 @@ COMMAND or an interactive shell in that environment.\n"))
 (max-silent-time . 3600)
 (verbosity . 0)))
 
+(define (tag-package-arg opts arg)
+  "Return a two-element list with the form (TAG ARG) that tags ARG with either
+'ad-hoc' in OPTS has the 'ad-hoc?' key set to #t, or 'inputs' otherwise."
+  ;; Normally, the transitive inputs to a package are added to an environment,
+  ;; but the ad-hoc? flag changes the meaning of a package argument such that
+  ;; the package itself is added to the environment instead.
+  (if (assoc-ref opts 'ad-hoc?)
+  `(ad-hoc-package ,arg)
+  `(package ,arg)))
+
 (define %options
   ;; Specification of the command-line options.
   (cons* (option '(#\h "help") #f #f
@@ -186,10 +196,14 @@ COMMAND or an interactive shell in that environment.\n"))
(alist-cons 'search-paths #t result)))
  (option '(#\l "load") #t #f
  (lambda (opt name arg result)
-   (alist-cons 'load arg result)))
+   (alist-cons 'load
+   (tag-package-arg result arg)
+   result)))
  (option '(#\e "expression") #t #f
  (lambda (opt name arg result)
-   (alist-cons 

Giving up on RubyGems

2015-10-20 Thread David Thompson
Hello Guix hackers,

As some of you know, I've been working on Ruby support for Guix for
about a year now.  In that time, I helped write and rewrite a Ruby gem
build system, wrote an importer for <https://rubygems.org>, and packaged
many Ruby gems.

At various points, I've had my doubts about the gem archives hosted on
the RubyGems website: Are they source code?  Are they binaries?  After a
good deal of debate, we came to the conclusion that they are source
code.  This seems to be the case when you inspect any given gem.  The
Ruby source code is there, and so is the C source code needed for native
extensions when there is a native extension to be built.  Furthermore,
the RubyGems website says that, among other things, gems should contain
"code (including tests and supporting utilities)." [0]

However, it has become clear that the RubyGems maintainers do not
actually feel this way.  From their perspective, gems are binaries, not
source code.  I discovered this once I noticed that several popular Ruby
gems such as Arel do not, and refuse to [1], ship the test suite in
their releases.  This is because they view gems as binaries that need to
be as slim as possible, containing only necessary runtime files, to cut
down on bandwidth usage and storage space.  Unfortunately, they have no
notion of a source package that corresponds to a given binary.

In practice, I've found that all the gems I've packaged come with source
code and no binaries, they might just be missing the test suite.  So, I
asked the RubyGems maintainers to consider the use-cases for including
test suites, which spawned a large thread on their GitHub page
yesterday. [2]  The end result is this depressing quote:

Yes, gems are effectively binary packages delivered to
end-users. Some gems contain ruby source code, some contain
pre-compiled binaries, some contain both. The internals of a
particular gem aren't relevant from the perspective of RubyGems
itself.

As has been pointed out here, RubyGems does not provide packages
containing gem source code. To be honest, RubyGems as a system does
not care about gem source code—it accepts .gem files from gem
authors, and distributes those files on request. Any gem author who
wishes to provide a link to the source code used to produce a gem is
welcome to use the gemspec metadata fields to do so.

I've grown very tired of trying to convince people that independent user
verification of binary releases is an important thing to prioritize, but
they think that users do not want the source code.  I've tried to make
my arguments as clear as I could, yet they've been misunderstood by some
and rejected entirely by others, and now it is time to give up.  I don't
know what the best way forward for Ruby support in Guix is.  Things like
the RubyGems importer seem useless now.  Just downloading release
tarballs from GitHub doesn't work without major hacks because almost
every gem (thanks to a terrible script in Bundler that generates
boilerplate for new gems) relies on running 'git ls-files', which of
course requires a Git commit database, in order to build at all.  This
won't do because the '.git' directory is non-deterministic when running
'git clone', as many of us know.  The entire stack, from the build
system to the package management system are broken and are effectively
beyond repair because no one else believes that there are problems.
This effort has drained too much of my enthusiasm, and now I need a
break.

Sorry if this comes across too ranty and complainy, I suppose it is
both.  I hope your hacking is happier than mine.

-- 
David Thompson
GPG Key: 0FF1D807

[0] http://guides.rubygems.org/what-is-a-gem/
[1] https://github.com/rails/arel/issues/384
[2] https://github.com/rubygems/rubygems/issues/1364




Using 'system*' instead of 'system' in 'guix environment'

2015-10-07 Thread David Thompson
Hello Guix hackers,

In an effort to finish up a patch to add a --container flag to 'guix
environment', I've encountered a serious problem.  The --exec flag
allows the user to pass an arbitrary command to be run using 'system'.
Unlike 'system*', 'system' spawns a command interpreter first and passes
the command string in.  This is very problematic when using a container,
because there's a very good chance that the command interpreter of the
running Guile process is not mounted inside the container.

So, I think we should switch to using 'system*' instead which will avoid
this hairy issue.  However, it's unclear to me how to make this happen.
I wanted to use 'system*' since I first wrote 'guix environment', but I
couldn't figure out how to make the command line syntax work since each
argument needs to be processed separately instead of being bunched up
into a string.

If the above explanation is confusing, the 'sudo' program provides a
good example of the UI I'm after:

sudo guile -c '(do-root-things)'

But for now we're stuck with this:

guix environment --ad-hoc guile -E "guile -c '(do-root-things)'"

Now, we can't actually do exactly what 'sudo' does because 'guix
environment' already recognizes operands as package names, not program
arguments.  Perhaps we can use '--' to separate the package list from
the command to run:

guix environment --ad-hoc guile -- guile -c '(do-root-things)'

Does that look okay?  Any other ideas?

Thanks,

- Dave



[PATCH] gnu: Add shroud.

2015-09-30 Thread David Thompson
A straightforward package for my password management tool.

>From afb5b4ab656ef282cb01892297b99ae17581f1de Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Tue, 29 Sep 2015 12:23:52 -0400
Subject: [PATCH] gnu: Add shroud.

* gnu/packages/password-utils.scm (shroud): New variable.
---
 gnu/packages/password-utils.scm | 28 
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 8619f14..ff39e92 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -25,7 +25,9 @@
   #:use-module (guix packages)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages guile)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg))
 
 (define-public pwgen
@@ -76,3 +78,29 @@ on an external storage device.  The databases are encrypted using the
 algorithms AES or Twofish.")
 ;; Non functional parts use various licences.
 (license license:gpl3)))
+
+(define-public shroud
+  (package
+(name "shroud")
+(version "0.1")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "http://files.dthompson.us/shroud/shroud-;
+  version ".tar.gz"))
+  (sha256
+   (base32
+"0jrahwwlrfn1q2bxl99dv9jcvklf8lkm4dq33iv5h75vxw4l56fw"
+(build-system gnu-build-system)
+(inputs
+ `(("guile" ,guile-2.0)
+   ("gnupg" ,gnupg)
+   ("xclip" ,xclip)))
+(synopsis "GnuPG-based secret manager")
+(description "Shroud is a simple secret manager with a command line
+interface.  The password database is stored as a Scheme s-expression and
+encrypted with a GnuPG key.  Secrets consist of an arbitrary number of
+key/value pairs, making Shroud suitable for more than just password storage.
+For copying and pasting secrets into web browsers and other graphical
+applications, there is xclip integration." )
+    (home-page "http://dthompson.us/pages/software/shroud.html;)
+(license license:gpl3+)))
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] gnu: Add file-roller.

2015-09-19 Thread David Thompson
Been missing this program for awhile, so here it is!

>From 241f44af6ba5229c6fdeda0fadd50345f4abaf60 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Sat, 19 Sep 2015 19:20:52 -0400
Subject: [PATCH] gnu: Add file-roller.

* gnu/packages/gnome.scm (file-roller): New variable.
---
 gnu/packages/gnome.scm | 34 ++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index ca75fa8..43c918a 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2015 David Hashe <david.ha...@dhashe.com>
 ;;; Copyright © 2015 Ricardo Wurmus <rek...@elephly.net>
 ;;; Copyright © 2015 Mark H Weaver <m...@netris.org>
+;;; Copyright © 2015 David Thompson <da...@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3500,3 +3501,36 @@ manage, and publish documentation for Yelp and the web.  Most of the heavy
 lifting is done by packages like yelp-xsl and itstool.  This package just
 wraps things up in a developer-friendly way.")
 (license license:gpl2+)))
+
+(define-public file-roller
+  (package
+(name "file-roller")
+(version "3.10.0")
+(source (origin
+  (method url-fetch)
+  (uri (string-append "mirror://gnome/sources/" name "/"
+  (version-major+minor version) "/"
+  name "-" version ".tar.xz"))
+  (sha256
+   (base32
+"04sg4yzz4c3hzgxhbgx2dc36lq5hjrnrmal2q0amfvhl0jcvp2fq"
+(build-system glib-or-gtk-build-system)
+(native-inputs
+ `(("intltool" ,intltool)
+   ("pkg-config" ,pkg-config)))
+;; TODO: Add libnautilus.
+(inputs
+ `(("gtk+" ,gtk+)
+   ("gdk-pixbuf" ,gdk-pixbuf)
+   ("json-glib" ,json-glib)
+   ("libarchive" ,libarchive)
+   ("libnotify" ,libnotify)
+   ("nettle" ,nettle)))
+(propagated-inputs
+ `(("itstool" ,itstool)
+   ("xmllint" ,libxml2)))
+(synopsis "Graphical archive manager for GNOME")
+(description "File Roller is an archive manager for the GNOME desktop
+environment.")
+(home-page "http://fileroller.sourceforge.net/;)
+(license license:gpl2+)))
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] gnu: avahi: Enable libdns_sd compatibility.

2015-09-19 Thread David Thompson
Hey folks,

I was trying to package the Mumble VOIP program and ran into an issue
with Avahi.  Mumble requires that Avahi be compiled with libdns_sd
compatibility.  The patch is very simple, but entails rebuilding some
300 packages, notably the massive Qt beast.  Would this patch have to
wait for the next core-updates?

>From 56ba8b433783ca847fbd433114afe6374289cddc Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Sat, 19 Sep 2015 11:36:45 -0400
Subject: [PATCH] gnu: avahi: Enable libdns_sd compatibility.

* gnu/packages/avahi.scm (avahi): Add '--enable-compat-libdns_sd' configure
  flag.
---
 gnu/packages/avahi.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/avahi.scm b/gnu/packages/avahi.scm
index 517df32..b6eef1a 100644
--- a/gnu/packages/avahi.scm
+++ b/gnu/packages/avahi.scm
@@ -52,7 +52,8 @@
"--disable-xmltoman"
"--enable-tests"
"--disable-qt3" "--disable-qt4"
-   "--disable-gtk" "--disable-gtk3")))
+   "--disable-gtk" "--disable-gtk3"
+   "--enable-compat-libdns_sd")))
 (inputs
  `(("expat" ,expat)
("glib" ,glib)
-- 
2.5.0


Thanks,

-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] build: ruby: Add support for tarball and directory sources.

2015-09-07 Thread David Thompson
>From 612a4a692375f241934de03d24064dbef1c7294c Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Mon, 7 Sep 2015 22:58:05 -0400
Subject: [PATCH] build: ruby: Add support for tarball and directory sources.

Previously, the Ruby build system only knew how to work with gem archives,
which made it difficult to build unreleased gems from a Git repository or
released gems in tarball form.

* gnu/build/ruby-build-system.scm (gnu:unpack, gem-archive?): New procedures.
  (unpack): Use GNU build system unpack phase for non-gem sources.
  (build): Rebuild the gemspec iff the source is a gem archive.
---
 guix/build/ruby-build-system.scm | 86 ++--
 1 file changed, 48 insertions(+), 38 deletions(-)

diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm
index 4184ccc..2685da1 100644
--- a/guix/build/ruby-build-system.scm
+++ b/guix/build/ruby-build-system.scm
@@ -41,53 +41,63 @@ directory."
 ((file-name . _) file-name)
 (() (error "No files matching pattern: " pattern
 
+(define gnu:unpack (assq-ref gnu:%standard-phases 'unpack))
+
+(define (gem-archive? file-name)
+  (string-match "^.*\\.gem$" file-name))
+
 (define* (unpack #:key source #:allow-other-keys)
   "Unpack the gem SOURCE and enter the resulting directory."
-  (and (zero? (system* "gem" "unpack" source))
-   ;; The unpacked gem directory is named the same as the archive, sans
-   ;; the ".gem" extension.  It is renamed to simply "gem" in an effort to
-   ;; keep file names shorter to avoid UNIX-domain socket file names and
-   ;; shebangs that exceed the system's fixed maximum length when running
-   ;; test suites.
-   (let ((dir (match:substring (string-match "^(.*)\\.gem$"
- (basename source))
-   1)))
- (rename-file dir "gem")
- (chdir "gem")
- #t)))
+  (if (gem-archive? source)
+  (and (zero? (system* "gem" "unpack" source))
+   ;; The unpacked gem directory is named the same as the archive,
+   ;; sans the ".gem" extension.  It is renamed to simply "gem" in an
+   ;; effort to keep file names shorter to avoid UNIX-domain socket
+   ;; file names and shebangs that exceed the system's fixed maximum
+   ;; length when running test suites.
+   (let ((dir (match:substring (string-match "^(.*)\\.gem$"
+ (basename source))
+   1)))
+ (rename-file dir "gem")
+ (chdir "gem")
+ #t))
+  ;; Use GNU unpack strategy for things that aren't gem archives.
+  (gnu:unpack #:source source)))
 
 (define* (build #:key source #:allow-other-keys)
   "Build a new gem using the gemspec from the SOURCE gem."
+  (define (first-gemspec)
+(first-matching-file "\\.gemspec$"))
 
   ;; Remove the original gemspec, if present, and replace it with a new one.
   ;; This avoids issues with upstream gemspecs requiring tools such as git to
   ;; generate the files list.
-  (let ((gemspec (or (false-if-exception
-  (first-matching-file "\\.gemspec$"))
- ;; Make new gemspec if one wasn't shipped.
- ".gemspec")))
-
-(when (file-exists? gemspec) (delete-file gemspec))
-
-;; Extract gemspec from source gem.
-(let ((pipe (open-pipe* OPEN_READ "gem" "spec" "--ruby" source)))
-  (dynamic-wind
-(const #t)
-(lambda ()
-  (call-with-output-file gemspec
-(lambda (out)
-  ;; 'gem spec' writes to stdout, but 'gem build' only reads
-  ;; gemspecs from a file, so we redirect the output to a file.
-  (while (not (eof-object? (peek-char pipe)))
-(write-char (read-char pipe) out
-  #t)
-(lambda ()
-  (close-pipe pipe
-
-;; Build a new gem from the current working directory.  This also allows any
-;; dynamic patching done in previous phases to be present in the installed
-;; gem.
-(zero? (system* "gem" "build" gemspec
+  (when (gem-archive? source)
+(let ((gemspec (or (false-if-exception (first-gemspec))
+   ;; Make new gemspec if one wasn't shipped.
+   ".gemspec")))
+
+  (when (file-exists? gemspec) (delete-file gemspec))
+
+  ;; Extract gemspec from source gem.
+  (let ((pipe (open-pipe* OPEN_READ "gem" "spec" "--ruby" source)))
+(dynamic-wind
+  (const #t)
+  (lambda ()
+(call-wi

[PATCH] build: container: Use the same clone flags as fork(3).

2015-09-05 Thread David Thompson
This patch resolves an issue I was having when working with containers
at the REPL, which means it probably presented undetected issues
elsewhere.

>From 61ebbe55f7f6d4d4eb42db957d6fc7b4eaf282a6 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Sat, 5 Sep 2015 14:10:08 -0400
Subject: [PATCH] build: container: Use the same clone flags as fork(3).

The intent is to make 'clone' behave a lot more like 'primitive-fork', which
calls clone(2) with SIGCHLD, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTID
flags.  Notably, running 'clone' at the REPL without these flags would break
the REPL beyond repair.

* guix/build/syscalls.scm (CLONE_CHILD_CLEARTID, CLONE_CHILD_SETTID): New
  variables.
* gnu/build/linux-container.scm (namespaces->bit-mask): Add
  CLONE_CHILD_CLEARTID and CLONE_CHILD_SETTID to bit mask.
---
 gnu/build/linux-container.scm |  3 ++-
 guix/build/syscalls.scm   | 16 ++--
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/gnu/build/linux-container.scm b/gnu/build/linux-container.scm
index 4262748..80a8d94 100644
--- a/gnu/build/linux-container.scm
+++ b/gnu/build/linux-container.scm
@@ -162,7 +162,8 @@ host user identifiers to map into the user namespace."
 (define (namespaces->bit-mask namespaces)
   "Return the number suitable for the 'flags' argument of 'clone' that
 corresponds to the symbols in NAMESPACES."
-  (apply logior SIGCHLD
+  ;; Use the same flags as fork(3) in addition to the namespace flags.
+  (apply logior SIGCHLD CLONE_CHILD_CLEARTID CLONE_CHILD_SETTID
  (map (match-lambda
('mnt  CLONE_NEWNS)
('uts  CLONE_NEWUTS)
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 093eb0a..2c2fbde 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -50,6 +50,8 @@
 mkdtemp!
 pivot-root
 
+CLONE_CHILD_CLEARTID
+CLONE_CHILD_SETTID
 CLONE_NEWNS
 CLONE_NEWUTS
 CLONE_NEWIPC
@@ -303,12 +305,14 @@ string TMPL and return its file name.  TMPL must end with 'XX'."
 (pointer->string result)
 
 ;; Linux clone flags, from linux/sched.h
-(define CLONE_NEWNS   #x0002)
-(define CLONE_NEWUTS  #x0400)
-(define CLONE_NEWIPC  #x0800)
-(define CLONE_NEWUSER #x1000)
-(define CLONE_NEWPID  #x2000)
-(define CLONE_NEWNET  #x4000)
+(define CLONE_CHILD_CLEARTID #x0020)
+(define CLONE_CHILD_SETTID   #x0100)
+(define CLONE_NEWNS  #x0002)
+(define CLONE_NEWUTS #x0400)
+(define CLONE_NEWIPC #x0800)
+(define CLONE_NEWUSER#x1000)
+(define CLONE_NEWPID #x2000)
+(define CLONE_NEWNET #x4000)
 
 ;; The libc interface to sys_clone is not useful for Scheme programs, so the
 ;; low-level system call is wrapped instead.
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] gnu: Add ruby-ox.

2015-09-04 Thread David Thompson
>From 4cff199e5ba8b2520dbd035c19aba0ba940d7083 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Fri, 4 Sep 2015 15:01:11 -0400
Subject: [PATCH] gnu: Add ruby-ox.

* gnu/packages/ruby.scm (ruby-ox): New variable.
---
 gnu/packages/ruby.scm | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index a01a698..c860233 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -1026,3 +1026,26 @@ core extensions extracted from the Rails framework.  It includes support for
 multibyte strings, internationalization, time zones, and testing.")
 (home-page "http://www.rubyonrails.org;)
 (license license:expat)))
+
+(define-public ruby-ox
+  (package
+(name "ruby-ox")
+(version "2.2.1")
+(source
+ (origin
+   (method url-fetch)
+   (uri (rubygems-uri "ox" version))
+   (sha256
+(base32
+ "00i11xd4ayh7349rhgskajfxn0qzkb74ab01217zix9qcapssxax"
+(build-system ruby-build-system)
+(arguments
+ '(#:tests? #f)) ; no tests
+(synopsis "Optimized XML library for Ruby")
+(description
+ "Optimized XML (Ox) is a fast XML parser and object serializer for Ruby
+written as a native C extension.  It was designed to be an alternative to
+Nokogiri and other Ruby XML parsers for generic XML parsing and as an
+alternative to Marshal for Object serialization. ")
+(home-page "http://www.ohler.com/ox;)
+(license license:expat)))
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] gnu: Add ruby-rack.

2015-09-04 Thread David Thompson
>From a740a5ca98c02bd0e9c792677dfc8ff8464c8365 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Fri, 4 Sep 2015 16:47:52 -0400
Subject: [PATCH] gnu: Add ruby-rack.

* gnu/packages/ruby.scm (ruby-rack): New variable.
---
 gnu/packages/ruby.scm | 37 +
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 9bfa14c..906b6eb 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -1072,3 +1072,40 @@ build on.  It provides breakpoint handling and bindings for stack frames among
 other things and it comes with a command line interface.")
 (home-page "http://github.com/deivid-rodriguez/byebug;)
 (license license:bsd-3)))
+
+(define-public ruby-rack
+  (package
+(name "ruby-rack")
+(version "1.6.4")
+(source
+ (origin
+   (method url-fetch)
+   (uri (rubygems-uri "rack" version))
+   (sha256
+(base32
+ "09bs295yq6csjnkzj7ncj50i6chfxrhmzg1pk6p0vd2lb9ac8pj5"
+(build-system ruby-build-system)
+(arguments
+ '(#:phases
+   (modify-phases %standard-phases
+ (add-before 'check 'fix-tests
+   (lambda _
+ ;; A few of the tests use the length of a file on disk for
+ ;; Content-Length and Content-Range headers.  However, this file
+ ;; has a shebang in it which an earlier phase patches, growing
+ ;; the file size from 193 to 239 bytes.
+ (substitute* '("test/spec_file.rb")
+   (("193") "239")
+   ;; Adjust by 46 bytes to accomodate patched shebang.
+   (("bytes(.)22-33" all delimiter)
+(string-append "bytes" delimiter "68-79")))
+ #t)
+(native-inputs
+ `(("ruby-bacon" ,ruby-bacon)))
+(synopsis "Unified web application interface for Ruby")
+(description "Rack provides a minimal, modular and adaptable interface for
+developing web applications in Ruby.  By wrapping HTTP requests and responses,
+it unifies the API for web servers, web frameworks, and software in between
+into a single method call.")
+(home-page "http://rack.github.io/;)
+(license license:expat)))
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] gnu: Add ruby-byebug.

2015-09-04 Thread David Thompson
>From a0a69a802b1d26bf91a663c0d5a0afde510ce5f0 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Fri, 4 Sep 2015 15:09:30 -0400
Subject: [PATCH] gnu: Add ruby-byebug.

* gnu/packages/ruby.scm (ruby-byebug): New variable.
---
 gnu/packages/ruby.scm | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index c860233..9bfa14c 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -1049,3 +1049,26 @@ Nokogiri and other Ruby XML parsers for generic XML parsing and as an
 alternative to Marshal for Object serialization. ")
 (home-page "http://www.ohler.com/ox;)
 (license license:expat)))
+
+(define-public ruby-byebug
+  (package
+(name "ruby-byebug")
+(version "6.0.2")
+(source
+ (origin
+   (method url-fetch)
+   (uri (rubygems-uri "byebug" version))
+   (sha256
+(base32
+ "0537h9qbhr6csahmzyn4lk1g5b2lcligbzd21gfy93nx9lbfdnzc"
+(build-system ruby-build-system)
+(arguments
+ '(#:tests? #f)) ; no tests
+(synopsis "Debugger for Ruby 2")
+(description "Byebug is a Ruby 2 debugger implemented using the Ruby 2
+TracePoint C API for execution control and the Debug Inspector C API for call
+stack navigation.  The core component provides support that front-ends can
+build on.  It provides breakpoint handling and bindings for stack frames among
+other things and it comes with a command line interface.")
+(home-page "http://github.com/deivid-rodriguez/byebug;)
+(license license:bsd-3)))
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] build: container: Setup /dev/console.

2015-09-04 Thread David Thompson
A step towards making containers behave better WRT terminals.

>From dc797eb8e306655b10bd466d64ef5deaf428259f Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Sat, 1 Aug 2015 13:54:40 -0400
Subject: [PATCH] build: container: Setup /dev/console.

* gnu/build/linux-container.scm (mount-file-systems): Bind mount the
  controlling terminal as /dev/console.
---
 gnu/build/linux-container.scm | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/gnu/build/linux-container.scm b/gnu/build/linux-container.scm
index af59904..4262748 100644
--- a/gnu/build/linux-container.scm
+++ b/gnu/build/linux-container.scm
@@ -55,6 +55,9 @@ to ROOT, then make ROOT the new root directory for the process."
   (define (scope dir)
 (string-append root dir))
 
+  (define (touch file-name)
+(call-with-output-file file-name (const #t)))
+
   (define (bind-mount src dest)
 (mount src dest "none" MS_BIND))
 
@@ -89,8 +92,7 @@ to ROOT, then make ROOT the new root directory for the process."
   (for-each (lambda (device)
   (when (file-exists? device)
 ;; Create the mount point file.
-(call-with-output-file (scope device)
-  (const #t))
+(touch (scope device))
 (bind-mount device (scope device
 '("/dev/null"
   "/dev/zero"
@@ -101,6 +103,15 @@ to ROOT, then make ROOT the new root directory for the process."
   "/dev/ptmx"
   "/dev/fuse"))
 
+  ;; Setup the container's /dev/console by bind mounting the psuedo-terminal
+  ;; associated with standard input.
+  (let ((in  (current-input-port))
+(console (scope "/dev/console")))
+(when (isatty? in)
+  (touch console)
+  (chmod console #o600)
+  (bind-mount (ttyname in) console)))
+
   ;; Setup standard input/output/error.
   (symlink "/proc/self/fd"   (scope "/dev/fd"))
   (symlink "/proc/self/fd/0" (scope "/dev/stdin"))
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[DMD] [PATCH] service: Export provided-by procedure.

2015-09-03 Thread David Thompson
>From 1d1ffe513750d040ddde68c1baa0a5c59fb6b679 Mon Sep 17 00:00:00 2001
From: David Thompson <dthomps...@worcester.edu>
Date: Thu, 3 Sep 2015 22:46:57 -0400
Subject: [PATCH] service: Export provided-by procedure.

* modules/dmd/service.scm: Export provided-by.
---
 modules/dmd/service.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/dmd/service.scm b/modules/dmd/service.scm
index 67156dd..aece069 100644
--- a/modules/dmd/service.scm
+++ b/modules/dmd/service.scm
@@ -56,6 +56,7 @@
 lookup-services
 respawn-service
 register-services
+provided-by
 required-by
 handle-unknown
 make-forkexec-constructor
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


Ruby on Guix

2015-08-30 Thread David Thompson
Hey fellow Guix hackers,

I just published a blog post about Guix targetting Ruby programmers,
detailing the ways in which Guix can replace the not-so-good RVM and
Bundler tools.  I know there's a few Rubyists lurking in here, so,
enjoy!

http://dthompson.us/ruby-on-guix.html

-- 
David Thompson
GPG Key: 0FF1D807



[PATCHES] Add ruby-activesupport

2015-08-30 Thread David Thompson
Patches for ActiveSupport, the first big component of Rails, and the
missing prerequisites.

From b92da5830285a9daaba772390472b53a27eb3198 Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sun, 30 Aug 2015 09:21:23 -0400
Subject: [PATCH 1/4] gnu: Add ruby-thread-safe.

* gnu/packages/ruby.scm (ruby-thread-safe): New variable.
---
 gnu/packages/ruby.scm | 20 
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 4759f46..d11f53f 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -801,3 +801,23 @@ Ruby.  It features syntax highlighting, a plugin architecture, runtime
 invocation, and source and documentation browsing.)
 (home-page http://pryrepl.org;)
 (license license:expat)))
+
+(define-public ruby-thread-safe
+  (package
+(name ruby-thread-safe)
+(version 0.3.5)
+(source
+ (origin
+   (method url-fetch)
+   (uri (rubygems-uri thread_safe version))
+   (sha256
+(base32
+ 1hq46wqsyylx5afkp6jmcihdpv4ynzzq9ygb6z2pb1cbz5js0gcr
+(build-system ruby-build-system)
+(arguments
+ '(#:tests? #f)) ; needs simplecov, among others
+(synopsis Thread-safe utilities for Ruby)
+(description The thread_safe library provides thread-safe collections and
+utilities for Ruby.)
+(home-page https://github.com/ruby-concurrency/thread_safe;)
+(license license:asl2.0)))
-- 
2.5.0

From 0bca478f5c5096427343a644d540c1a3c11c86d4 Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sun, 30 Aug 2015 09:21:46 -0400
Subject: [PATCH 2/4] gnu: Add ruby-tzinfo.

* gnu/packages/ruby.scm (ruby-tzinfo): New variable.
---
 gnu/packages/ruby.scm | 20 
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index d11f53f..721785e 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -821,3 +821,23 @@ invocation, and source and documentation browsing.)
 utilities for Ruby.)
 (home-page https://github.com/ruby-concurrency/thread_safe;)
 (license license:asl2.0)))
+
+(define-public ruby-tzinfo
+  (package
+(name ruby-tzinfo)
+(version 1.2.2)
+(source
+ (origin
+   (method url-fetch)
+   (uri (rubygems-uri tzinfo version))
+   (sha256
+(base32
+ 1c01p3kg6xvy1cgjnzdfq45fggbwish8krd0h864jvbpybyx7cgx
+(build-system ruby-build-system)
+(propagated-inputs
+ `((ruby-thread-safe ,ruby-thread-safe)))
+(synopsis Time zone library for Ruby)
+(description TZInfo is a Ruby library that provides daylight savings
+aware transformations between times in different time zones.)
+(home-page http://tzinfo.github.io;)
+(license license:expat)))
-- 
2.5.0

From 6dd92fc344ff4d54d6044bf6ce72c8c02087798c Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sun, 30 Aug 2015 09:22:12 -0400
Subject: [PATCH 3/4] gnu: Add ruby-json.

* gnu/packages/ruby.scm (ruby-json): New variable.
---
 gnu/packages/ruby.scm | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 721785e..a0308c7 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -841,3 +841,22 @@ utilities for Ruby.)
 aware transformations between times in different time zones.)
 (home-page http://tzinfo.github.io;)
 (license license:expat)))
+
+(define-public ruby-json
+  (package
+(name ruby-json)
+(version 1.8.3)
+(source
+ (origin
+   (method url-fetch)
+   (uri (rubygems-uri json version))
+   (sha256
+(base32
+ 1nsby6ry8l9xg3yw4adlhk2pnc7i0h0rznvcss4vk3v74qg0k8lc
+(build-system ruby-build-system)
+(arguments '(#:tests? #f)) ; dependency cycle with sdoc
+(synopsis JSON library for Ruby)
+(description This Ruby library provides a JSON implementation written as
+a native C extension.)
+(home-page http://json-jruby.rubyforge.org/;)
+(license (list license:ruby license:gpl2 ; GPL2 only
-- 
2.5.0

From 2830c36b71cf55ef5ebf9bf85ce0e2e61d5b2ec4 Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sun, 30 Aug 2015 09:22:50 -0400
Subject: [PATCH 4/4] gnu: Add ruby-activesupport.

* gnu/packages/ruby.scm (ruby-activesupport): New variable.
---
 gnu/packages/ruby.scm | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index a0308c7..8159e47 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -860,3 +860,30 @@ aware transformations between times in different time zones.)
 a native C extension.)
 (home-page http://json-jruby.rubyforge.org/;)
 (license (list license:ruby license:gpl2 ; GPL2 only
+
+(define-public ruby-activesupport
+  (package
+(name ruby-activesupport)
+(version 4.2.4)
+(source
+ (origin
+   (method url-fetch)
+   (uri

[PATCHES] Add ruby-pry

2015-08-29 Thread David Thompson
This small patch set adds the Pry, a powerful Ruby REPL (but not as
powerful as Geiser ;), and the missing prerequisites.

From 2d1757d4b7b940fb0f2da007e6c616370b2b09ad Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sat, 29 Aug 2015 22:53:34 -0400
Subject: [PATCH 1/3] gnu: Add ruby-method-source.

* gnu/packages/ruby.scm (ruby-method-source): New variable.
---
 gnu/packages/ruby.scm | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 23b3178..a51972c 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -734,3 +734,25 @@ both CSS3 selector and XPath 1.0 support.)
 with PostgreSQL 8.4 and later.)
 (home-page https://bitbucket.org/ged/ruby-pg;)
 (license license:ruby)))
+
+(define-public ruby-method-source
+  (package
+(name ruby-method-source)
+(version 0.8.2)
+(source
+ (origin
+   (method url-fetch)
+   (uri (rubygems-uri method_source version))
+   (sha256
+(base32
+ 1g5i4w0dmlhzd18dijlqw5gk27bv6dj2kziqzrzb7mpgxgsd1sf2
+(build-system ruby-build-system)
+(native-inputs
+ `((ruby-bacon ,ruby-bacon)
+   (git ,git)))
+(synopsis Retrieve the sourcecode for Ruby methods)
+(description Method_source retrieves the source codefor Ruby methods.
+Additionally, it can extract source code from Proc and Lambda objects or just
+extract comments.)
+(home-page http://banisterfiend.wordpress.com;)
+(license license:expat)))
-- 
2.5.0

From 1f418e114ed2436caf35dc2aaaea9fa316a3075c Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sat, 29 Aug 2015 22:54:05 -0400
Subject: [PATCH 2/3] gnu: Add ruby-coderay.

* gnu/packages/ruby.scm (ruby-coderay): New variable.
---
 gnu/packages/ruby.scm | 20 
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index a51972c..ad31975 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -756,3 +756,23 @@ Additionally, it can extract source code from Proc and Lambda objects or just
 extract comments.)
 (home-page http://banisterfiend.wordpress.com;)
 (license license:expat)))
+
+(define-public ruby-coderay
+  (package
+(name ruby-coderay)
+(version 1.1.0)
+(source
+ (origin
+   (method url-fetch)
+   (uri (rubygems-uri coderay version))
+   (sha256
+(base32
+ 059wkzlap2jlkhg460pkwc1ay4v4clsmg1bp4vfzjzkgwdckr52s
+(build-system ruby-build-system)
+(arguments
+ '(#:tests? #f)) ; missing test files
+(synopsis Ruby syntax highlighting library)
+(description Coderay is a Ruby library that provides syntax highlighting
+for select languages.)
+(home-page http://coderay.rubychan.de;)
+(license license:expat)))
-- 
2.5.0

From 3d5c91be48d77e8de83bba225fd5af29b6cf4158 Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sat, 29 Aug 2015 22:54:24 -0400
Subject: [PATCH 3/3] gnu: Add ruby-pry.

* gnu/packages/ruby.scm (ruby-pry): New variable.
---
 gnu/packages/ruby.scm | 25 +
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index ad31975..23e19f2 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -776,3 +776,28 @@ extract comments.)
 for select languages.)
 (home-page http://coderay.rubychan.de;)
 (license license:expat)))
+
+(define-public ruby-pry
+  (package
+(name ruby-pry)
+(version 0.10.1)
+(source
+ (origin
+   (method url-fetch)
+   (uri (rubygems-uri pry version))
+   (sha256
+(base32
+ 1j0r5fm0wvdwzbh6d6apnp7c0n150hpm9zxpm5xvcgfqr36jaj8z
+(build-system ruby-build-system)
+(arguments
+ '(#:tests? #f)) ; no tests
+(propagated-inputs
+ `((ruby-coderay ,ruby-coderay)
+   (ruby-method-source ,ruby-method-source)
+   (ruby-slop ,ruby-slop)))
+(synopsis Ruby REPL)
+(description Pry is an IRB alternative and runtime developer console for
+Ruby.  It features syntax highlighting, a plugin architecture, runtime
+invocation, and source and documentation browsing.)
+(home-page http://pryrepl.org;)
+(license license:expat)))
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[PATCHES] Add ruby-pg and adjust Ruby build system

2015-08-29 Thread David Thompson
Unlike a lot of other gems, I was pleasantly surprised that I could
actually run ruby-pg's test suite successfully.  However, I had to tweak
the build system to use shorter file names for the build directory
because the test suite was trying to create a UNIX-domain socket longer
than the maximum of 107.

From 8f29026d37a66d8bcbddc6f32a6354d93d40f50d Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sat, 29 Aug 2015 21:55:12 -0400
Subject: [PATCH 1/2] build: ruby: Avoid long build directory names.

Having the hash of the source gem in the source directory file name proved to
be problematic when running the test suite for the 'pg' gem that creates
UNIX-domain sockets in the source directory and exceeded the 108 character
limit on GNU/Linux systems.

* guix/build/ruby-build-system.scm (unpack): Rename unpacked gem directory to
  gem.
---
 guix/build/ruby-build-system.scm | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm
index 90fab92..4184ccc 100644
--- a/guix/build/ruby-build-system.scm
+++ b/guix/build/ruby-build-system.scm
@@ -44,12 +44,16 @@ directory.
 (define* (unpack #:key source #:allow-other-keys)
   Unpack the gem SOURCE and enter the resulting directory.
   (and (zero? (system* gem unpack source))
-   (begin
- ;; The unpacked gem directory is named the same as the archive, sans
- ;; the .gem extension.
- (chdir (match:substring (string-match ^(.*)\\.gem$
-   (basename source))
- 1))
+   ;; The unpacked gem directory is named the same as the archive, sans
+   ;; the .gem extension.  It is renamed to simply gem in an effort to
+   ;; keep file names shorter to avoid UNIX-domain socket file names and
+   ;; shebangs that exceed the system's fixed maximum length when running
+   ;; test suites.
+   (let ((dir (match:substring (string-match ^(.*)\\.gem$
+ (basename source))
+   1)))
+ (rename-file dir gem)
+ (chdir gem)
  #t)))
 
 (define* (build #:key source #:allow-other-keys)
-- 
2.5.0

From efced81a77bc4a5a72a430987ab8168196358d47 Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sat, 29 Aug 2015 22:03:51 -0400
Subject: [PATCH 2/2] gnu: Add ruby-pg.

* gnu/packages/ruby.scm (ruby-pg): New variable.
---
 gnu/packages/ruby.scm | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 33da738..29aaffc 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -23,6 +23,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages libffi)
@@ -707,3 +708,29 @@ messing up your system.)
 both CSS3 selector and XPath 1.0 support.)
 (home-page http://www.nokogiri.org/;)
 (license license:expat)))
+
+(define-public ruby-pg
+  (package
+(name ruby-pg)
+(version 0.18.2)
+(source
+ (origin
+   (method url-fetch)
+   (uri (rubygems-uri pg version))
+   (sha256
+(base32
+ 1axxbf6ij1iqi3i1r3asvjc80b0py5bz0m2wy5kdi5xkrpr82kpf
+(build-system ruby-build-system)
+(arguments
+ '(#:test-target spec))
+(native-inputs
+ `((ruby-rake-compiler ,ruby-rake-compiler)
+   (ruby-hoe ,ruby-hoe)
+   (ruby-rspec ,ruby-rspec)))
+(inputs
+ `((postgresql ,postgresql)))
+(synopsis Ruby interface to PostgreSQL)
+(description Pg is the Ruby interface to the PostgreSQL RDBMS.  It works
+with PostgreSQL 8.4 and later.)
+(home-page https://bitbucket.org/ged/ruby-pg;)
+(license license:ruby)))
-- 
2.5.0


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] gnu: Add sassc.

2015-08-20 Thread David Thompson
From 4a6d1a798a0625d8bc104b86db56f5d2594a5d80 Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Wed, 19 Aug 2015 21:54:57 -0400
Subject: [PATCH] gnu: Add sassc.

* gnu/packages/web.scm (sassc): New variable.
---
 gnu/packages/web.scm | 53 
 1 file changed, 53 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 48bfbc7..ce4cfeb 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -642,6 +642,59 @@ minimum to provide high performance operation.)
 ;; bundled CuTest framework uses a different non-copyleft license.
 (license (list l:asl2.0 (l:non-copyleft file://test/CuTest-README.txt)
 
+(define-public sassc
+  ;; libsass must be statically linked and it isn't included in source the
+  ;; sassc release tarballs, hence this odd package recipe.
+  (let* ((version 3.2.5)
+ (libsass
+  (origin
+(method url-fetch)
+(uri (string-append
+  https://github.com/sass/libsass/archive/;
+  version .tar.gz))
+(file-name (string-append libsass- version .tar.gz))
+(sha256
+ (base32
+  1x25k6p1s1yzsdpzb7bzh8japilmi1mk3z96q66pycbinj9z9is4)
+(package
+  (name sassc)
+  (version version)
+  (source (origin
+(method url-fetch)
+(uri (string-append https://github.com/sass/sassc/archive/;
+version .tar.gz))
+(sha256
+ (base32
+  1xf3w75w840rj0nx375rxi7mcv1ngqqq8p3zrzjlyx8jfpnldmv5
+  (build-system gnu-build-system)
+  (arguments
+   `(#:make-flags '(CC=gcc)
+ #:test-target test
+ #:phases
+ (modify-phases %standard-phases
+   (delete 'configure)
+   (add-before 'build 'set-libsass-path
+ (lambda* (#:key inputs #:allow-other-keys)
+   (system* tar xvf (assoc-ref inputs libsass))
+   (setenv SASS_LIBSASS_PATH
+   (string-append (getcwd) /libsass- ,version))
+
+   #t))
+   (replace 'install ; no install target
+ (lambda* (#:key outputs #:allow-other-keys)
+   (let ((bin (string-append (assoc-ref outputs out) /bin)))
+ (mkdir-p bin)
+ (copy-file bin/sassc
+(string-append bin /sassc))
+ #t))
+  (inputs
+   `((libsass ,libsass)))
+  (synopsis CSS pre-processor)
+  (description SassC is a compiler written in C for the CSS pre-processor
+language known as SASS.)
+  (home-page http://sass-lang.com/libsass;)
+  (license l:expat
+
 
 (define-public perl-apache-logformat-compiler
   (package
-- 
2.4.3


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] syscalls: setns: Skip binding if there is no such C function.

2015-08-16 Thread David Thompson
From 57faa1368cb96dd94cc32c18a0e6b63285ca8e1d Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sun, 16 Aug 2015 08:08:34 -0400
Subject: [PATCH] syscalls: setns: Skip binding if there is no such C function.

On systems with a glibc prior to 2.14, the 'setns' function is not available.

Thanks to Eric Bavier for reporting the issue.

* guix/build/syscalls.scm (setns): Wrap with 'false-if-exception'.
---
 guix/build/syscalls.scm | 23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 68f340c..fc801a5 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -328,19 +328,22 @@ are shared between the parent and child processes.
   (proc syscall-id flags %null-pointer
 
 (define setns
-  (let* ((ptr  (dynamic-func setns (dynamic-link)))
- (proc (pointer-procedure int ptr (list int int
-(lambda (fdes nstype)
-  Reassociate the current process with the namespace specified by FDES, a
+  ;; Some systems may be using an old (pre-2.14) version of glibc where there
+  ;; is no 'setns' function available.
+  (false-if-exception
+   (let* ((ptr  (dynamic-func setns (dynamic-link)))
+  (proc (pointer-procedure int ptr (list int int
+ (lambda (fdes nstype)
+   Reassociate the current process with the namespace specified by FDES, a
 file descriptor obtained by opening a /proc/PID/ns/* file.  NSTYPE specifies
 which type of namespace the current process may be reassociated with, or 0 if
 there is no such limitation.
-  (let ((ret (proc fdes nstype))
-(err (errno)))
-(unless (zero? ret)
-  (throw 'system-error setns ~d ~d: ~A
- (list fdes nstype (strerror err))
- (list err)))
+   (let ((ret (proc fdes nstype))
+ (err (errno)))
+ (unless (zero? ret)
+   (throw 'system-error setns ~d ~d: ~A
+  (list fdes nstype (strerror err))
+  (list err
 
 (define pivot-root
   (let* ((ptr  (dynamic-func pivot_root (dynamic-link)))
-- 
2.4.3




[PATCHES] import: pypi: Move generally useful procedures to utils module.

2015-08-16 Thread David Thompson
Building off of the new and improved Ruby build system, here are two
patches that add a handy RubyGems importer.

From b60252c0c52f8ab4b096c00238acab9798ee64f4 Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sun, 16 Aug 2015 21:09:19 -0400
Subject: [PATCH 1/2] import: pypi: Move generally useful procedures to utils
 module.

* guix/import/pypi.scm (make-pypi-sexp): Factorize license to symbol
  conversion code.
  (string-license, snake-case, guix-hash-url): Move from here...
* guix/import/utils.scm: ... to here.
  (license-symbol): New procedure.
---
 guix/import/pypi.scm  | 29 +
 guix/import/utils.scm | 43 ++-
 2 files changed, 43 insertions(+), 29 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 10d5bad..06d21fe 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -31,8 +31,6 @@
   #:use-module (guix utils)
   #:use-module (guix import utils)
   #:use-module (guix import json)
-  #:use-module (guix base32)
-  #:use-module (guix hash)
   #:use-module (guix packages)
   #:use-module (guix licenses)
   #:use-module (guix build-system python)
@@ -49,16 +47,6 @@ DELIMETER.
 ((elem . rest)
  (cons* elem delimiter (join rest delimiter)
 
-(define string-license
-  (match-lambda
-   (GNU LGPL lgpl2.0)
-   (GPL gpl3)
-   ((or BSD BSD License) bsd-3)
-   ((or MIT MIT license Expat license) expat)
-   (Public domain public-domain)
-   (Apache License, Version 2.0 asl2.0)
-   (_ #f)))
-
 (define (pypi-fetch name)
   Return an alist representation of the PyPI metadata for the package NAME,
 or #f on failure.
@@ -75,15 +63,6 @@ or #f on failure.
(assoc-ref* pypi-package info name)
(assoc-ref* pypi-package info version)
 
-(define (snake-case str)
-  Return a downcased version of the string STR where underscores are replaced
-with dashes.
-  (string-join (string-split (string-downcase str) #\_) -))
-
-(define (guix-hash-url filename)
-  Return the hash of FILENAME in nix-base32 format.
-  (bytevector-nix-base32-string  (file-sha256 filename)))
-
 (define (python-package-name name)
   Given the NAME of a package on PyPI, return a Guix-compliant name for the
 package.
@@ -205,13 +184,7 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE.
  (home-page ,home-page)
  (synopsis ,synopsis)
  (description ,description)
- (license ,(assoc-ref `((,lgpl2.0 . lgpl2.0)
-(,gpl3 . gpl3)
-(,bsd-3 . bsd-3)
-(,expat . expat)
-(,public-domain . public-domain)
-(,asl2.0 . asl2.0))
-  license)))
+ (license ,(license-symbol license)))
 
 (define (pypi-guix-package package-name)
   Fetch the metadata for PACKAGE-NAME from pypi.python.org, and return the
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 969491d..0734fa1 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -21,6 +21,8 @@
   #:use-module (ice-9 regex)
   #:use-module (srfi srfi-1)
   #:use-module (guix hash)
+  #:use-module (guix base32)
+  #:use-module (guix licenses)
   #:use-module (guix utils)
   #:use-module ((guix build download) #:prefix build:)
   #:export (factorize-uri
@@ -29,7 +31,13 @@
 flatten
 assoc-ref*
 
-url-fetch))
+url-fetch
+guix-hash-url
+
+string-license
+license-symbol
+
+snake-case))
 
 (define (factorize-uri uri version)
   Factorize URI, a package tarball URI as a string, such that any occurrences
@@ -95,3 +103,36 @@ recursively apply the procedure to the sub-list.
   Save the contents of URL to FILE-NAME.  Return #f on failure.
   (parameterize ((current-output-port (current-error-port)))
 (build:url-fetch url file-name)))
+
+(define (guix-hash-url filename)
+  Return the hash of FILENAME in nix-base32 format.
+  (bytevector-nix-base32-string (file-sha256 filename)))
+
+(define (string-license str)
+  Convert the string STR into a license object.
+  (match str
+(GNU LGPL lgpl2.0)
+(GPL gpl3)
+((or BSD BSD License) bsd-3)
+((or MIT MIT license Expat license) expat)
+(Public domain public-domain)
+((or Apache License, Version 2.0 Apache 2.0) asl2.0)
+(_ #f)))
+
+(define (license-symbol license)
+  Convert license to a symbol representing the variable the object is bound
+to in the (guix licenses) module, or #f if there is no such known license.
+  ;; TODO: Traverse list public variables in (guix licenses) instead so we
+  ;; don't have to maintain a list manualy.
+  (assoc-ref `((,lgpl2.0 . lgpl2.0)
+   (,gpl3 . gpl3)
+   (,bsd-3 . bsd-3)
+   (,expat . expat)
+   (,public-domain

[PATCH] gnu: Add ruby-arel.

2015-08-16 Thread David Thompson
Requires the new Ruby build system.

From c6bdc405f2c1b79daa3058d73df966224f169293 Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sun, 16 Aug 2015 21:58:12 -0400
Subject: [PATCH] gnu: Add ruby-arel.

* gnu/packages/ruby.scm (ruby-arel): New variable.
---
 gnu/packages/ruby.scm | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 196094c..e6f720c 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -610,3 +610,21 @@ options and parsing command line flags.)
 net/http library.)
 (home-page https://github.com/nicksieger/multipart-post;)
 (license license:expat)))
+
+(define-public ruby-arel
+  (package
+(name ruby-arel)
+(version 6.0.3)
+(source (origin
+  (method url-fetch)
+  (uri (rubygems-uri arel version))
+  (sha256
+   (base32
+1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk
+(build-system ruby-build-system)
+(arguments '(#:tests? #f)) ; no tests
+(home-page https://github.com/rails/arel;)
+(synopsis SQL AST manager for Ruby)
+(description Arel is a SQL AST manager for Ruby.  It simplifies the
+generation of complex SQL queries and is compatible with various RDBMSes.)
+(license license:expat)))
-- 
2.4.3


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] gnu: notmuch: Update to 0.20.2.

2015-08-15 Thread David Thompson
From 74d2db4f0ecbfc00473493e410a086f7c7c0bb10 Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sat, 15 Aug 2015 22:23:59 -0400
Subject: [PATCH] gnu: notmuch: Update to 0.20.2.

* gnu/packages/mail.scm (notmuch): Update to 0.20.2.  Add python-sphinx native
  input.  Rewrite phases using 'modify-phases' syntax.
---
 gnu/packages/mail.scm | 33 ++---
 1 file changed, 14 insertions(+), 19 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index f8eba5c..131e48f 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -365,36 +365,31 @@ attachments, create new maildirs, and so on.)
 (define-public notmuch
   (package
 (name notmuch)
-(version 0.19)
+(version 0.20.2)
 (source (origin
   (method url-fetch)
   (uri (string-append http://notmuchmail.org/releases/notmuch-;
   version .tar.gz))
   (sha256
(base32
-1szf6c44g209pcjq5nvfhlp3nzcm3lrcwv4spsxmwy13hiaccvrr
+1v5dcnlg4km5hfaq0i0qywq5fn66fi0rq4aaibyqkwxz8mis4hgp
 (build-system gnu-build-system)
 (arguments
- '(#:tests? #f ;; FIXME: Test suite hangs and times out.
-   #:phases (alist-replace
- 'configure
- (lambda* (#:key outputs #:allow-other-keys)
-   (setenv CC gcc)
-   (setenv CONFIG_SHELL (which sh))
-
-   ;; XXX Should python-docutils make a symlink
-   ;; for rst2man and other similar programs?
-   (substitute* '(configure doc/prerst2man.py)
- (( rst2man )  rst2man.py ))
-
-   (let ((out (assoc-ref outputs out)))
- (zero? (system* ./configure
- (string-append --prefix= out)
- %standard-phases)))
+ '(#:tests? #t ;; FIXME: 637 tests; 70 fail and 98 are skipped
+   #:phases (modify-phases %standard-phases
+  (replace 'configure
+(lambda* (#:key outputs #:allow-other-keys)
+  (setenv CC gcc)
+  (setenv CONFIG_SHELL (which sh))
+
+  (let ((out (assoc-ref outputs out)))
+(zero? (system* ./configure
+(string-append --prefix= out)
 (native-inputs
  `((pkg-config ,pkg-config)
(python ,python-2)
-   (python2-docutils ,python2-docutils)
+   (python-docutils ,python2-docutils)
+   (python-sphinx ,python2-sphinx)
(bash-completion ,bash-completion)))
 (inputs
  `((emacs ,emacs)
-- 
2.4.3


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] gnu: Add guile-redis.

2015-08-09 Thread David Thompson
From 519e0ba6beecca0a5b4dc2a76abf43b0a00ed2dd Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sun, 9 Aug 2015 10:37:55 -0400
Subject: [PATCH] gnu: Add guile-redis.

* gnu/packages/guile.scm (guile-redis): New variable.
---
 gnu/packages/guile.scm | 29 +
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index d7b196a..086ab63 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -535,4 +535,33 @@ See http://minikanren.org/ for more on miniKanren generally.)
 Guile's foreign function interface.)
 (license gpl3+)))
 
+(define-public guile-redis
+  (package
+(name guile-redis)
+(version 0.1.0)
+(source (origin
+  (method url-fetch)
+  (uri (string-append mirror://savannah/guile-redis/guile-redis-
+  version .tar.gz))
+  (sha256
+   (base32
+0vx6if6b4r3kwx64vzbs6vpc0cpcr85x11w9vkzq27gw8n7isv56))
+  (modules '((guix build utils)))
+  (snippet
+   ;; Make sure everything goes under .../site/2.0, like Guile's
+   ;; search paths expects.
+   '(substitute* '(Makefile.in
+   redis/Makefile.in
+   redis/commands/Makefile.in)
+  ((moddir =.*/share/guile/site all)
+   (string-append all /2.0))
+(build-system gnu-build-system)
+(native-inputs
+ `((guile ,guile-2.0)))
+(home-page http://savannah.nongnu.org/projects/guile-redis/;)
+(synopsis Redis client library for Guile)
+(description Guile-redis provides a Scheme interface to the Redis
+key-value cache and store.)
+(license lgpl3+)))
+
 ;;; guile.scm ends here
-- 
2.4.3


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] scripts: package: Add --install-from-file option.

2015-08-09 Thread David Thompson
In my personal projects, I keep a 'package.scm' file in the root of the
source tree for use with 'guix environment -l'.  However, it's also
handy to install that package by using 'guix package -e':

guix package -e '(primitive-load package.scm)'

This patch adds a shorthand for this:

guix package -f package.scm

The motivation for this is to ultimately encourage other people to keep
a 'package.scm' file in their own repos for building reproducible
development environments and easily testing development snapshots, like
what we do with our 'guix-devel' package.

I'd like to add the same option for 'guix build', if this is approved.

From 07c9b35facf810872f3bc8342e18b33033714adf Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sun, 9 Aug 2015 11:35:51 -0400
Subject: [PATCH] scripts: package: Add --install-from-file option.

* guix/scripts/package.scm (show-help): Add help text for --install-from-file
  option.
  (%options): Add --install-from-file option.
* doc/guix.texi (invoking guix package): Document it.
---
 doc/guix.texi| 31 +++
 guix/scripts/package.scm | 10 ++
 2 files changed, 41 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index bcf07a6..dda478f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -1167,6 +1167,37 @@ Note that this option installs the first output of the specified
 package, which may be insufficient when needing a specific output of a
 multiple-output package.
 
+@item --install-from-file=@var{file}
+@itemx -f @var{file}
+Install the package that the code within @var{file} evaluates to.
+
+As an example, @var{file} might contain a definition like this
+(@pxref{Defining Packages}):
+
+@example
+(use-modules (guix packages)
+ (guix download)
+ (guix build-system gnu)
+ (guix licenses))
+
+(package
+  (name hello)
+  (version 2.8)
+  (source (origin
+(method url-fetch)
+(uri (string-append mirror://gnu/hello/hello- version
+.tar.gz))
+(sha256
+ (base32 0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6
+  (build-system gnu-build-system)
+  (arguments `(#:configure-flags '(--enable-silent-rules)))
+  (inputs `((gawk ,gawk)))
+  (synopsis Hello, GNU world: An example GNU package)
+  (description Guess what GNU Hello prints!)
+  (home-page http://www.gnu.org/software/hello/;)
+  (license gpl3+))
+@end example
+
 @item --remove=@var{package} @dots{}
 @itemx -r @var{package} @dots{}
 Remove the specified @var{package}s.
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index b545ea2..23f1597 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -381,6 +381,10 @@ Install, remove, or upgrade packages in a single transaction.\n))
   -e, --install-from-expression=EXP
  install the package EXP evaluates to))
   (display (_ 
+  -f, --install-from-file=FILE
+ install the package that the code within FILE
+ evaluates to))
+  (display (_ 
   -r, --remove PACKAGE ...
  remove PACKAGEs))
   (display (_ 
@@ -454,6 +458,12 @@ Install, remove, or upgrade packages in a single transaction.\n))
(values (alist-cons 'install (read/eval-package-expression arg)
result)
#f)))
+ (option '(#\f install-from-file) #t #f
+ (lambda (opt name arg result arg-handler)
+   (values (alist-cons 'install
+   (load* arg (make-user-module '()))
+   result)
+   #f)))
  (option '(#\r remove) #f #t
  (lambda (opt name arg result arg-handler)
(let arg-handler ((arg arg) (result result))
-- 
2.4.3


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] gnu: Add redis.

2015-08-05 Thread David Thompson
I've been sitting on this patch for awhile because I cannot get the test
suite to fully pass.  Almost all of the tests pass, sans a few related
to master/slave and other replication setups.  Redis is an important
tool for me so I figured that it was best to just disable the tests for
now and get it into the distro.

From 486bd9d63670ba48d4c676a29b6aa142f79f7c2f Mon Sep 17 00:00:00 2001
From: David Thompson da...@gnu.org
Date: Fri, 5 Jun 2015 20:09:10 -0400
Subject: [PATCH] gnu: Add redis.

* gnu/packages/databases.scm (redis): New variable.
---
 gnu/packages/databases.scm | 29 -
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 1b200b0..cbac16e 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -43,7 +43,7 @@
   #:use-module (gnu packages jemalloc)
   #:use-module ((guix licenses)
 #:select (gpl2 gpl3+ lgpl2.1+ lgpl3+ x11-style non-copyleft
-  bsd-2 public-domain))
+  bsd-2 bsd-3 public-domain))
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
@@ -727,3 +727,30 @@ database engine.  UnQLite is a document store database similar to
 MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store
 similar to BerkeleyDB, LevelDB, etc.)
 (license bsd-2)))
+
+(define-public redis
+  (package
+(name redis)
+(version 3.0.3)
+(source (origin
+  (method url-fetch)
+  (uri (string-append http://download.redis.io/releases/redis-;
+  version.tar.gz))
+  (sha256
+   (base32
+19cxdrk380qachw160h1x51mwj7kpkxlggfzfh19bl0nbdkgl20x
+(build-system gnu-build-system)
+(arguments
+ '(#:tests? #f ; tests related to master/slave and replication fail
+   #:phases (modify-phases %standard-phases
+  (delete 'configure))
+   #:make-flags `(CC=gcc
+  MALLOC=libc
+  ,(string-append PREFIX=
+  (assoc-ref %outputs out)
+(synopsis Key-value cache and store)
+(description Redis is an advanced key-value cache and store.  Redis
+supports many data structures including strings, hashes, lists, sets, sorted
+sets, bitmaps and hyperloglogs.)
+(home-page http://redis.io/;)
+(license bsd-3)))
-- 
2.4.3


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] gnu: services: Add nginx-service.

2015-08-02 Thread David Thompson
Here's a basic nginx service.  There are more actions that could be
added in the future, but this does the essentials.

From 4bd0c36545258d028a74e2fc7144a4037ec1148f Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sun, 2 Aug 2015 23:29:53 -0400
Subject: [PATCH] gnu: services: Add nginx-service.

* gnu/services/web.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
---
 gnu-system.am|   1 +
 gnu/services/web.scm | 105 +++
 2 files changed, 106 insertions(+)
 create mode 100644 gnu/services/web.scm

diff --git a/gnu-system.am b/gnu-system.am
index 87924fe..5a28c4b 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -345,6 +345,7 @@ GNU_SYSTEM_MODULES =\
   gnu/services/lirc.scm\
   gnu/services/networking.scm			\
   gnu/services/ssh.scm\
+  gnu/services/web.scm\
   gnu/services/xorg.scm\
 		\
   gnu/system.scm\
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
new file mode 100644
index 000..85c6e07
--- /dev/null
+++ b/gnu/services/web.scm
@@ -0,0 +1,105 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 David Thompson da...@gnu.org
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see http://www.gnu.org/licenses/.
+
+(define-module (gnu services web)
+  #:use-module (gnu services)
+  #:use-module (gnu system shadow)
+  #:use-module (gnu packages admin)
+  #:use-module (gnu packages web)
+  #:use-module (guix records)
+  #:use-module (guix monads)
+  #:use-module (guix store)
+  #:use-module (guix gexp)
+  #:export (nginx-service))
+
+;;; Commentary:
+;;;
+;;; Web services.
+;;;
+;;; Code:
+
+(define %default-nginx-config
+  (text-file* nginx.conf
+  user nginx nginx;\n
+  pid /var/run/nginx/pid;\n
+  error_log /var/log/nginx/error.log info;\n
+  http {\n
+  access_log /var/log/nginx/access.log;\n
+  root /var/www;\n
+  server {}\n
+  }\n
+  events {}\n))
+
+(define* (nginx-service #:key (nginx nginx)
+(config-file %default-nginx-config)
+(log-directory /var/log/nginx)
+(run-directory /var/run/nginx))
+  Return a service that runs NGINX, the nginx web server.
+
+The nginx daemon loads its runtime configuration from CONFIG-FIGLE, stores log
+files in LOG-DIRECTORY, and stores temporary runtime files in RUN-DIRECTORY.
+  (define nginx* #~(string-append #$nginx /sbin/nginx))
+
+  (define start-script
+(mlet %store-monad ((config-file config-file))
+  (gexp-script start-nginx
+#~(system* #$nginx* -c #$config-file
+   -p #$run-directory
+
+  (define stop-script
+(mlet %store-monad ((config-file config-file))
+  (gexp-script stop-nginx
+#~(system* #$nginx* -c #$config-file
+   -p #$run-directory -s stop
+
+  (define activate
+(mlet %store-monad ((config-file config-file))
+  (return
+   #~(begin
+   (use-modules (guix build utils))
+   (format #t creating nginx log directory '~a'~% #$log-directory)
+   (mkdir-p #$log-directory)
+   (format #t creating nginx run directory '~a'~% #$run-directory)
+   (mkdir-p #$run-directory)
+   ;; Check configuration file syntax.
+   (system* #$nginx* -c #$config-file -t)
+
+  (mlet %store-monad ((start-script start-script)
+  (stop-script  stop-script)
+  (activate activate))
+(return
+ (service
+  (provision '(nginx))
+  (documentation Run the nginx daemon.)
+  (requirement '(user-processes loopback))
+  (start #~(lambda _
+ (zero? (status:exit-val (system* #$start-script)
+  (stop #~(lambda _
+(zero? (status:exit-val (system* #$stop-script)
+  (activate activate)
+  (user-groups (list (user-group
+  (name nginx)
+  (system? #t
+  (user-accounts (list (user-account
+(name nginx)
+(group nginx)
+(system? #t)
+(comment nginx server user

[PATCH] build: file-systems: Allow for bind mounting regular files.

2015-08-01 Thread David Thompson
As I was working on my container implementation I noticed that
'mount-file-system' doesn't support bind mounting regular files because
it assumes that all mount points are directories.  This patch fixes
that.

From f94fec6cde3826f20c0d69a45c2aa1928c1d0a78 Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sat, 1 Aug 2015 13:43:33 -0400
Subject: [PATCH] build: file-systems: Allow for bind mounting regular files.

* gnu/build/file-systems.scm (regular-file?): New procedure.
  (mount-file-system): Create a regular file instead of a directory when bind
  mounting a regular file.
---
 gnu/build/file-systems.scm | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index c58d23c..f0d6f70 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -305,6 +305,10 @@ the following:
fsck code device)
(start-repl)
 
+(define (regular-file? file-name)
+  Return #t if FILE-NAME is a regular file.
+  (eq? (stat:type (stat file-name)) 'regular))
+
 (define (mount-flags-bit-mask flags)
   Return the number suitable for the 'flags' argument of 'mount' that
 corresponds to the symbols listed in FLAGS.
@@ -339,7 +343,16 @@ run a file system check.
(flags   (mount-flags-bit-mask flags)))
(when check?
  (check-file-system source type))
-   (mkdir-p mount-point)
+
+   ;; Create the mount point.  Most of the time this is a directory, but
+   ;; in the case of a bind mount, a regular file may be needed.
+   (if (and (= MS_BIND (logand flags MS_BIND))
+(regular-file? source))
+   (begin
+ (mkdir-p (dirname mount-point))
+ (call-with-output-file mount-point (const #t)))
+   (mkdir-p mount-point))
+
(mount source mount-point type flags options)
 
;; For read-only bind mounts, an extra remount is needed, as per
-- 
2.4.3


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] build: container: Add #:host-uids argument to call-with-container.

2015-08-01 Thread David Thompson
This patch should resolve the issues we're having with the container
tests when building Guix with Guix.  Tested on 'wip-container' with
'guix environment --container'.

From 096ac10f187c6d9c72462c4747cd6c8433eb8f02 Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sat, 1 Aug 2015 21:04:31 -0400
Subject: [PATCH] build: container: Add #:host-uids argument to
 call-with-container.

It's not always possible to map 65536 uids when creating a container as the
root user within another user namespace.  This is true when building Guix
within the build daemon's container.  By using a uid range of 1 by default,
even as the root user, the tests now pass.

* gnu/build/linux-container.scm (initialize-user-namespace, run-container):
  Add 'host-uids' argument.
  (call-with-container): Add #:host-uids keyword argument.
* tests/containers.scm (container-excursion): Update 'run-container' call.
---
 gnu/build/linux-container.scm | 38 +++---
 tests/containers.scm  |  2 +-
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/gnu/build/linux-container.scm b/gnu/build/linux-container.scm
index 7a03a29..af59904 100644
--- a/gnu/build/linux-container.scm
+++ b/gnu/build/linux-container.scm
@@ -120,23 +120,17 @@ to ROOT, then make ROOT the new root directory for the process.
 (umount real-root MNT_DETACH)
 (rmdir real-root)))
 
-(define (initialize-user-namespace pid)
-  Configure the user namespace for PID.
+(define (initialize-user-namespace pid host-uids)
+  Configure the user namespace for PID.  HOST-UIDS specifies the number of
+host user identifiers to map into the user namespace.
   (define proc-dir
 (string-append /proc/ (number-string pid)))
 
   (define (scope file)
 (string-append proc-dir file))
 
-  ;; Only root can map more than a single uid/gid.  A range of 65536 uid/gids
-  ;; is used to cover 16 bits worth of users and groups, which is sufficient
-  ;; for most cases.
-  ;;
-  ;; See also: http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--private-users=
-  (let* ((uid   (getuid))
- (gid   (getgid))
- (uid-range (if (zero? uid) 65536 1))
- (gid-range (if (zero? gid) 65536 1)))
+  (let ((uid (getuid))
+(gid (getgid)))
 
 ;; Only root can write to the gid map without first disabling the
 ;; setgroups syscall.
@@ -149,10 +143,10 @@ to ROOT, then make ROOT the new root directory for the process.
 ;; within the container.
 (call-with-output-file (scope /uid_map)
   (lambda (port)
-(format port 0 ~d ~d uid uid-range)))
+(format port 0 ~d ~d uid host-uids)))
 (call-with-output-file (scope /gid_map)
   (lambda (port)
-(format port 0 ~d ~d gid gid-range)
+(format port 0 ~d ~d gid host-uids)
 
 (define (namespaces-bit-mask namespaces)
   Return the number suitable for the 'flags' argument of 'clone' that
@@ -167,12 +161,13 @@ corresponds to the symbols in NAMESPACES.
('net  CLONE_NEWNET))
   namespaces)))
 
-(define (run-container root mounts namespaces thunk)
+(define (run-container root mounts namespaces host-uids thunk)
   Run THUNK in a new container process and return its PID.  ROOT specifies
 the root directory for the container.  MOUNTS is a list of file system specs
 that specify the mapping of host file systems into the container.  NAMESPACES
 is a list of symbols that correspond to the possible Linux namespaces: mnt,
-ipc, uts, user, and net.
+ipc, uts, user, and net.  HOST-UIDS specifies the number of
+host user identifiers to map into the user namespace.
   ;; The parent process must initialize the user namespace for the child
   ;; before it can boot.  To negotiate this, a pipe is used such that the
   ;; child process blocks until the parent writes to it.
@@ -196,26 +191,31 @@ ipc, uts, user, and net.
  (thunk
  (pid
   (when (memq 'user namespaces)
-(initialize-user-namespace pid))
+(initialize-user-namespace pid host-uids))
   ;; TODO: Initialize cgroups.
   (close in)
   (write 'ready out)
   (close out)
   pid))
 
-(define* (call-with-container mounts thunk #:key (namespaces %namespaces))
+(define* (call-with-container mounts thunk #:key (namespaces %namespaces)
+  (host-uids 1))
   Run THUNK in a new container process and return its exit status.
 MOUNTS is a list of file system specs that specify the mapping of host file
 systems into the container.  NAMESPACES is a list of symbols corresponding to
 the identifiers for Linux namespaces: mnt, ipc, uts, pid, user, and net.  By
-default, all namespaces are used.
+default, all namespaces are used.  HOST-UIDS is the number of host user
+identifiers to map into the container's user namespace, if there is one.  By
+default, only a single uid/gid, that of the current user, is mapped

[PATCH] build: ruby: Rewrite build system to use gem archives.

2015-07-28 Thread David Thompson
Hello Guix hackers,

This patch represents a large change to how we're building Ruby
packages.  Previously, we would download tarballs (mostly auto-generated
ones on GitHub), build the .gem archive, then install it to the output
directory.  This method presented several issues.  No one besides us is
actually using these tarballs to build gems, and often the gems will not
build outside of a git repository due to the proliferation of 'git
ls-files' usage when building the gem.

After some more exploration, those of us interested in Ruby packaging
agreed that the pre-made .gem archives hosted on rubygems.org are in
fact source code, and that our build system could be greatly simplified
by using them.  Using these gem archives will also allow for a 'guix
import rubygems' tool to be written, greatly accelerating our packaging
efforts.

One known caveat is that not all gem archives include the test suite, so
sometimes we have to do without tests.  However, the Ruby dependency
graph already has other testing issues like rampant circular
dependencies, so I don't think this issue is a big deal in comparison.
Anyway, I only had to disable a couple of test suites for existing gems,
and I was happy that the issue wasn't too widespread among our
(currently small) sample size.

One other caveat is that downloading gems from rubygems.org currently
*does not* work because the HTTP responses include an invalid
Content-Type header.  I added a temporary hack to do my development
work (not in this patch), and I'm currently waiting on a response from
the rubygems.org admins to see if they will fix the issue.  So, this
patch should not be applied until this is resolved.

See: 
http://help.rubygems.org/discussions/problems/21223-invalid-content-type-header-when-downloading-gem-archive?unresolve=true

Without further ado, the patch:

From 70c827becb2ef3909e817091676425eacb32d381 Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sun, 26 Jul 2015 22:01:54 -0400
Subject: [PATCH] build: ruby: Rewrite build system to use gem archives.

Co-Authored-By: Pjotr Prins pjotr.publi...@thebird.nl

* guix/build-system/ruby.scm (lower): Remove git dependency.
  (rubygems-uri): New procedure.
* guix/build/ruby-build-system (gitify, build): Delete.
  (unpack): Use 'gem unpack' utility.
  (check): Add docstring.
  (install): Install the source gem archive.
  (%standard-phases): Remove gitify and build phases.
* gnu/packages/ruby.scm (ruby-hoe, ruby-rake-compiler, ruby-i18n,
  ruby-rspec-support, ruby-rspec-core, ruby-diff-lcs-for-rspec,
  ruby-rspec-expectations, ruby-rspec-mocks, ruby-rspec, bundler,
  ruby-useragent, ruby-bacon, ruby-arel, ruby-connection-pool,
  ruby-net-http-persistent, ruby-minitest, ruby-minitest-sprint,
  ruby-minitest-bacon, ruby-daemons, ruby-git, ruby-slop,
  ruby-multipart-post): Convert to new build system.
---
 gnu/packages/ruby.scm| 222 +++
 guix/build-system/ruby.scm   |  40 +++
 guix/build/ruby-build-system.scm |  39 ---
 3 files changed, 104 insertions(+), 197 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index a481365..196094c 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -154,13 +154,11 @@ a focus on simplicity and productivity.)
 (name ruby-hoe)
 (version 3.13.1)
 (source (origin
-  (method git-fetch)
-  (uri (git-reference
-(url https://github.com/seattlerb/hoe.git;)
-(commit 0c11836))) ; no release tags :(
+  (method url-fetch)
+  (uri (rubygems-uri hoe version))
   (sha256
(base32
-0i8dimf8kxcjgqj9x65bbi3l6hc9p9gbfbb1vmrz42764a4jjbz9))) )
+1mac13krdrasn9819dd65xj27kklfy0xdbj3p6s2ij4vlcb46h8q))) )
 (build-system ruby-build-system)
 (synopsis Ruby project management helper)
 (description
@@ -178,22 +176,13 @@ announcement.)
 (version 0.9.5)
 (source (origin
   (method url-fetch)
-  (uri (string-append
-https://github.com/rake-compiler/rake-compiler/archive/v;
-version .tar.gz))
-  (file-name (string-append name - version .tar.gz))
+  (uri (rubygems-uri rake-compiler version))
   (sha256
(base32
-07lk1vl0jqcaqwjjhmg0qshqwcxdyr5kscc9xxm13m03835xgpf3
+1k8im2vzj849xdgjk6wafspkiwwapqwm738majchb4dnhnsk64cx
 (build-system ruby-build-system)
 (arguments
- '(#:tests? #f ; needs cucumber
-   #:phases (modify-phases %standard-phases
-  (add-before 'build 'remove-cucumber-rake-task
-(lambda _
-  ;; Remove cucumber test file because the
-  ;; dependencies are not available right now.
-  (delete-file tasks/cucumber.rake))
+ '(#:tests? #f

[PATCH] tests: Skip container tests if namespaces are not available.

2015-07-20 Thread David Thompson
Repairing the damage I've done to the test suite.  I don't have a
GNU/Linux machine with an old enough kernel to check that the tests are
indeed skipped, but I did verify that the tests still run when user
namespaces are available.

Ludovic, this is exactly the code you suggested on IRC.  Does it still
look OK? :)

From 8bff3d1e44dfe72f1f74a8a1a4aa1cac4013b9c0 Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Mon, 20 Jul 2015 12:05:23 -0400
Subject: [PATCH] tests: Skip container tests if namespaces are not available.

* tests/containers.scm: Skip all tests if user namespaces do not exist.
---
 tests/containers.scm | 4 
 1 file changed, 4 insertions(+)

diff --git a/tests/containers.scm b/tests/containers.scm
index 43401a5..cb1aedd 100644
--- a/tests/containers.scm
+++ b/tests/containers.scm
@@ -26,6 +26,10 @@
 (define (assert-exit x)
   (primitive-exit (if x 0 1)))
 
+;; Skip these tests unless user namespaces are available.
+(unless (file-exists? /proc/self/ns/user)
+  (exit 77))
+
 (test-begin containers)
 
 (test-assert call-with-container, user namespace
-- 
2.4.3


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] gnu: Add hoedown.

2015-07-19 Thread David Thompson
Here's a package recipe for a Markdown library written in C.  I want to
try to make Guile bindings for it with the FFI.

From 567748faa4e3e03fe9b106a8ea61843a2d31409d Mon Sep 17 00:00:00 2001
From: David Thompson dthomps...@worcester.edu
Date: Sun, 19 Jul 2015 10:41:34 -0400
Subject: [PATCH] gnu: Add hoedown.

* gnu/packages/markdown.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
---
 gnu-system.am |  1 +
 gnu/packages/markdown.scm | 59 +++
 2 files changed, 60 insertions(+)
 create mode 100644 gnu/packages/markdown.scm

diff --git a/gnu-system.am b/gnu-system.am
index fb661d4..5fd5870 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -201,6 +201,7 @@ GNU_SYSTEM_MODULES =\
   gnu/packages/man.scm\
   gnu/packages/mail.scm\
   gnu/packages/make-bootstrap.scm		\
+  gnu/packages/markdown.scm			\
   gnu/packages/maths.scm			\
   gnu/packages/mc.scm\
   gnu/packages/mcrypt.scm			\
diff --git a/gnu/packages/markdown.scm b/gnu/packages/markdown.scm
new file mode 100644
index 000..42af2ae
--- /dev/null
+++ b/gnu/packages/markdown.scm
@@ -0,0 +1,59 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 David Thompson da...@gnu.org
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see http://www.gnu.org/licenses/.
+
+(define-module (gnu packages markdown)
+  #:use-module (guix licenses)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix packages)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages web))
+
+(define-public hoedown
+  (package
+(name hoedown)
+(version 3.0.3)
+(source (origin
+ (method url-fetch)
+ (uri (string-append https://github.com/hoedown/hoedown/archive/;
+ version .tar.gz))
+ (file-name (string-append name - version .tar.gz))
+ (sha256
+  (base32
+   0mmmkfayqgh6k39kbi3pq68mg03x35aiygy3zypxzvwx9y8b53ky
+(build-system gnu-build-system)
+(arguments
+ '(#:phases (modify-phases %standard-phases
+  (add-before 'build 'fix-makefile
+  (lambda* (#:key outputs #:allow-other-keys)
+(setenv CC gcc)
+(substitute* '(Makefile)
+  ((/usr/local)
+   (assoc-ref outputs out)))
+#t))
+  (delete 'configure)) ; no configure script
+   #:test-target test))
+(native-inputs
+ `((python ,python-2)
+   (tidy ,tidy)))
+(synopsis Markdown processing library)
+(description Hoedown is a standards compliant, fast, secure markdown
+processing library written in C.)
+(home-page https://github.com/hoedown/hoedown;)
+(license expat)))
-- 
2.4.3


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH 07/15] build: syscalls: Add pivot-root.

2015-07-06 Thread David Thompson
From: David Thompson da...@gnu.org

* guix/build/syscalls.scm (pivot-root): New procedure.
* tests/syscalls.scm: Test it.
---
 guix/build/syscalls.scm | 15 +++
 tests/syscalls.scm  | 24 
 2 files changed, 39 insertions(+)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 827a79d..e319368 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -46,6 +46,7 @@
 swapoff
 processes
 mkdtemp!
+pivot-root
 
 CLONE_NEWNS
 CLONE_NEWUTS
@@ -326,6 +327,20 @@ reassociated with, or 0 if there is no such limitation.
  (list fdes nstype (strerror err))
  (list err)))
 
+(define pivot-root
+  (let* ((ptr  (dynamic-func pivot_root (dynamic-link)))
+ (proc (pointer-procedure int ptr (list '* '*
+(lambda (new-root put-old)
+  Change the root file system to NEW-ROOT and move the current root file
+system to PUT-OLD.
+  (let ((ret (proc (string-pointer new-root)
+   (string-pointer put-old)))
+(err (errno)))
+(unless (zero? ret)
+  (throw 'system-error pivot_root ~S ~S: ~A
+ (list new-root put-old (strerror err))
+ (list err)))
+
 
 ;;;
 ;;; Packed structures.
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 80d2788..e34d37d 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -18,6 +18,7 @@
 ;;; along with GNU Guix.  If not, see http://www.gnu.org/licenses/.
 
 (define-module (test-syscalls)
+  #:use-module (guix utils)
   #:use-module (guix build syscalls)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
@@ -112,6 +113,29 @@
(equal? (readlink (user-namespace clone-pid))
(readlink (user-namespace fork-pid))
 
+(test-assert pivot-root
+  (match (pipe)
+((in . out)
+ (match (clone (logior CLONE_NEWUSER CLONE_NEWNS))
+   (0
+(close in)
+(call-with-temporary-directory
+ (lambda (root)
+   (let ((put-old (string-append root /real-root)))
+ (mount none root tmpfs)
+ (mkdir put-old)
+ (call-with-output-file (string-append root /test)
+   (lambda (port)
+ (display testing\n port)))
+ (pivot-root root put-old)
+ ;; The test file should now be located inside the root directory.
+ (write (file-exists /test) out)
+ (close out
+(primitive-exit 0))
+   (pid
+(close out)
+(read in))
+
 (test-assert all-network-interfaces
   (match (all-network-interfaces)
 (((? string? names) ..1)
-- 
2.4.3




[PATCH 04/15] utils: Add call-with-temporary-directory.

2015-07-06 Thread David Thompson
From: David Thompson da...@gnu.org

* guix/utils.scm (call-with-temporary-directory): New procedure.
---
 guix/utils.scm | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/guix/utils.scm b/guix/utils.scm
index a2ade2b..44913c6 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -30,7 +30,7 @@
   #:use-module (rnrs bytevectors)
   #:use-module ((rnrs io ports) #:select (put-bytevector))
   #:use-module ((guix build utils) #:select (dump-port))
-  #:use-module ((guix build syscalls) #:select (errno))
+  #:use-module ((guix build syscalls) #:select (errno mkdtemp!))
   #:use-module (ice-9 vlist)
   #:use-module (ice-9 format)
   #:autoload   (ice-9 popen)  (open-pipe*)
@@ -77,6 +77,7 @@
 file-extension
 file-sans-extension
 call-with-temporary-output-file
+call-with-temporary-directory
 with-atomic-file-output
 fold2
 fold-tree
@@ -652,6 +653,19 @@ call.
 (false-if-exception (close out))
 (false-if-exception (delete-file template))
 
+(define (call-with-temporary-directory proc)
+  Call PROC with a name of a temporary directory; close the directory and
+delete it when leaving the dynamic extent of this call.
+  (let* ((directory (or (getenv TMPDIR) /tmp))
+ (template  (string-append directory /guix-directory.XX))
+ (tmp-dir   (mkdtemp! template)))
+(dynamic-wind
+  (const #t)
+  (lambda ()
+(proc tmp-dir))
+  (lambda ()
+(false-if-exception (rmdir tmp-dir))
+
 (define (with-atomic-file-output file proc)
   Call PROC with an output port for the file that is going to replace FILE.
 Upon success, FILE is atomically replaced by what has been written to the
-- 
2.4.3




[PATCH 03/15] build: syscalls: Add mkdtemp!

2015-07-06 Thread David Thompson
From: David Thompson da...@gnu.org

* guix/build/syscalls.scm (mkdtemp!): New procedure.
* tests/syscalls.scm: Test it.
---
 guix/build/syscalls.scm | 15 +++
 tests/syscalls.scm  |  9 +
 2 files changed, 24 insertions(+)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 6d31510..a464040 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -45,6 +45,7 @@
 swapon
 swapoff
 processes
+mkdtemp!
 
 IFF_UP
 IFF_BROADCAST
@@ -265,6 +266,20 @@ user-land process.
 (scandir /proc))
 ))
 
+(define mkdtemp!
+  (let* ((ptr  (dynamic-func mkdtemp (dynamic-link)))
+ (proc (pointer-procedure '* ptr '(*
+(lambda (tmpl)
+  Create a new unique directory in the file system using the template
+string TMPL and return its file name.  TMPL must end with 'XX'.
+  (let ((result (proc (string-pointer tmpl)))
+(err(errno)))
+(when (null-pointer? result)
+  (throw 'system-error mkdtemp! ~S: ~A
+ (list tmpl (strerror err))
+ (list err)))
+(pointer-string result)
+
 
 ;;;
 ;;; Packed structures.
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 706f3df..049ca93 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015 Ludovic Courtès l...@gnu.org
+;;; Copyright © 2015 David Thompson da...@gnu.org
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -67,6 +68,14 @@
 (lambda args
   (memv (system-error-errno args) (list EPERM EINVAL ENOENT)
 
+(test-assert mkdtemp!
+  (let* ((tmp (or (getenv TMPDIR) /tmp))
+ (dir (mkdtemp! (string-append tmp /guix-test-XX
+(and (file-exists? dir)
+ (begin
+   (rmdir dir)
+   #t
+
 (test-assert all-network-interfaces
   (match (all-network-interfaces)
 (((? string? names) ..1)
-- 
2.4.3




[PATCH 01/15] build: syscalls: Add additional mount flags.

2015-07-06 Thread David Thompson
From: David Thompson da...@gnu.org

* guix/build/syscalls.scm (MS_NOSUID, MS_NODEV, MS_NOEXEC, MS_STRICTATIME):
  New variables.
---
 guix/build/syscalls.scm | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 3585bf2..ec1ce89 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015 Ludovic Courtès l...@gnu.org
+;;; Copyright © 2015 David Thompson da...@gnu.org
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26,9 +27,13 @@
   #:use-module (ice-9 ftw)
   #:export (errno
 MS_RDONLY
+MS_NOSUID
+MS_NODEV
+MS_NOEXEC
 MS_REMOUNT
 MS_BIND
 MS_MOVE
+MS_STRICTATIME
 restart-on-EINTR
 mount
 umount
@@ -136,10 +141,14 @@
 entries
 
 ;; Linux mount flags, from libc's sys/mount.h.
-(define MS_RDONLY  1)
-(define MS_REMOUNT32)
-(define MS_BIND 4096)
-(define MS_MOVE 8192)
+(define MS_RDONLY 1)
+(define MS_NOSUID 2)
+(define MS_NODEV  4)
+(define MS_NOEXEC 8)
+(define MS_REMOUNT   32)
+(define MS_BIND4096)
+(define MS_MOVE8192)
+(define MS_STRICTATIME 16777216)
 
 (define mount
   (let* ((ptr  (dynamic-func mount (dynamic-link)))
-- 
2.4.3




[PATCH 11/15] gnu: system: Add Linux container module.

2015-07-06 Thread David Thompson
From: David Thompson da...@gnu.org

* gnu/system/linux-container.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* gnu/system.scm: Export 'operating-system-etc-directory',
  'operating-system-boot-script', 'operating-system-locale-directory', and
  'file-union'.
  (operating-system-boot-script): Add #:container? keyword argument.
  (operating-system-activation-script): Add #:container?  keyword argument.
  Don't call 'activate-firmware' or 'activate-ptrace-attach' when activating a
  container.
---
 gnu-system.am  |  1 +
 gnu/system.scm | 27 -
 gnu/system/linux-container.scm | 90 ++
 3 files changed, 109 insertions(+), 9 deletions(-)
 create mode 100644 gnu/system/linux-container.scm

diff --git a/gnu-system.am b/gnu-system.am
index 48dbc5f..cfc2999 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -346,6 +346,7 @@ GNU_SYSTEM_MODULES =\
   gnu/system/grub.scm  \
   gnu/system/install.scm   \
   gnu/system/linux.scm \
+  gnu/system/linux-container.scm   \
   gnu/system/linux-initrd.scm  \
   gnu/system/locale.scm\
   gnu/system/nss.scm   \
diff --git a/gnu/system.scm b/gnu/system.scm
index 82b7fbc..476d901 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -82,6 +82,11 @@
 operating-system-derivation
 operating-system-profile
 operating-system-grub.cfg
+operating-system-etc-directory
+operating-system-locale-directory
+operating-system-boot-script
+
+file-union
 
 local-host-aliases
 %setuid-programs
@@ -679,7 +684,7 @@ variable is not set---hence the need for this wrapper.
   (apply execl #$modprobe
  (cons #$modprobe (cdr (command-line
 
-(define (operating-system-activation-script os)
+(define* (operating-system-activation-script os #:key container?)
   Return the activation script for OS---i.e., the code that \activates\ the
 stateful part of OS, including user accounts and groups, special directories,
 etc.
@@ -752,12 +757,15 @@ etc.
 ;; Tell the kernel to use our 'modprobe' command.
 (activate-modprobe #$modprobe)
 
-;; Tell the kernel where firmware is.
-(activate-firmware
- (string-append #$firmware /lib/firmware))
-
-;; Let users debug their own processes!
-(activate-ptrace-attach)
+;; Tell the kernel where firmware is, unless we are
+;; activating a container.
+#$@(if container?
+   #~()
+   ;; Tell the kernel where firmware is.
+   #~((activate-firmware
+   (string-append #$firmware /lib/firmware))
+  ;; Let users debug their own processes!
+  (activate-ptrace-attach)))
 
 ;; Run the services' activation snippets.
 ;; TODO: Use 'load-compiled'.
@@ -766,11 +774,12 @@ etc.
 ;; Set up /run/current-system.
 (activate-current-system)
 
-(define (operating-system-boot-script os)
+(define* (operating-system-boot-script os #:key container?)
   Return the boot script for OS---i.e., the code started by the initrd once
 we're running in the final root.
   (mlet* %store-monad ((services (operating-system-services os))
-   (activate (operating-system-activation-script os))
+   (activate (operating-system-activation-script
+  os #:container? container?))
(dmd-conf (dmd-configuration-file services)))
 (gexp-file boot
 #~(begin
diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm
new file mode 100644
index 000..5368dec
--- /dev/null
+++ b/gnu/system/linux-container.scm
@@ -0,0 +1,90 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 David Thompson da...@gnu.org
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General

[PATCH 0/15] Add preliminary support for Linux containers

2015-07-06 Thread David Thompson
)= 0
[pid 10624] readlink(/proc/10624/ns/pid, pid:[4026531836], 4095) = 16
[pid 10624] readlink(/proc/10623/ns/pid, pid:[4026532344], 4095) = 16
[pid 10624] setns(20, 0)= 0
[pid 10624] readlink(/proc/10624/ns/mnt, mnt:[4026531840], 4095) = 16
[pid 10624] readlink(/proc/10623/ns/mnt, mnt:[4026532288], 4095) = 16
[pid 10624] setns(21, 0)= 0
[pid 10624] chdir(/)  = 0
[pid 10624] clone( unfinished ...
[pid 10623] chdir(/)  = 0
[pid 10624] ... clone resumed child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0x7fbcc058aa10) = 10625
[pid 10625] readlink(/proc/2/ns/user, 0x8ed0d0, 100) = -1 EACCES 
(Permission denied)

Success:

[pid 12387] clone(child_stack=0, 
flags=CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER|CLONE_NEWPID|CLONE_NEWNET|SIGCHLD)
 = 12402
[pid 12402] chdir(/)  = 0
[pid 12402] +++ exited with 0 +++
[pid 12387] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=12402, 
si_status=0, si_utime=0, si_stime=0} ---
[pid 12387] clone(child_stack=0, 
flags=CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER|CLONE_NEWPID|CLONE_NEWNET|SIGCHLD)
 = 12403
[pid 12387] readlink(/proc/12403/ns/user, user:[4026532287], 100) = 17
[pid 12387] readlink(/proc/12403/ns/ipc, ipc:[4026532290], 100) = 16
[pid 12387] readlink(/proc/12403/ns/uts, uts:[4026532289], 100) = 16
[pid 12387] readlink(/proc/12403/ns/net, net:[4026532292], 100) = 16
[pid 12387] readlink(/proc/12403/ns/pid, pid:[4026532344], 100) = 16
[pid 12387] readlink(/proc/12403/ns/mnt, mnt:[4026532288], 100) = 16
[pid 12387] clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0x7f4d67124a10) = 12404
[pid 12404] readlink(/proc/12404/ns/user, user:[4026531837], 4095) = 17
[pid 12404] readlink(/proc/12403/ns/user, user:[4026532287], 4095) = 17
[pid 12404] setns(16, 0)= 0
[pid 12404] readlink(/proc/12404/ns/ipc, ipc:[4026531839], 4095) = 16
[pid 12404] readlink(/proc/12403/ns/ipc, ipc:[4026532290], 4095) = 16
[pid 12404] setns(17, 0)= 0
[pid 12404] readlink(/proc/12404/ns/uts, uts:[4026531838], 4095) = 16
[pid 12404] readlink(/proc/12403/ns/uts, uts:[4026532289], 4095) = 16
[pid 12404] setns(18, 0)= 0
[pid 12404] readlink(/proc/12404/ns/net, net:[4026531969], 4095) = 16
[pid 12404] readlink(/proc/12403/ns/net, net:[4026532292], 4095) = 16
[pid 12404] setns(19, 0)= 0
[pid 12404] readlink(/proc/12404/ns/pid, pid:[4026531836], 4095) = 16
[pid 12404] readlink(/proc/12403/ns/pid, pid:[4026532344], 4095) = 16
[pid 12404] setns(20, 0)= 0
[pid 12404] readlink(/proc/12404/ns/mnt, mnt:[4026531840], 4095) = 16
[pid 12404] readlink(/proc/12403/ns/mnt, mnt:[4026532288], 4095) = 16
[pid 12404] setns(21, 0)= 0
[pid 12403] chdir(/)  = 0
[pid 12404] chdir(/)  = 0
[pid 12404] clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0x7f4d67124a10) = 12406
[pid 12406] readlink(/proc/2/ns/user, user:[4026532287], 100) = 17
[pid 12406] readlink(/proc/2/ns/ipc, ipc:[4026532290], 100) = 16
[pid 12406] readlink(/proc/2/ns/uts, uts:[4026532289], 100) = 16
[pid 12406] readlink(/proc/2/ns/net, net:[4026532292], 100) = 16
[pid 12406] readlink(/proc/2/ns/pid, pid:[4026532344], 100) = 16
[pid 12406] readlink(/proc/2/ns/mnt, mnt:[4026532288], 100) = 16

In both cases, all of the 'setns' system calls succeed, but the EACCES
error leads me to believe that the excursion process is somehow *not* a
member of the necessary mount namespace.  I haven't seen this failure
when running the 'guix container exec' command which uses
'container-excursion', so I'm suspecting that there may be a race
condition to address.

tl;dr: Containers!  There's a bug in a test!  Help!

Happy hacking,

-- 
David Thompson
GPG Key: 0FF1D807



[PATCH 12/15] gnu: system: Add Linux container file systems.

2015-07-06 Thread David Thompson
From: David Thompson da...@gnu.org

* gnu/system/file-systems.scm (%container-file-systems): New variable.
---
 gnu/system/file-systems.scm | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index b33f826..23998dd 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -45,6 +45,7 @@
 %control-groups
 
 %base-file-systems
+%container-file-systems
 
 mapped-device
 mapped-device?
@@ -198,6 +199,35 @@ initrd code.
 %immutable-store)
   %control-groups))
 
+(define %container-file-systems
+  (list
+   ;; Psuedo-terminal file system.
+   (file-system
+ (device none)
+ (mount-point /dev/pts)
+ (type devpts)
+ (flags '(no-exec no-suid))
+ (needed-for-boot? #t)
+ (create-mount-point? #t)
+ (options newinstance,ptmxmode=0666,mode=620))
+   ;; Shared memory file system.
+   (file-system
+ (device tmpfs)
+ (mount-point /dev/shm)
+ (type tmpfs)
+ (flags '(no-exec no-suid no-dev))
+ (options mode=1777,size=65536k)
+ (needed-for-boot? #t)
+ (create-mount-point? #t))
+   ;; Message queue file system.
+   (file-system
+ (device mqueue)
+ (mount-point /dev/mqueue)
+ (type mqueue)
+ (flags '(no-exec no-suid no-dev))
+ (needed-for-boot? #t)
+ (create-mount-point? #t
+
 
 
 ;;;
-- 
2.4.3




[PATCH 06/15] build: syscalls: Add setns syscall wrapper.

2015-07-06 Thread David Thompson
From: David Thompson da...@gnu.org

* guix/build/syscalls.scm (setns): New procedure.
* tests/syscalls.scm: Test it.
---
 guix/build/syscalls.scm | 15 +++
 tests/syscalls.scm  | 21 +
 2 files changed, 36 insertions(+)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 1e5b3f7..827a79d 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -54,6 +54,7 @@
 CLONE_NEWPID
 CLONE_NEWNET
 clone
+setns
 
 IFF_UP
 IFF_BROADCAST
@@ -311,6 +312,20 @@ Unlike the fork system call, clone accepts FLAGS that 
specify which resources
 are shared between the parent and child processes.
   (proc syscall-id flags %null-pointer
 
+(define setns
+  (let* ((ptr  (dynamic-func setns (dynamic-link)))
+ (proc (pointer-procedure int ptr (list int int
+(lambda (fdes nstype)
+  Reassociate the current process with the namespace specified by FDES.
+NSTYPE specifies which type of namespace the current process may be
+reassociated with, or 0 if there is no such limitation.
+  (let ((ret (proc fdes nstype))
+(err (errno)))
+(unless (zero? ret)
+  (throw 'system-error setns ~d ~d: ~A
+ (list fdes nstype (strerror err))
+ (list err)))
+
 
 ;;;
 ;;; Packed structures.
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 9902279..80d2788 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -90,6 +90,27 @@
  (not (equal? (readlink (user-namespace pid))
   (readlink (user-namespace self)))
 
+(test-assert setns
+  (match (clone (logior CLONE_NEWUSER))
+(0 (primitive-exit 0))
+(clone-pid
+ (match (pipe)
+   ((in . out)
+(match (primitive-fork)
+  (0
+   (close in)
+   (call-with-input-file (user-namespace clone-pid)
+ (lambda (port)
+   (setns (port-fdes port) 0)))
+   (write 'done out)
+   (close out)
+   (primitive-exit 0))
+  (fork-pid
+   (close out)
+   ;; Wait for the child process to join the namespace.
+   (read in)
+   (equal? (readlink (user-namespace clone-pid))
+   (readlink (user-namespace fork-pid))
 
 (test-assert all-network-interfaces
   (match (all-network-interfaces)
-- 
2.4.3




[PATCH 15/15] scripts: Add 'container' subcommand.

2015-07-06 Thread David Thompson
From: David Thompson da...@gnu.org

* guix/scripts/container.scm: New file.
* guix/scripts/container/exec.scm: New file.
* doc/guix.texi (Invoking guix container): New section.
* Makefile.am (MODULES): Add them.
---
 Makefile.am |  2 ++
 doc/guix.texi   | 46 +++-
 guix/scripts/container.scm  | 62 
 guix/scripts/container/exec.scm | 79 +
 4 files changed, 188 insertions(+), 1 deletion(-)
 create mode 100644 guix/scripts/container.scm
 create mode 100644 guix/scripts/container/exec.scm

diff --git a/Makefile.am b/Makefile.am
index 569ea6f..b2adeed 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -116,6 +116,8 @@ MODULES =   \
   guix/scripts/publish.scm \
   guix/scripts/edit.scm\
   guix/scripts/size.scm\
+  guix/scripts/container.scm   \
+  guix/scripts/container/exec.scm  \
   guix.scm \
   $(GNU_SYSTEM_MODULES)
 
diff --git a/doc/guix.texi b/doc/guix.texi
index 57fc446..a207a39 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -134,6 +134,7 @@ Utilities
 * Invoking guix size::  Profiling disk usage.
 * Invoking guix environment::   Setting up development environments.
 * Invoking guix publish::   Sharing substitutes.
+* Invoking guix container:: Process isolation.
 
 GNU Distribution
 
@@ -2770,7 +2771,7 @@ omitted since it will take place implicitly, as we will 
see later
 @end example
 
 @c See
-@c 
https://syntaxexclamation.wordpress.com/2014/06/26/escaping-continuations/ 
+@c https://syntaxexclamation.wordpress.com/2014/06/26/escaping-continuations/
 @c for the funny quote.
 Calling the monadic @code{sh-symlink} has no effect.  As someone once
 said, ``you exit a monad like you exit a building on fire: by running''.
@@ -3332,6 +,7 @@ programming interface of Guix in a convenient way.
 * Invoking guix size::  Profiling disk usage.
 * Invoking guix environment::   Setting up development environments.
 * Invoking guix publish::   Sharing substitutes.
+* Invoking guix container:: Process isolation.
 @end menu
 
 @node Invoking guix build
@@ -4339,6 +4341,48 @@ Reference Manual}) on @var{port} (37146 by default).  
This is used
 primarily for debugging a running @command{guix publish} server.
 @end table
 
+@node Invoking guix container
+@section Invoking @command{guix container}
+
+The purpose of @command{guix container} is to manipulate processes
+running within an isolated environment, commonly known as a
+``container.''
+
+The general syntax is:
+
+@example
+guix container @var{action} @var{options}@dots{}
+@end example
+
+@var{action} specifies the operation to perform with a container, and
+@var{options} specifies the context-specific arguments for the action.
+
+The following actions are available:
+
+@table @code
+@item exec
+Execute a command within the context of a running container.
+
+The syntax is:
+
+@example
+guix container exec @var{pid} @var{program} @var{arguments}@dots{}
+@end example
+
+@var{pid} specifies the process ID of the running container.
+@var{program} specifies an executable file name within the container's
+root file system.  @var{arguments} are the additional options that will
+be passed to @var{program}.
+
+The following command launches an interactive login shell inside a
+GuixSD container whose process ID is 9001:
+
+@example
+guix container exec 9001 /run/current-system/profile/bin/bash --login
+@end example
+
+@end table
+
 @c *
 @node GNU Distribution
 @chapter GNU Distribution
diff --git a/guix/scripts/container.scm b/guix/scripts/container.scm
new file mode 100644
index 000..059451c
--- /dev/null
+++ b/guix/scripts/container.scm
@@ -0,0 +1,62 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 David Thompson da...@gnu.org
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see http://www.gnu.org/licenses/.
+
+(define-module (guix scripts container)
+  #:use-module (ice-9 match)
+  #:use-module (guix ui)
+  #:export (guix-container))
+
+(define (show-help)
+  (display (_ Usage: guix container ACTION ARGS...
+Build

[PATCH 05/15] build: syscalls: Add clone syscall wrapper.

2015-07-06 Thread David Thompson
From: David Thompson da...@gnu.org

* guix/build/syscalls.scm (clone): New procedure.
  (CLONE_NEWNS, CLONE_NEWUTS, CLONE_NEWIPC, CLONE_NEWUSER, CLONE_NEWPID,
  CLONE_NEWNET): New variables.
* tests/syscalls.scm: Test it.
---
 guix/build/syscalls.scm | 31 +++
 tests/syscalls.scm  | 15 +++
 2 files changed, 46 insertions(+)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index a464040..1e5b3f7 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -47,6 +47,14 @@
 processes
 mkdtemp!
 
+CLONE_NEWNS
+CLONE_NEWUTS
+CLONE_NEWIPC
+CLONE_NEWUSER
+CLONE_NEWPID
+CLONE_NEWNET
+clone
+
 IFF_UP
 IFF_BROADCAST
 IFF_LOOPBACK
@@ -280,6 +288,29 @@ string TMPL and return its file name.  TMPL must end with 
'XX'.
  (list err)))
 (pointer-string result)
 
+;; Linux clone flags, from linux/sched.h
+(define CLONE_NEWNS   #x0002)
+(define CLONE_NEWUTS  #x0400)
+(define CLONE_NEWIPC  #x0800)
+(define CLONE_NEWUSER #x1000)
+(define CLONE_NEWPID  #x2000)
+(define CLONE_NEWNET  #x4000)
+
+;; The libc interface to sys_clone is not useful for Scheme programs, so the
+;; low-level system call is wrapped instead.
+(define clone
+  (let* ((ptr(dynamic-func syscall (dynamic-link)))
+ (proc   (pointer-procedure int ptr (list int int '*)))
+ ;; TODO: Handle all supported architectures
+ (syscall-id (match (utsname:machine (uname))
+   (x86_64 56)
+   (_120
+(lambda (flags)
+  Create a new child process by duplicating the current parent process.
+Unlike the fork system call, clone accepts FLAGS that specify which resources
+are shared between the parent and child processes.
+  (proc syscall-id flags %null-pointer
+
 
 ;;;
 ;;; Packed structures.
diff --git a/tests/syscalls.scm b/tests/syscalls.scm
index 049ca93..9902279 100644
--- a/tests/syscalls.scm
+++ b/tests/syscalls.scm
@@ -76,6 +76,21 @@
(rmdir dir)
#t
 
+(define (user-namespace pid)
+  (match pid
+(self /proc/self/ns/user)
+((and (? number?) (= number-string pid))
+ (string-append /proc/ pid /ns/user
+
+(test-assert clone
+  (match (clone (logior CLONE_NEWUSER))
+(0 (primitive-exit 0))
+(pid
+ ;; Check if user namespaces are different.
+ (not (equal? (readlink (user-namespace pid))
+  (readlink (user-namespace self)))
+
+
 (test-assert all-network-interfaces
   (match (all-network-interfaces)
 (((? string? names) ..1)
-- 
2.4.3




[PATCH 10/15] gnu: system: Move file-system-spec to (gnu system file-systems).

2015-07-06 Thread David Thompson
From: David Thompson da...@gnu.org

* gnu/system/linux-initrd.scm (file-system-spec): Move this...
* gnu/system/file-systems.scm: ... to here.
---
 gnu/system/file-systems.scm | 10 ++
 gnu/system/linux-initrd.scm |  7 ---
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index cbaca88..b33f826 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -17,6 +17,7 @@
 ;;; along with GNU Guix.  If not, see http://www.gnu.org/licenses/.
 
 (define-module (gnu system file-systems)
+  #:use-module (ice-9 match)
   #:use-module (guix gexp)
   #:use-module (guix records)
   #:use-module (guix store)
@@ -33,6 +34,8 @@
 file-system-check?
 file-system-create-mount-point?
 
+file-system-spec
+
 %fuse-control-file-system
 %binary-format-file-system
 %shared-memory-file-system
@@ -95,6 +98,13 @@ file system.
   (or (%file-system-needed-for-boot? fs)
   (string=? / (file-system-mount-point fs
 
+(define (file-system-spec fs)
+  Return a list corresponding to file-system FS that can be passed to the
+initrd code.
+  (match fs
+(($ file-system device title mount-point type flags options _ check?)
+ (list device title mount-point type flags options check?
+
 (define %fuse-control-file-system
   ;; Control file system for Linux' file systems in user-space (FUSE).
   (file-system
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 74dacf1..2b7ae71 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -132,13 +132,6 @@ MODULES and taken from LINUX.
 (guix elf)
 (gnu build linux-modules
 
-(define (file-system-spec fs)
-  Return a list corresponding to file-system FS that can be passed to the
-initrd code.
-  (match fs
-(($ file-system device title mount-point type flags options _ check?)
- (list device title mount-point type flags options check?
-
 (define* (base-initrd file-systems
   #:key
   (linux linux-libre)
-- 
2.4.3




[PATCH 09/15] gnu: system: Move file-system-mapping into (gnu system file-systems).

2015-07-06 Thread David Thompson
From: David Thompson da...@gnu.org

* gnu/system/vm.scm (file-system-mapping, %store-mapping): Move from here...
* gnu/system/file-systems.scm: ...to here.
* guix/scripts/system.scm: Import (gnu system file-systems).
---
 gnu/system/file-systems.scm | 32 +++-
 gnu/system/vm.scm   | 22 --
 guix/scripts/system.scm |  1 +
 3 files changed, 32 insertions(+), 23 deletions(-)

diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 05c77fe..cbaca88 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -52,7 +52,16 @@
 mapped-device-kind
 mapped-device-kind?
 mapped-device-kind-open
-mapped-device-kind-close))
+mapped-device-kind-close
+
+file-system-mapping
+file-system-mapping
+file-system-mapping?
+file-system-mapping-source
+file-system-mapping-target
+file-system-mapping-writable?
+
+%store-mapping))
 
 ;;; Commentary:
 ;;;
@@ -199,4 +208,25 @@ file system.
   (close mapped-device-kind-close ;source target - gexp
  (default (const #~(const #f)
 
+
+;;;
+;;; Shared file systems, for VMs/containers.
+;;;
+
+;; Mapping of host file system SOURCE to mount point TARGET in the guest.
+(define-record-type* file-system-mapping file-system-mapping
+  make-file-system-mapping
+  file-system-mapping?
+  (sourcefile-system-mapping-source)  ;string
+  (targetfile-system-mapping-target)  ;string
+  (writable? file-system-mapping-writable?;Boolean
+ (default #f)))
+
+(define %store-mapping
+  ;; Mapping of the host's store into the guest.
+  (file-system-mapping
+   (source (%store-prefix))
+   (target (%store-prefix))
+   (writable? #f)))
+
 ;;; file-systems.scm ends here
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index e194ed6..690022d 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -58,12 +58,6 @@
 qemu-image
 system-qemu-image
 
-file-system-mapping
-file-system-mapping?
-file-system-mapping-source
-file-system-mapping-target
-file-system-mapping-writable?
-
 system-qemu-image/shared-store
 system-qemu-image/shared-store-script
 system-disk-image))
@@ -354,22 +348,6 @@ of the GNU system as described by OS.
 ;;; VMs that share file systems with the host.
 ;;;
 
-;; Mapping of host file system SOURCE to mount point TARGET in the guest.
-(define-record-type* file-system-mapping file-system-mapping
-  make-file-system-mapping
-  file-system-mapping?
-  (sourcefile-system-mapping-source)  ;string
-  (targetfile-system-mapping-target)  ;string
-  (writable? file-system-mapping-writable?;Boolean
- (default #f)))
-
-(define %store-mapping
-  ;; Mapping of the host's store into the guest.
-  (file-system-mapping
-   (source (%store-prefix))
-   (target (%store-prefix))
-   (writable? #f)))
-
 (define (file-system-mount-tag fs)
   Return a 9p mount tag for host file system FS.
   ;; QEMU mount tags cannot contain slashes and cannot start with '_'.
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index aa9b3f8..6084ab8 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -30,6 +30,7 @@
   #:use-module (guix build utils)
   #:use-module (gnu build install)
   #:use-module (gnu system)
+  #:use-module (gnu system file-systems)
   #:use-module (gnu system vm)
   #:use-module (gnu system grub)
   #:use-module (gnu packages grub)
-- 
2.4.3




[PATCH 1/2] gnu: Make 'mount' interface in static Guile consistent with Guix API.

2015-06-18 Thread David Thompson
From 6efe8e786674d40e01df48c7df9a952107831ad9 Mon Sep 17 00:00:00 2001
From: David Thompson da...@gnu.org
Date: Thu, 18 Jun 2015 20:21:41 -0400
Subject: [PATCH 1/2] gnu: Make 'mount' interface in static Guile consistent
 with Guix API.

Rather than expecting a pointer, the version of 'mount' in
guile-static-stripped now takes a string for the 'options' argument, just like
the 'mount' procedure in (guix build syscalls).

* gnu/packages/patches/guile-linux-syscalls.patch (mount): Expect a string or
  #f for 'options' argument.
* gnu/build/file-systems.scm (mount-file-system): Use new 'mount' interface.
---
 gnu/build/file-systems.scm  |  9 +++--
 gnu/packages/patches/guile-linux-syscalls.patch | 16 +++-
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index dc99d60..72c8bd5 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -286,16 +286,13 @@ run a file system check.
(when check?
  (check-file-system source type))
(mkdir-p mount-point)
-   (mount source mount-point type flags
-  (if options
-  (string-pointer options)
-  %null-pointer))
+   (mount source mount-point type flags options)
 
;; For read-only bind mounts, an extra remount is needed, as per
;; http://lwn.net/Articles/281157/, which still applies to Linux 4.0.
(when (and (= MS_BIND (logand flags MS_BIND))
   (= MS_RDONLY (logand flags MS_RDONLY)))
- (mount source mount-point type (logior MS_BIND MS_REMOUNT MS_RDONLY)
-%null-pointer))
+ (let ((flags (logior MS_BIND MS_REMOUNT MS_RDONLY)))
+   (mount source mount-point type flags #f)))
 
 ;;; file-systems.scm ends here
diff --git a/gnu/packages/patches/guile-linux-syscalls.patch b/gnu/packages/patches/guile-linux-syscalls.patch
index 57c7f25..73a062b 100644
--- a/gnu/packages/patches/guile-linux-syscalls.patch
+++ b/gnu/packages/patches/guile-linux-syscalls.patch
@@ -7,10 +7,10 @@ diff --git a/libguile/posix.c b/libguile/posix.c
 index 324f21b..cbee94d 100644
 --- a/libguile/posix.c
 +++ b/libguile/posix.c
-@@ -2286,6 +2286,261 @@ scm_init_popen (void)
+@@ -2245,6 +2245,267 @@ scm_init_popen (void)
  }
  #endif
- 
+
 +
 +/* Linux! */
 +
@@ -25,15 +25,18 @@ index 324f21b..cbee94d 100644
 +#define FUNC_NAME s_scm_mount
 +{
 +  int err;
-+  char *c_source, *c_target, *c_type;
++  char *c_source, *c_target, *c_type, *c_data;
 +  unsigned long c_flags;
-+  void *c_data;
 +
 +  c_source = scm_to_locale_string (source);
 +  c_target = scm_to_locale_string (target);
 +  c_type = scm_to_locale_string (type);
 +  c_flags = SCM_UNBNDP (flags) ? 0 : scm_to_ulong (flags);
-+  c_data = SCM_UNBNDP (data) ? NULL : scm_to_pointer (data);
++
++  if (SCM_UNBNDP (data) || scm_is_false (data))
++c_data = NULL;
++  else
++c_data = scm_to_locale_string (data);
 +
 +  err = mount (c_source, c_target, c_type, c_flags, c_data);
 +  if (err != 0)
@@ -43,6 +46,9 @@ index 324f21b..cbee94d 100644
 +  free (c_target);
 +  free (c_type);
 +
++  if (c_data != NULL)
++free (c_data);
++
 +  if (err != 0)
 +{
 +  errno = err;
-- 
2.2.1


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH 2/2] gnu: Add control group file systems.

2015-06-18 Thread David Thompson
From 339bc3a744ad07f8513fbbf4b1cfd7955fdf7f1d Mon Sep 17 00:00:00 2001
From: David Thompson da...@gnu.org
Date: Thu, 18 Jun 2015 20:40:57 -0400
Subject: [PATCH 2/2] gnu: Add control group file systems.

* gnu/system/file-systems.scm (%control-groups): New variable.
  (%base-file-system): Include control group file systems.
---
 gnu/system/file-systems.scm | 27 +++
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index db861ba..05c77fe 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -39,6 +39,7 @@
 %pseudo-terminal-file-system
 %devtmpfs-file-system
 %immutable-store
+%control-groups
 
 %base-file-systems
 
@@ -152,13 +153,31 @@ file system.
 (check? #f)
 (flags '(read-only bind-mount
 
+(define %control-groups
+  (cons (file-system
+  (device cgroup)
+  (mount-point /sys/fs/cgroup)
+  (type tmpfs)
+  (check? #f))
+(map (lambda (subsystem)
+   (file-system
+ (device cgroup)
+ (mount-point (string-append /sys/fs/cgroup/ subsystem))
+ (type cgroup)
+ (check? #f)
+ (options subsystem)
+ (create-mount-point? #t)))
+ '(cpuset cpu cpuacct memory devices freezer
+   blkio perf_event hugetlb
+
 (define %base-file-systems
   ;; List of basic file systems to be mounted.  Note that /proc and /sys are
   ;; currently mounted by the initrd.
-  (list %devtmpfs-file-system
-%pseudo-terminal-file-system
-%shared-memory-file-system
-%immutable-store))
+  (append (list %devtmpfs-file-system
+%pseudo-terminal-file-system
+%shared-memory-file-system
+%immutable-store)
+  %control-groups))
 
 
 
-- 
2.2.1


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH 3/3] gnu: Add ruby-multipart-post.

2015-06-13 Thread David Thompson
From 9f7faeee96919ce78991e2c8321a329eab5bda75 Mon Sep 17 00:00:00 2001
From: David Thompson da...@gnu.org
Date: Sat, 13 Jun 2015 08:06:12 -0400
Subject: [PATCH 3/3] gnu: Add ruby-multipart-post.

* gnu/packages/ruby.scm (ruby-multipart-post): New variable.
---
 gnu/packages/ruby.scm | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index b248eab..09637c3 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -625,3 +625,25 @@ and manipulate Git repositories by wrapping system calls to the git binary.)
 options and parsing command line flags.)
 (home-page https://github.com/leejarvis/slop;)
 (license license:expat)))
+
+(define-public ruby-multipart-post
+  (package
+(name ruby-multipart-post)
+(version 2.0.0)
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+https://github.com/nicksieger/multipart-post/archive/v;
+version .tar.gz))
+  (file-name (string-append name - version .tar.gz))
+  (sha256
+   (base32
+03n271i3knfx4j9aingxzz2bajd379dw9nswsllviqc177lq1anm
+(build-system ruby-build-system)
+(native-inputs
+ `((bundler ,bundler)))
+(synopsis Multipart POST library for Ruby)
+(description Multipart-Post Adds multipart POST capability to Ruby's
+net/http library.)
+(home-page https://github.com/nicksieger/multipart-post;)
+(license license:expat)))
-- 
2.2.1


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH 2/3] gnu: Add ruby-slop.

2015-06-13 Thread David Thompson
From b92e076fbd1fdeb396044bf66df20e471710f39a Mon Sep 17 00:00:00 2001
From: David Thompson da...@gnu.org
Date: Sat, 13 Jun 2015 07:53:23 -0400
Subject: [PATCH 2/3] gnu: Add ruby-slop.

* gnu/packages/ruby.scm (ruby-slop): New variable.
---
 gnu/packages/ruby.scm | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index bd7ab79..b248eab 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -603,3 +603,25 @@ run as a daemon and to be controlled by simple start/stop/restart commands.)
 and manipulate Git repositories by wrapping system calls to the git binary.)
 (home-page https://github.com/schacon/ruby-git;)
 (license license:expat)))
+
+(define-public ruby-slop
+  (package
+(name ruby-slop)
+(version 4.1.0)
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+https://github.com/leejarvis/slop/archive/v;
+version .tar.gz))
+  (file-name (string-append name - version .tar.gz))
+  (sha256
+   (base32
+0cqs50a0b99kjd19xpln8jpnki07cjyp3l7wxbfr44ycasr6nznh
+(build-system ruby-build-system)
+(native-inputs
+ `((ruby-minitest ,ruby-minitest)))
+(synopsis Ruby command line option parser)
+(description Slop provides a Ruby domain specific language for gathering
+options and parsing command line flags.)
+(home-page https://github.com/leejarvis/slop;)
+(license license:expat)))
-- 
2.2.1


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH 7/8] gnu: Add ruby-minitest-sprint.

2015-06-12 Thread David Thompson
From 7aedb563fbc9a746645afa781ecf39f086aa1995 Mon Sep 17 00:00:00 2001
From: David Thompson da...@gnu.org
Date: Fri, 12 Jun 2015 21:07:13 -0400
Subject: [PATCH 7/8] gnu: Add ruby-minitest-sprint.

* gnu/packages/ruby.scm (ruby-minitest-sprint): New variable.
---
 gnu/packages/ruby.scm | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index d090d35..dad6d36 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -494,6 +494,33 @@ facilities supporting TDD, BDD, mocking, and benchmarking.)
 (home-page https://github.com/seattlerb/minitest;)
 (license license:expat)))
 
+(define-public ruby-minitest-sprint
+  (package
+(name ruby-minitest-sprint)
+(version 1.1.0)
+(source (origin
+  (method git-fetch)
+  ;; Same story as ruby-minitest.
+  (uri (git-reference
+(url https://github.com/seattlerb/minitest-sprint.git;)
+(commit 49c02bc)))
+  (sha256
+   (base32
+0rbmxz94lqg5vjz60p8v2bzq8adwvmx501amvk0l124sfwmw94ms
+(build-system ruby-build-system)
+(arguments
+ '(#:phases (modify-phases %standard-phases
+  (replace 'build ; no gemspec
+(lambda _ (zero? (system* rake gem)))
+(native-inputs
+ `((ruby-hoe ,ruby-hoe)
+   (ruby-minitest ,ruby-minitest)))
+(synopsis Fast test suite runner for minitest)
+(description Minitest-sprint is a test runner for minitest that makes it
+easier to re-run individual failing tests.)
+(home-page https://github.com/seattlerb/minitest-sprint;)
+(license license:expat)))
+
 (define-public ruby-daemons
   (package
 (name ruby-daemons)
-- 
2.2.1


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH 5/8] gnu: Add ruby-daemons.

2015-06-12 Thread David Thompson
From 309ee62ee91493558298ef04840348c3d67a2dd9 Mon Sep 17 00:00:00 2001
From: David Thompson da...@gnu.org
Date: Fri, 5 Jun 2015 19:29:26 -0400
Subject: [PATCH 5/8] gnu: Add ruby-daemons.

* gnu/packages/ruby.scm (ruby-daemons): New variable.
---
 gnu/packages/ruby.scm | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 31a377b..44ca0dc 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -465,3 +465,25 @@ interface for Ruby programs.)
 using Net::HTTP, supporting reconnection and retry according to RFC 2616.)
 (home-page https://github.com/drbrain/net-http-persistent;)
 (license license:expat)))
+
+(define-public ruby-daemons
+  (package
+(name ruby-daemons)
+(version 1.2.2)
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+https://github.com/thuehlinger/daemons/archive/v;
+version .tar.gz))
+  (file-name (string-append name - version .tar.gz))
+  (sha256
+   (base32
+1v5bpdvpvhk240pc7fkn44vfclppl44pp6wd42ipi5sd5lkk7zfd
+(build-system ruby-build-system)
+(arguments
+ `(#:tests? #f)) ; no test suite
+(synopsis Daemonize Ruby programs)
+(description Daemons provides a way to wrap existing Ruby scripts to be
+run as a daemon and to be controlled by simple start/stop/restart commands.)
+(home-page https://github.com/thuehlinger/daemons;)
+(license license:expat)))
-- 
2.2.1


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH 8/8] gnu: Add ruby-minitest-bacon.

2015-06-12 Thread David Thompson
From c93008fafb34748ace55a6ee09b81ff71aba3e16 Mon Sep 17 00:00:00 2001
From: David Thompson da...@gnu.org
Date: Fri, 12 Jun 2015 21:07:36 -0400
Subject: [PATCH 8/8] gnu: Add ruby-minitest-bacon.

* gnu/packages/ruby.scm (ruby-minitest-bacon): New variable.
---
 gnu/packages/ruby.scm | 28 
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index dad6d36..f7759ec 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -521,6 +521,34 @@ easier to re-run individual failing tests.)
 (home-page https://github.com/seattlerb/minitest-sprint;)
 (license license:expat)))
 
+(define-public ruby-minitest-bacon
+  (package
+(name ruby-minitest-bacon)
+(version 1.0.2)
+(source (origin
+  (method git-fetch)
+  ;; Same story as ruby-minitest.
+  (uri (git-reference
+(url https://github.com/seattlerb/minitest-bacon.git;)
+(commit 38551d5)))
+  (sha256
+   (base32
+19r9fm41i0mm1xncqls8frbj1i9nr3sq1cx2mh878r6kdl02d70h
+(build-system ruby-build-system)
+(arguments
+ '(#:phases (modify-phases %standard-phases
+  (replace 'build ; no gemspec
+(lambda _ (zero? (system* rake gem)))
+(native-inputs
+ `((ruby-hoe ,ruby-hoe)))
+(inputs
+ `((ruby-minitest ,ruby-minitest)))
+(synopsis Bacon compatibility library for minitest)
+(description Minitest-bacon extends minitest with bacon-like
+functionality, making it easier to migrate test suites from bacon to minitest.)
+(home-page https://github.com/seattlerb/minitest-bacon;)
+(license license:expat)))
+
 (define-public ruby-daemons
   (package
 (name ruby-daemons)
-- 
2.2.1


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH 3/8] gnu: Add ruby-connection-pool.

2015-06-12 Thread David Thompson
From a0a3bf8748026bdc611bae2baba399fb12c1c387 Mon Sep 17 00:00:00 2001
From: David Thompson da...@gnu.org
Date: Fri, 5 Jun 2015 16:35:21 -0400
Subject: [PATCH 3/8] gnu: Add ruby-connection-pool.

* gnu/packages/ruby.scm (ruby-connection-pool): New variable.
---
 gnu/packages/ruby.scm | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 073dc4b..e7b3c5d 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -416,3 +416,25 @@ generation of complex SQL queries and adapts to various relational database
 implementations.)
 (home-page https://github.com/rails/arel;)
 (license license:expat)))
+
+(define-public ruby-connection-pool
+  (package
+(name ruby-connection-pool)
+(version 2.2.0)
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+https://github.com/mperham/connection_pool/archive/v;
+version .tar.gz))
+  (file-name (string-append name - version .tar.gz))
+  (sha256
+   (base32
+02s5rwhmgy8qqns7a5y1daa0yaw38x6lzpwyvmy46h1yrj9mc6zf
+(build-system ruby-build-system)
+(native-inputs
+ `((bundler ,bundler)))
+(synopsis Generic connection pool for Ruby)
+(description Connection_pool provides a generic connection pooling
+interface for Ruby programs.)
+(home-page https://github.com/mperham/connection_pool;)
+(license license:expat)))
-- 
2.2.1


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH 4/8] gnu: Add ruby-net-http-persistent.

2015-06-12 Thread David Thompson
From 379d7248d3c7616dcc37a39f9a1a33d9e5aa11e5 Mon Sep 17 00:00:00 2001
From: David Thompson da...@gnu.org
Date: Fri, 5 Jun 2015 16:50:24 -0400
Subject: [PATCH 4/8] gnu: Add ruby-net-http-persistent.

* gnu/packages/ruby.scm (ruby-net-http-persistent): New variable.
---
 gnu/packages/ruby.scm | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index e7b3c5d..31a377b 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -438,3 +438,30 @@ implementations.)
 interface for Ruby programs.)
 (home-page https://github.com/mperham/connection_pool;)
 (license license:expat)))
+
+(define-public ruby-net-http-persistent
+  (package
+(name ruby-net-http-persistent)
+(version 2.9.4)
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+https://github.com/drbrain/net-http-persistent/archive/v;
+version .tar.gz))
+  (file-name (string-append name - version .tar.gz))
+  (sha256
+   (base32
+1q18vji31w8gfr6ajziqkqs8n5lzkw0bl00dm2a8s05zhavzw9j9
+(build-system ruby-build-system)
+(arguments
+ '(#:phases (modify-phases %standard-phases
+  (replace 'build ; no gemspec
+(lambda _ (zero? (system* rake gem)))
+(native-inputs
+ `((ruby-connection-pool ,ruby-connection-pool)
+   (ruby-hoe ,ruby-hoe)))
+(synopsis Persistent HTTP connection manager)
+(description Net::HTTP::Persistent manages persistent HTTP connections
+using Net::HTTP, supporting reconnection and retry according to RFC 2616.)
+(home-page https://github.com/drbrain/net-http-persistent;)
+(license license:expat)))
-- 
2.2.1


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH 2/8] gnu: Add ruby-arel.

2015-06-12 Thread David Thompson
From 6913dfd901cfa337ec5942e1b7ac09f142b25b7a Mon Sep 17 00:00:00 2001
From: David Thompson da...@gnu.org
Date: Fri, 5 Jun 2015 12:06:58 -0400
Subject: [PATCH 2/8] gnu: Add ruby-arel.

* gnu/packages/ruby.scm (ruby-arel): New variable.
---
 gnu/packages/ruby.scm | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 1dc0c2e..073dc4b 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -393,3 +393,26 @@ User Agents.)
 features.)
 (home-page https://github.com/chneukirchen/bacon;)
 (license license:expat)))
+
+(define-public ruby-arel
+  (package
+(name ruby-arel)
+(version 6.0.0)
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+https://github.com/rails/arel/archive/v;
+version .tar.gz))
+  (file-name (string-append name - version .tar.gz))
+  (sha256
+   (base32
+0fldwp2hmrmddx22xf7hdmybngzv97qnv5rvz3qw61m94ddd6w4n
+(build-system ruby-build-system)
+(native-inputs
+ `((bundler ,bundler)))
+(synopsis SQL AST manager for Ruby)
+(description Arel is a SQL AST manager for Ruby.  It simplifies the
+generation of complex SQL queries and adapts to various relational database
+implementations.)
+(home-page https://github.com/rails/arel;)
+(license license:expat)))
-- 
2.2.1


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH 1/8] gnu: Add ruby-bacon.

2015-06-12 Thread David Thompson
From 12d6b1499c7a47cf98f5298193e20bfa3bf8429b Mon Sep 17 00:00:00 2001
From: David Thompson da...@gnu.org
Date: Fri, 5 Jun 2015 08:48:02 -0400
Subject: [PATCH 1/8] gnu: Add ruby-bacon.

* gnu/packages/ruby.scm (ruby-bacon): New variable.
---
 gnu/packages/ruby.scm | 29 +
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 9943de7..1dc0c2e 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -364,3 +364,32 @@ specified in a \Gemfile\, as well as their dependencies.)
 User Agents.)
 (home-page https://github.com/gshutler/useragent;)
 (license license:expat)))
+
+(define-public ruby-bacon
+  (package
+(name ruby-bacon)
+(version 1.2)
+(source (origin
+  (method url-fetch)
+  (uri (string-append
+https://github.com/chneukirchen/bacon/archive/;
+version .tar.gz))
+  (file-name (string-append name - version .tar.gz))
+  (sha256
+   (base32
+0g03fxilrrx17dijww68n1lq5d8s69hrxgpga8c1i2k35bzcw5jc
+(build-system ruby-build-system)
+(arguments
+ `(#:phases (modify-phases %standard-phases
+  (add-before 'build 'generate-docs
+(lambda _
+  ;; This rake task also tries to generate a ChangeLog
+  ;; file from the Git log, which we don't have.  It fails
+  ;; but creates an empty file, allowing the rest of the
+  ;; build to succeed.
+  (zero? (system* rake predist)))
+(synopsis Small RSpec clone)
+(description Bacon is a small RSpec clone providing all essential
+features.)
+(home-page https://github.com/chneukirchen/bacon;)
+(license license:expat)))
-- 
2.2.1


-- 
David Thompson
GPG Key: 0FF1D807


[PATCH] guix environment: Add --ad-hoc option.

2015-05-28 Thread David Thompson
I find myself frequently wanting to quickly create an environment with
just a few packages in it, without having to go through the song and
dance of creating a package expression for it.  This patch addresses
this use-case.

From 30a5b0f61e5c4a0e0244015f127ba3255f834139 Mon Sep 17 00:00:00 2001
From: David Thompson da...@gnu.org
Date: Thu, 28 May 2015 08:41:04 -0400
Subject: [PATCH] guix environment: Add --ad-hoc option.

* guix/scripts/environment.scm (%options): Add ad-hoc option.
  (show-help): Display help for --ad-hoc.
  (packages+propagated-inputs): New procedure.
  (guix-environment): Create ad hoc environment when asked.
* doc/guix.texi (invoking guix environment): Document it.
---
 doc/guix.texi|  8 +++-
 guix/scripts/environment.scm | 27 ---
 2 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 1956dbc..2a9f61e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -2381,7 +2381,7 @@ the @code{#:haddock-flags} parameter.  If the file @code{Setup.hs} is
 not found, the build system looks for @code{Setup.lhs} instead.
 
 Which Haskell compiler is used can be specified with the @code{#:haskell}
-parameter which defaults to @code{ghc}. 
+parameter which defaults to @code{ghc}.
 @end defvr
 
 Lastly, for packages that do not need anything as sophisticated, a
@@ -3932,6 +3932,12 @@ evaluates to.
 @item -E @var{command}
 Execute @var{command} in the new environment.
 
+@item --ad-hoc
+Include all specified packages in the resulting environment, as if an ad
+hoc package were defined with them as inputs.  This option is useful for
+quickly creating an environment without having to write a package
+expression to contain the desired inputs.
+
 @item --pure
 Unset existing environment variables when building the new environment.
 This has the effect of creating an environment in which search paths
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index d053daf..4217809 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014 David Thompson da...@gnu.org
+;;; Copyright © 2014, 2015 David Thompson da...@gnu.org
 ;;; Copyright © 2015 Ludovic Courtès l...@gnu.org
 ;;;
 ;;; This file is part of GNU Guix.
@@ -103,6 +103,9 @@ shell command in that environment.\n))
   (display (_ 
   -E, --exec=COMMAND execute COMMAND in new environment))
   (display (_ 
+  --ad-hoc   include all specified packages in the environment instead
+ of only their inputs))
+  (display (_ 
   --pure unset existing environment variables))
   (display (_ 
   --search-paths display needed environment variable definitions))
@@ -147,6 +150,9 @@ shell command in that environment.\n))
  (option '(#\e expression) #t #f
  (lambda (opt name arg result)
(alist-cons 'expression arg result)))
+ (option '(ad-hoc) #f #f
+ (lambda (opt name arg result)
+   (alist-cons 'ad-hoc? #t result)))
  (option '(#\n dry-run) #f #f
  (lambda (opt name arg result)
(alist-cons 'dry-run? #t result)))
@@ -191,6 +197,18 @@ packages.
   (delete-duplicates
(append-map transitive-inputs packages)))
 
+(define (packages+propagated-inputs packages)
+  Return a list containing PACKAGES plus all of their propagated inputs.
+  (delete-duplicates
+   (append packages
+   (map (match-lambda
+  ((or (_ (? package? package))
+   (_ (? package? package) _))
+   package)
+  (_ #f))
+(append-map package-transitive-propagated-inputs
+packages)
+
 (define (build-inputs inputs opts)
   Build the packages in INPUTS using the build options in OPTS.
   (let ((substitutes? (assoc-ref opts 'substitutes?))
@@ -218,9 +236,12 @@ packages.
   (let* ((opts  (parse-command-line args %options (list %default-options)
 #:argument-handler handle-argument))
  (pure? (assoc-ref opts 'pure))
+ (ad-hoc? (assoc-ref opts 'ad-hoc?))
  (command (assoc-ref opts 'exec))
- (inputs (packages-transitive-inputs
-  (pick-all (options/resolve-packages opts) 'package)))
+ (packages (pick-all (options/resolve-packages opts) 'package))
+ (inputs (if ad-hoc?
+ (packages+propagated-inputs packages)
+ (packages-transitive-inputs packages)))
  (drvs (run-with-store store
  (mbegin %store-monad
(set-guile-for-build (default-guile))
-- 
2.2.1


-- 
David Thompson
GPG Key: 0FF1D807


Re: Guix ops

2015-05-22 Thread David Thompson
Hello again Carlos,

Carlos Sosa gnus...@gnusosa.net writes:

   I like the idea of 'guix deploy', and maybe something to propagates
   given configuration files, like 'guix config prepare' and later 'guix
   config apply'.

 Now, how can I contribute? work the guix command?

 Let me know if you have a specific repository or place to find any work
 done on this.

I have just pushed a new branch called wip-deploy to the official guix
repository.  Since this branch is prefixed with wip-, expect it to be
rebased frequently.  There's not much code here yet, but a very simple
prototype has been implemented that supports the creation of local QEMU
VMs.

To take it for a spin, add something like this to a file, let's call it
deployment.scm:

(use-modules (gnu) (guix gexp))
(use-service-modules databases)
(use-package-modules web databases)

(define dummy-fs
  (file-system
(mount-point /)
(device dummy)
(type dummy)))

(define grub
  (grub-configuration (device /dev/sda)))

(define timezone America/New_York)
(define locale en_US.UTF-8)

;; TODO: Needs nginx-service.
(define web-server
  (machine
   (name web-server)
   (system (operating-system
 (host-name web-server)
 (timezone timezone)
 (locale locale)
 (bootloader grub)
 (file-systems
  (list dummy-fs %binary-format-file-system))
 (packages
  (cons nginx %base-packages
   (platform (local-vm #:ip-address 10.0.2.10

(define db-server
  (machine
   (name db-server)
   (system (operating-system
 (host-name db-server)
 (timezone timezone)
 (locale locale)
 (bootloader grub)
 (file-systems
  (list dummy-fs %binary-format-file-system))
 (services
  (cons (postgresql-service)
%base-services))
 (packages (cons postgresql %base-packages
   (platform (local-vm #:ip-address 10.0.2.11

(deployment
 (name test-deployment)
 (machines (list web-server db-server)))

Then run the following from your git checkout:

./pre-inst-env guix deploy spawn /path/to/deployment.scm

One caveat: Make sure the file name uses an absolute path for now.  I
haven't cleaned up the code enough to deal with relative file names.

If the command is successful, you will see 2 QEMU windows open up, one
for the web server and one for the database server.  Pretty neat, eh? :)

Now, there's still much work to be done.  Spawning local, temporary VMs
has gotten me over some initial hurdles, but now we need to write a
platform adapter for something more serious so that we can determine the
requirements for real world deployment scenarios.  Perhaps we should
look into writing an OpenStack adapter.

There's also unanswered questions like: How should we keep track of
state?  How do we reconfigure already deployed machines?  How do we shut
down a deployment and unprovision the resources it used?  Basically, how
many hooks does the platform record type need to cover everything?

Thoughts and help very much wanted!

-- 
David Thompson
GPG Key: 0FF1D807



  1   2   3   4   5   >