Update NEWS.
[jackhill/guix/guix.git] / gnu / packages / package-management.scm
CommitLineData
bbe8d8f0 1;;; GNU Guix --- Functional package management for GNU
2e69dd8c 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
bbe8d8f0
LC
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages package-management)
20 #:use-module (guix packages)
21 #:use-module (guix download)
480af4d6
LC
22 #:use-module (guix git-download)
23 #:use-module (guix utils)
bbe8d8f0 24 #:use-module (guix build-system gnu)
fcb0109d 25 #:use-module ((guix licenses) #:select (gpl3+ lgpl2.1+))
8a43ff10 26 #:use-module (gnu packages)
bbe8d8f0 27 #:use-module (gnu packages guile)
2d195e67 28 #:use-module ((gnu packages compression) #:select (bzip2 gzip))
bbe8d8f0 29 #:use-module (gnu packages gnupg)
5f96f303 30 #:use-module (gnu packages databases)
480af4d6
LC
31 #:use-module (gnu packages graphviz)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages gettext)
fcb0109d
LC
35 #:use-module (gnu packages texinfo)
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages curl)
38 #:use-module (gnu packages web)
b173d0e4 39 #:use-module (gnu packages emacs)
fcb0109d
LC
40 #:use-module (gnu packages openssl)
41 #:use-module (gnu packages bdw-gc))
bbe8d8f0 42
39de700c
LC
43(define (boot-guile-uri arch)
44 "Return the URI for the bootstrap Guile tarball for ARCH."
45 (if (string=? "armhf" arch)
46 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
47 arch "-linux"
48 "/20150101/guile-2.0.11.tar.xz")
49 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
50 arch "-linux"
51 "/20131110/guile-2.0.9.tar.xz")))
52
47739f51 53(define-public guix-0.8
bbe8d8f0
LC
54 (package
55 (name "guix")
47739f51 56 (version "0.8")
bbe8d8f0
LC
57 (source (origin
58 (method url-fetch)
59 (uri (string-append "ftp://alpha.gnu.org/gnu/guix/guix-"
60 version ".tar.gz"))
61 (sha256
62 (base32
47739f51 63 "1p7yqbnhjc1yjzinbjzphgj6wasc7p8ki9yj0vql5bsz01dp28zv"))))
bbe8d8f0
LC
64 (build-system gnu-build-system)
65 (arguments
66 `(#:configure-flags (list
2d195e67 67 "--localstatedir=/var"
202adef2 68 "--sysconfdir=/etc"
bbe8d8f0
LC
69 (string-append "--with-libgcrypt-prefix="
70 (assoc-ref %build-inputs
71 "libgcrypt")))
72 #:phases (alist-cons-before
73 'configure 'copy-bootstrap-guile
74 (lambda* (#:key system inputs #:allow-other-keys)
39de700c
LC
75 (define (boot-guile-version arch)
76 (if (string=? "armhf" arch)
77 "2.0.11"
78 "2.0.9"))
79
bbe8d8f0
LC
80 (define (copy arch)
81 (let ((guile (assoc-ref inputs
82 (string-append "boot-guile/"
83 arch)))
84 (target (string-append "gnu/packages/bootstrap/"
85 arch "-linux/"
39de700c
LC
86 "/guile-"
87 (boot-guile-version arch)
88 ".tar.xz")))
bbe8d8f0
LC
89 (copy-file guile target)))
90
91 (copy "i686")
92 (copy "x86_64")
8a43ff10 93 (copy "mips64el")
39de700c 94 (copy "armhf")
bbe8d8f0
LC
95 #t)
96 %standard-phases)))
b173d0e4 97 (native-inputs `(("pkg-config" ,pkg-config)
47739f51 98 ("emacs" ,emacs))) ;for guix.el
bbe8d8f0
LC
99 (inputs
100 (let ((boot-guile (lambda (arch hash)
101 (origin
102 (method url-fetch)
39de700c 103 (uri (boot-guile-uri arch))
bbe8d8f0
LC
104 (sha256 hash)))))
105 `(("bzip2" ,bzip2)
2d195e67
LC
106 ("gzip" ,gzip)
107
bbe8d8f0
LC
108 ("sqlite" ,sqlite)
109 ("libgcrypt" ,libgcrypt)
110 ("guile" ,guile-2.0)
bbe8d8f0
LC
111
112 ("boot-guile/i686"
113 ,(boot-guile "i686"
114 (base32
8a43ff10 115 "0im800m30abgh7msh331pcbjvb4n02smz5cfzf1srv0kpx3csmxp")))
bbe8d8f0
LC
116 ("boot-guile/x86_64"
117 ,(boot-guile "x86_64"
118 (base32
8a43ff10
LC
119 "1w2p5zyrglzzniqgvyn1b55vprfzhgk8vzbzkkbdgl5248si0yq3")))
120 ("boot-guile/mips64el"
121 ,(boot-guile "mips64el"
122 (base32
39de700c
LC
123 "0fzp93lvi0hn54acc0fpvhc7bvl0yc853k62l958cihk03q80ilr")))
124 ("boot-guile/armhf"
125 ,(boot-guile "armhf"
126 (base32
127 "1mi3brl7l58aww34rawhvja84xc7l1b4hmwdmc36fp9q9mfx0lg5"))))))
bbe8d8f0 128 (home-page "http://www.gnu.org/software/guix")
79c311b8 129 (synopsis "Functional package manager for installed software packages and versions")
bbe8d8f0 130 (description
79c311b8 131 "GNU Guix is a functional package manager for the GNU system, and is
c5779c93 132also a distribution thereof. It includes a virtual machine image. Besides
79c311b8 133the usual package management features, it also supports transactional
c5779c93
LC
134upgrades and roll-backs, per-user profiles, and much more. It is based on
135the Nix package manager.")
bbe8d8f0 136 (license gpl3+)))
30f25b03 137
3ad9a0b1 138(define guix-devel
480af4d6 139 ;; Development version of Guix.
39de700c 140 (let ((commit "4ad8789"))
47739f51 141 (package (inherit guix-0.8)
90422555 142 (version (string-append "0.8." commit))
480af4d6
LC
143 (source (origin
144 (method git-fetch)
145 (uri (git-reference
146 (url "git://git.sv.gnu.org/guix.git")
2e69dd8c 147 (commit commit)))
480af4d6
LC
148 (sha256
149 (base32
39de700c 150 "058gf7fg5k8ldchz63j5ssqr2lx8dn1wa1rllg7krrfr6g8abi34"))))
480af4d6 151 (arguments
47739f51 152 (substitute-keyword-arguments (package-arguments guix-0.8)
480af4d6
LC
153 ((#:phases phases)
154 `(alist-cons-before
155 'configure 'bootstrap
156 (lambda _
480af4d6
LC
157 ;; Make sure 'msgmerge' can modify the PO files.
158 (for-each (lambda (po)
159 (chmod po #o666))
160 (find-files "." "\\.po$"))
161
162 (zero? (system* "./bootstrap")))
163 ,phases))))
164 (native-inputs
165 `(("autoconf" ,(autoconf-wrapper))
166 ("automake" ,automake)
167 ("gettext" ,gnu-gettext)
168 ("texinfo" ,texinfo)
169 ("graphviz" ,graphviz)
47739f51 170 ,@(package-native-inputs guix-0.8)))
3ad9a0b1
LC
171 (propagated-inputs
172 `(("guile-json" ,guile-json)
b6c5a397 173 ("geiser" ,geiser) ;for guix.el
47739f51 174 ,@(package-propagated-inputs guix-0.8))))))
3ad9a0b1 175
90422555 176(define-public guix guix-devel)
fcb0109d
LC
177
178(define-public nix
179 (package
180 (name "nix")
63c54622 181 (version "1.8")
fcb0109d
LC
182 (source (origin
183 (method url-fetch)
184 (uri (string-append "http://nixos.org/releases/nix/nix-"
185 version "/nix-" version ".tar.xz"))
186 (sha256
187 (base32
63c54622 188 "077hircacgi9y4n6kf48qp4laz1h3ab6sif3rcci1jy13f05w2m3"))))
fcb0109d
LC
189 (build-system gnu-build-system)
190 ;; XXX: Should we pass '--with-store-dir=/gnu/store'? But then we'd also
191 ;; need '--localstatedir=/var'. But then! The thing would use /var/nix
192 ;; instead of /var/guix. So in the end, we do nothing special.
193 (native-inputs `(("perl" ,perl)
194 ("pkg-config" ,pkg-config)))
195 (inputs `(("curl" ,curl)
196 ("openssl" ,openssl)
197 ("libgc" ,libgc)
198 ("sqlite" ,sqlite)
199 ("bzip2" ,bzip2)
200 ("perl-www-curl" ,perl-www-curl)
201 ("perl-dbi" ,perl-dbi)
202 ("perl-dbd-sqlite" ,perl-dbd-sqlite)))
203 (home-page "http://nixos.org/nix/")
204 (synopsis "The Nix package manager")
205 (description
206 "Nix is a purely functional package manager. This means that it treats
207packages like values in purely functional programming languages such as
208Haskell—they are built by functions that don't have side-effects, and they
209never change after they have been built. Nix stores packages in the Nix
210store, usually the directory /nix/store, where each package has its own unique
211sub-directory.")
212 (license lgpl2.1+)))