You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

268 lines
11 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu packages package-management)
  20. #:use-module (guix packages)
  21. #:use-module (guix download)
  22. #:use-module (guix git-download)
  23. #:use-module (guix utils)
  24. #:use-module (guix build-system gnu)
  25. #:use-module ((guix licenses) #:select (gpl2+ gpl3+ lgpl2.1+))
  26. #:use-module (gnu packages)
  27. #:use-module (gnu packages guile)
  28. #:use-module (gnu packages compression)
  29. #:use-module (gnu packages gnupg)
  30. #:use-module (gnu packages databases)
  31. #:use-module (gnu packages gnutls)
  32. #:use-module (gnu packages graphviz)
  33. #:use-module (gnu packages pkg-config)
  34. #:use-module (gnu packages autotools)
  35. #:use-module (gnu packages gettext)
  36. #:use-module (gnu packages texinfo)
  37. #:use-module (gnu packages perl)
  38. #:use-module (gnu packages curl)
  39. #:use-module (gnu packages web)
  40. #:use-module (gnu packages man)
  41. #:use-module (gnu packages emacs)
  42. #:use-module (gnu packages openssl)
  43. #:use-module (gnu packages bdw-gc))
  44. (define (boot-guile-uri arch)
  45. "Return the URI for the bootstrap Guile tarball for ARCH."
  46. (if (string=? "armhf" arch)
  47. (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
  48. arch "-linux"
  49. "/20150101/guile-2.0.11.tar.xz")
  50. (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
  51. arch "-linux"
  52. "/20131110/guile-2.0.9.tar.xz")))
  53. (define-public guix-0.8.2
  54. (package
  55. (name "guix")
  56. (version "0.8.2")
  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
  63. "1a5gnkh17w7fgi5zy63ph64iqdvarkdqypkwgw2iifpqa6jq04zz"))))
  64. (build-system gnu-build-system)
  65. (arguments
  66. `(#:configure-flags (list
  67. "--localstatedir=/var"
  68. "--sysconfdir=/etc"
  69. (string-append "--with-bash-completion-dir="
  70. (assoc-ref %outputs "out")
  71. "/etc/bash_completion.d")
  72. (string-append "--with-libgcrypt-prefix="
  73. (assoc-ref %build-inputs
  74. "libgcrypt")))
  75. #:phases (modify-phases %standard-phases
  76. (add-before
  77. 'configure 'copy-bootstrap-guile
  78. (lambda* (#:key system inputs #:allow-other-keys)
  79. (define (boot-guile-version arch)
  80. (if (string=? "armhf" arch)
  81. "2.0.11"
  82. "2.0.9"))
  83. (define (copy arch)
  84. (let ((guile (assoc-ref inputs
  85. (string-append "boot-guile/"
  86. arch)))
  87. (target (string-append "gnu/packages/bootstrap/"
  88. arch "-linux/"
  89. "/guile-"
  90. (boot-guile-version arch)
  91. ".tar.xz")))
  92. (copy-file guile target)))
  93. (copy "i686")
  94. (copy "x86_64")
  95. (copy "mips64el")
  96. (copy "armhf")
  97. #t))
  98. (add-after
  99. 'install 'wrap-program
  100. (lambda* (#:key inputs outputs #:allow-other-keys)
  101. ;; Make sure the 'guix' command finds GnuTLS and
  102. ;; Guile-JSON automatically.
  103. (let* ((out (assoc-ref outputs "out"))
  104. (json (assoc-ref inputs "guile-json"))
  105. (gnutls (assoc-ref inputs "gnutls"))
  106. (path (string-append
  107. json "/share/guile/site/2.0:"
  108. gnutls "/share/guile/site/2.0")))
  109. (wrap-program (string-append out "/bin/guix")
  110. `("GUILE_LOAD_PATH" ":" prefix (,path))
  111. `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,path)))
  112. #t))))))
  113. (native-inputs `(("pkg-config" ,pkg-config)
  114. ("emacs" ,emacs-no-x))) ;for guix.el
  115. (inputs
  116. (let ((boot-guile (lambda (arch hash)
  117. (origin
  118. (method url-fetch)
  119. (uri (boot-guile-uri arch))
  120. (sha256 hash)))))
  121. `(("bzip2" ,bzip2)
  122. ("gzip" ,gzip)
  123. ("sqlite" ,sqlite)
  124. ("libgcrypt" ,libgcrypt)
  125. ("guile" ,guile-2.0)
  126. ("boot-guile/i686"
  127. ,(boot-guile "i686"
  128. (base32
  129. "0im800m30abgh7msh331pcbjvb4n02smz5cfzf1srv0kpx3csmxp")))
  130. ("boot-guile/x86_64"
  131. ,(boot-guile "x86_64"
  132. (base32
  133. "1w2p5zyrglzzniqgvyn1b55vprfzhgk8vzbzkkbdgl5248si0yq3")))
  134. ("boot-guile/mips64el"
  135. ,(boot-guile "mips64el"
  136. (base32
  137. "0fzp93lvi0hn54acc0fpvhc7bvl0yc853k62l958cihk03q80ilr")))
  138. ("boot-guile/armhf"
  139. ,(boot-guile "armhf"
  140. (base32
  141. "1mi3brl7l58aww34rawhvja84xc7l1b4hmwdmc36fp9q9mfx0lg5"))))))
  142. (propagated-inputs
  143. `(("gnutls" ,gnutls) ;for 'guix download' & co.
  144. ("guile-json" ,guile-json)
  145. ("geiser" ,geiser))) ;for guix.el
  146. (home-page "http://www.gnu.org/software/guix")
  147. (synopsis "Functional package manager for installed software packages and versions")
  148. (description
  149. "GNU Guix is a functional package manager for the GNU system, and is
  150. also a distribution thereof. It includes a virtual machine image. Besides
  151. the usual package management features, it also supports transactional
  152. upgrades and roll-backs, per-user profiles, and much more. It is based on
  153. the Nix package manager.")
  154. (license gpl3+)))
  155. (define guix-devel
  156. ;; Development version of Guix.
  157. ;;
  158. ;; Note: use a short commit id; when using the long one, the limit on socket
  159. ;; file names is exceeded while running the tests.
  160. (let ((commit "a43b55f"))
  161. (package (inherit guix-0.8.2)
  162. (version (string-append "0.8.2." commit))
  163. (source (origin
  164. (method git-fetch)
  165. (uri (git-reference
  166. (url "git://git.sv.gnu.org/guix.git")
  167. (commit commit)))
  168. (sha256
  169. (base32
  170. "1r0l8gfh5nxc1j0sqj8ywkg280k9qbj7zsk33z84rvl7l0nwnk88"))
  171. (file-name (string-append "guix-" version "-checkout"))))
  172. (arguments
  173. (substitute-keyword-arguments (package-arguments guix-0.8.2)
  174. ((#:phases phases)
  175. `(alist-cons-after
  176. 'unpack 'bootstrap
  177. (lambda _
  178. ;; Make sure 'msgmerge' can modify the PO files.
  179. (for-each (lambda (po)
  180. (chmod po #o666))
  181. (find-files "." "\\.po$"))
  182. (zero? (system* "sh" "bootstrap")))
  183. ,phases))))
  184. (native-inputs
  185. `(("autoconf" ,(autoconf-wrapper))
  186. ("automake" ,automake)
  187. ("gettext" ,gnu-gettext)
  188. ("texinfo" ,texinfo)
  189. ("graphviz" ,graphviz)
  190. ("help2man" ,help2man)
  191. ,@(package-native-inputs guix-0.8.2))))))
  192. (define-public guix guix-devel)
  193. (define-public nix
  194. (package
  195. (name "nix")
  196. (version "1.8")
  197. (source (origin
  198. (method url-fetch)
  199. (uri (string-append "http://nixos.org/releases/nix/nix-"
  200. version "/nix-" version ".tar.xz"))
  201. (sha256
  202. (base32
  203. "077hircacgi9y4n6kf48qp4laz1h3ab6sif3rcci1jy13f05w2m3"))))
  204. (build-system gnu-build-system)
  205. ;; XXX: Should we pass '--with-store-dir=/gnu/store'? But then we'd also
  206. ;; need '--localstatedir=/var'. But then! The thing would use /var/nix
  207. ;; instead of /var/guix. So in the end, we do nothing special.
  208. (native-inputs `(("perl" ,perl)
  209. ("pkg-config" ,pkg-config)))
  210. (inputs `(("curl" ,curl)
  211. ("openssl" ,openssl)
  212. ("libgc" ,libgc)
  213. ("sqlite" ,sqlite)
  214. ("bzip2" ,bzip2)))
  215. (propagated-inputs `(("perl-www-curl" ,perl-www-curl)
  216. ("perl-dbi" ,perl-dbi)
  217. ("perl-dbd-sqlite" ,perl-dbd-sqlite)))
  218. (home-page "http://nixos.org/nix/")
  219. (synopsis "The Nix package manager")
  220. (description
  221. "Nix is a purely functional package manager. This means that it treats
  222. packages like values in purely functional programming languages such as
  223. Haskell—they are built by functions that don't have side-effects, and they
  224. never change after they have been built. Nix stores packages in the Nix
  225. store, usually the directory /nix/store, where each package has its own unique
  226. sub-directory.")
  227. (license lgpl2.1+)))
  228. (define-public stow
  229. (package
  230. (name "stow")
  231. (version "2.2.0")
  232. (source (origin
  233. (method url-fetch)
  234. (uri (string-append "mirror://gnu/stow/stow-"
  235. version ".tar.gz"))
  236. (sha256
  237. (base32
  238. "0arw1nsdlcvd7javkbk2bdvnc31d7dmb6fr25xyyi6ng76cxg2cb"))))
  239. (build-system gnu-build-system)
  240. (inputs
  241. `(("perl" ,perl)))
  242. (native-inputs
  243. `(("perl-test-simple" ,perl-test-simple)
  244. ("perl-test-output" ,perl-test-output)
  245. ("perl-capture-tiny" ,perl-capture-tiny)))
  246. (home-page "https://www.gnu.org/software/stow/")
  247. (synopsis "Managing installed software packages")
  248. (description
  249. "GNU Stow is a symlink manager. It generates symlinks to directories
  250. of data and makes them appear to be merged into the same directory. It is
  251. typically used for managing software packages installed from source, by
  252. letting you install them apart in distinct directories and then create
  253. symlinks to the files in a common directory such as /usr/local.")
  254. (license gpl2+)))