package-management.scm 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2015, 2017, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
  4. ;;; Copyright © 2017 Muriithi Frederick Muriuki <fredmanglis@gmail.com>
  5. ;;; Copyright © 2017, 2018 Oleg Pykhalov <go.wigust@gmail.com>
  6. ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
  7. ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  8. ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
  9. ;;; Copyright © 2018, 2019 Rutger Helling <rhelling@mykolab.com>
  10. ;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
  11. ;;; Copyright © 2018, 2019 Eric Bavier <bavier@member.fsf.org>
  12. ;;; Copyright © 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
  13. ;;; Copyright © 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
  14. ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
  15. ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  16. ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
  17. ;;; Copyright © 2020 Jesse Gibbons <jgibbons2357+guix@gmail.com>
  18. ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
  19. ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
  20. ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
  21. ;;;
  22. ;;; This file is part of GNU Guix.
  23. ;;;
  24. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  25. ;;; under the terms of the GNU General Public License as published by
  26. ;;; the Free Software Foundation; either version 3 of the License, or (at
  27. ;;; your option) any later version.
  28. ;;;
  29. ;;; GNU Guix is distributed in the hope that it will be useful, but
  30. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  31. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  32. ;;; GNU General Public License for more details.
  33. ;;;
  34. ;;; You should have received a copy of the GNU General Public License
  35. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  36. (define-module (gnu packages package-management)
  37. #:use-module (gnu artwork)
  38. #:use-module (gnu packages)
  39. #:use-module (gnu packages acl)
  40. #:use-module (gnu packages attr)
  41. #:use-module (gnu packages avahi)
  42. #:use-module (gnu packages autotools)
  43. #:use-module (gnu packages backup)
  44. #:use-module (gnu packages base)
  45. #:use-module (gnu packages bash)
  46. #:use-module (gnu packages bdw-gc)
  47. #:use-module (gnu packages bison)
  48. #:use-module (gnu packages boost)
  49. #:use-module (gnu packages bootstrap) ;for 'bootstrap-guile-origin'
  50. #:use-module (gnu packages check)
  51. #:use-module (gnu packages compression)
  52. #:use-module (gnu packages cpio)
  53. #:use-module (gnu packages crypto)
  54. #:use-module (gnu packages curl)
  55. #:use-module (gnu packages databases)
  56. #:use-module (gnu packages dejagnu)
  57. #:use-module (gnu packages dbm)
  58. #:use-module (gnu packages docbook)
  59. #:use-module (gnu packages file)
  60. #:use-module (gnu packages gettext)
  61. #:use-module (gnu packages glib)
  62. #:use-module (gnu packages gnome)
  63. #:use-module (gnu packages gnupg)
  64. #:use-module (gnu packages graphviz)
  65. #:use-module (gnu packages gtk)
  66. #:use-module (gnu packages guile)
  67. #:use-module (gnu packages guile-xyz)
  68. #:use-module (gnu packages hurd)
  69. #:use-module (gnu packages imagemagick)
  70. #:use-module (gnu packages less)
  71. #:use-module (gnu packages libedit)
  72. #:use-module (gnu packages linux)
  73. #:use-module (gnu packages lisp)
  74. #:use-module (gnu packages man)
  75. #:use-module (gnu packages nettle)
  76. #:use-module (gnu packages networking)
  77. #:use-module (gnu packages nss)
  78. #:use-module (gnu packages patchutils)
  79. #:use-module (gnu packages perl)
  80. #:use-module (gnu packages perl-check)
  81. #:use-module (gnu packages pkg-config)
  82. #:use-module (gnu packages popt)
  83. #:use-module (gnu packages python)
  84. #:use-module (gnu packages python-check)
  85. #:use-module (gnu packages python-web)
  86. #:use-module (gnu packages python-xyz)
  87. #:use-module (gnu packages serialization)
  88. #:use-module (gnu packages sqlite)
  89. #:use-module (gnu packages ssh)
  90. #:use-module (gnu packages tcl)
  91. #:use-module (gnu packages texinfo)
  92. #:use-module (gnu packages time)
  93. #:use-module (gnu packages tls)
  94. #:use-module (gnu packages vim)
  95. #:use-module (gnu packages virtualization)
  96. #:use-module (gnu packages web)
  97. #:use-module (gnu packages xml)
  98. #:use-module (gnu packages xorg)
  99. #:use-module (guix build-system glib-or-gtk)
  100. #:use-module (guix build-system gnu)
  101. #:use-module (guix build-system meson)
  102. #:use-module (guix build-system python)
  103. #:use-module (guix build-system trivial)
  104. #:use-module (guix download)
  105. #:use-module (guix gexp)
  106. #:use-module (guix git-download)
  107. #:use-module ((guix licenses) #:prefix license:)
  108. #:use-module (guix packages)
  109. #:use-module (guix utils)
  110. #:use-module (ice-9 match)
  111. #:use-module (srfi srfi-1))
  112. (define (boot-guile-uri arch)
  113. "Return the URI for the bootstrap Guile tarball for ARCH."
  114. (cond ((string=? "armhf" arch)
  115. (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
  116. arch "-linux"
  117. "/20150101/guile-2.0.11.tar.xz"))
  118. ((string=? "aarch64" arch)
  119. (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
  120. arch "-linux/20170217/guile-2.0.14.tar.xz"))
  121. (else
  122. (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
  123. arch "-linux"
  124. "/20131110/guile-2.0.9.tar.xz"))))
  125. ;; NOTE: The commit IDs used here form a linked list threaded through the git
  126. ;; history. In a phenomenon known as boot-stripping, not only the head of this
  127. ;; list is used, but also a few older versions, when a guix from this package is
  128. ;; used to build something also depending on guix.
  129. ;;
  130. ;; Therefore, if, by accident, you set this package to a non-existent commit ID,
  131. ;; it is insufficient to simply correct it with the latest commit.
  132. ;; Instead, please push one commit that rolls back Guix to before the mistake,
  133. ;; and then another that points to the first one. That way, the faulty commit
  134. ;; won't appear on the linked list.
  135. (define-public guix
  136. ;; Latest version of Guix, which may or may not correspond to a release.
  137. ;; Note: the 'update-guix-package.scm' script expects this definition to
  138. ;; start precisely like this.
  139. (let ((version "1.3.0")
  140. (commit "6243ad3812f8c689599a19f0e8b9719ba14461f2")
  141. (revision 5))
  142. (package
  143. (name "guix")
  144. (version (if (zero? revision)
  145. version
  146. (string-append version "-"
  147. (number->string revision)
  148. "." (string-take commit 7))))
  149. (source (origin
  150. (method git-fetch)
  151. (uri (git-reference
  152. (url "https://git.savannah.gnu.org/git/guix.git")
  153. (commit commit)))
  154. (sha256
  155. (base32
  156. "0i3sgk2w2yjy9ip47vk0h17afk16yl5ih3p3q75083kgjzyjdm3d"))
  157. (file-name (string-append "guix-" version "-checkout"))))
  158. (build-system gnu-build-system)
  159. (arguments
  160. `(#:configure-flags (list
  161. ;; Provide channel metadata for 'guix describe'.
  162. ;; Don't pass '--with-channel-url' and
  163. ;; '--with-channel-introduction' and instead use
  164. ;; the defaults.
  165. ,(string-append "--with-channel-commit=" commit)
  166. "--localstatedir=/var"
  167. "--sysconfdir=/etc"
  168. (string-append "--with-bash-completion-dir="
  169. (assoc-ref %outputs "out")
  170. "/etc/bash_completion.d")
  171. ;; Set 'DOT_USER_PROGRAM' to the empty string so
  172. ;; we don't keep a reference to Graphviz, whose
  173. ;; closure is pretty big (too big for the Guix
  174. ;; system installation image.)
  175. "ac_cv_path_DOT_USER_PROGRAM=dot"
  176. ;; To avoid problems with the length of shebangs,
  177. ;; choose a fixed-width and short directory name
  178. ;; for tests.
  179. "ac_cv_guix_test_root=/tmp/guix-tests"
  180. ,@(if (hurd-target?) '("--with-courage") '()))
  181. #:parallel-tests? #f ;work around <http://bugs.gnu.org/21097>
  182. #:modules ((guix build gnu-build-system)
  183. (guix build utils)
  184. (srfi srfi-26)
  185. (ice-9 popen)
  186. (ice-9 rdelim))
  187. #:phases (modify-phases %standard-phases
  188. (replace 'bootstrap
  189. (lambda _
  190. ;; Make sure 'msgmerge' can modify the PO files.
  191. (for-each (lambda (po)
  192. (chmod po #o666))
  193. (find-files "." "\\.po$"))
  194. (patch-shebang "build-aux/git-version-gen")
  195. (call-with-output-file ".tarball-version"
  196. (lambda (port)
  197. (display ,version port)))
  198. ;; Install SysV init files to $(prefix)/etc rather
  199. ;; than to /etc.
  200. (substitute* "nix/local.mk"
  201. (("^sysvinitservicedir = .*$")
  202. (string-append "sysvinitservicedir = \
  203. $(prefix)/etc/init.d\n")))
  204. ;; Install OpenRC init files to $(prefix)/etc rather
  205. ;; than to /etc.
  206. (substitute* "nix/local.mk"
  207. (("^openrcservicedir = .*$")
  208. (string-append "openrcservicedir = \
  209. $(prefix)/etc/openrc\n")))
  210. (invoke "sh" "bootstrap")))
  211. (add-before 'build 'use-host-compressors
  212. (lambda* (#:key inputs target #:allow-other-keys)
  213. (when target
  214. ;; Use host compressors.
  215. (let ((bzip2 (assoc-ref inputs "bzip2"))
  216. (gzip (assoc-ref inputs "gzip"))
  217. (xz (assoc-ref inputs "xz")))
  218. (substitute* "guix/config.scm"
  219. (("\"[^\"]*/bin/bzip2")
  220. (string-append "\"" bzip2 "/bin/bzip2"))
  221. (("\"[^\"]*/bin/gzip") gzip
  222. (string-append "\"" gzip "/bin/gzip"))
  223. (("\"[^\"]*/bin//xz")
  224. (string-append "\"" xz "/bin/xz")))))
  225. #t))
  226. (add-before 'check 'copy-bootstrap-guile
  227. (lambda* (#:key system target inputs #:allow-other-keys)
  228. ;; Copy the bootstrap guile tarball in the store
  229. ;; used by the test suite.
  230. (define (intern file recursive?)
  231. ;; Note: don't use 'guix download' here because we
  232. ;; need to set the 'recursive?' argument.
  233. (define base
  234. (strip-store-file-name file))
  235. (define code
  236. `(begin
  237. (use-modules (guix))
  238. (with-store store
  239. (let* ((item (add-to-store store ,base
  240. ,recursive?
  241. "sha256" ,file))
  242. (root (string-append "/tmp/gc-root-"
  243. (basename item))))
  244. ;; Register a root so that the GC tests
  245. ;; don't delete those.
  246. (symlink item root)
  247. (add-indirect-root store root)))))
  248. (invoke "./test-env" "guile" "-c"
  249. (object->string code)))
  250. (unless target
  251. (intern (assoc-ref inputs "boot-guile") #f)
  252. ;; On x86_64 some tests need the i686 Guile.
  253. (when (and (not target)
  254. (string=? system "x86_64-linux"))
  255. (intern (assoc-ref inputs "boot-guile/i686") #f))
  256. ;; Copy the bootstrap executables.
  257. (for-each (lambda (input)
  258. (intern (assoc-ref inputs input) #t))
  259. '("bootstrap/bash" "bootstrap/mkdir"
  260. "bootstrap/tar" "bootstrap/xz")))
  261. #t))
  262. (add-after 'unpack 'disable-failing-tests
  263. ;; XXX FIXME: These tests fail within the build container.
  264. (lambda _
  265. (substitute* "tests/syscalls.scm"
  266. (("^\\(test-(assert|equal) \"(clone|setns|pivot-root)\"" all)
  267. (string-append "(test-skip 1)\n" all)))
  268. (substitute* "tests/containers.scm"
  269. (("^\\(test-(assert|equal)" all)
  270. (string-append "(test-skip 1)\n" all)))
  271. (when (file-exists? "tests/guix-environment-container.sh")
  272. (substitute* "tests/guix-environment-container.sh"
  273. (("guix environment --version")
  274. "exit 77\n")))
  275. #t))
  276. (add-before 'check 'set-SHELL
  277. (lambda _
  278. ;; 'guix environment' tests rely on 'SHELL' having a
  279. ;; correct value, so set it.
  280. (setenv "SHELL" (which "sh"))
  281. #t))
  282. (add-after 'install 'wrap-program
  283. (lambda* (#:key inputs native-inputs outputs target
  284. #:allow-other-keys)
  285. ;; Make sure the 'guix' command finds GnuTLS,
  286. ;; Guile-JSON, and Guile-Git automatically.
  287. (let* ((out (assoc-ref outputs "out"))
  288. (guile (assoc-ref (or native-inputs inputs)
  289. "guile"))
  290. (avahi (assoc-ref inputs "guile-avahi"))
  291. (gcrypt (assoc-ref inputs "guile-gcrypt"))
  292. (guile-lib (assoc-ref inputs "guile-lib"))
  293. (json (assoc-ref inputs "guile-json"))
  294. (sqlite (assoc-ref inputs "guile-sqlite3"))
  295. (zlib (assoc-ref inputs "guile-zlib"))
  296. (lzlib (assoc-ref inputs "guile-lzlib"))
  297. (zstd (assoc-ref inputs "guile-zstd"))
  298. (git (assoc-ref inputs "guile-git"))
  299. (bs (assoc-ref inputs
  300. "guile-bytestructures"))
  301. (ssh (assoc-ref inputs "guile-ssh"))
  302. (gnutls (assoc-ref inputs "gnutls"))
  303. (disarchive (assoc-ref inputs "disarchive"))
  304. (locales (assoc-ref inputs "glibc-utf8-locales"))
  305. (deps (list gcrypt json sqlite gnutls git
  306. bs ssh zlib lzlib zstd guile-lib
  307. disarchive))
  308. (deps* (if avahi (cons avahi deps) deps))
  309. (effective
  310. (read-line
  311. (open-pipe* OPEN_READ
  312. (string-append guile "/bin/guile")
  313. "-c" "(display (effective-version))")))
  314. (path (map (cut string-append <>
  315. "/share/guile/site/"
  316. effective)
  317. (delete #f deps*)))
  318. (gopath (map (cut string-append <>
  319. "/lib/guile/" effective
  320. "/site-ccache")
  321. (delete #f deps*)))
  322. (locpath (string-append locales "/lib/locale")))
  323. ;; Modify 'guix' directly instead of using
  324. ;; 'wrap-program'. This avoids the indirection
  325. ;; through Bash, which in turn avoids getting Bash's
  326. ;; own locale warnings.
  327. (substitute* (string-append out "/bin/guix")
  328. (("!#")
  329. (string-append
  330. "!#\n\n"
  331. (object->string
  332. `(set! %load-path (append ',path %load-path)))
  333. "\n"
  334. (object->string
  335. `(set! %load-compiled-path
  336. (append ',gopath %load-compiled-path)))
  337. "\n"
  338. (object->string
  339. `(let ((path (getenv "GUIX_LOCPATH")))
  340. (setenv "GUIX_LOCPATH"
  341. (if path
  342. (string-append path ":" ,locpath)
  343. ,locpath))))
  344. "\n\n"))))))
  345. ;; The 'guix' executable has 'OUT/libexec/guix/guile' as
  346. ;; its shebang; that should remain unchanged, thus remove
  347. ;; the 'patch-shebangs' phase, which would otherwise
  348. ;; change it to 'GUILE/bin/guile'.
  349. (delete 'patch-shebangs))))
  350. (native-inputs `(("pkg-config" ,pkg-config)
  351. ;; Guile libraries are needed here for
  352. ;; cross-compilation.
  353. ("guile" ,guile-3.0-latest) ;for faster builds
  354. ("gnutls" ,gnutls)
  355. ,@(if (%current-target-system)
  356. '()
  357. `(("guile-avahi" ,guile-avahi)))
  358. ("guile-gcrypt" ,guile-gcrypt)
  359. ("guile-json" ,guile-json-4)
  360. ("guile-lib" ,guile-lib)
  361. ("guile-sqlite3" ,guile-sqlite3)
  362. ("guile-zlib" ,guile-zlib)
  363. ("guile-lzlib" ,guile-lzlib)
  364. ("guile-zstd" ,guile-zstd)
  365. ("guile-ssh" ,guile-ssh)
  366. ("guile-git" ,guile-git)
  367. ;; XXX: Keep the development inputs here even though
  368. ;; they're unnecessary, just so that 'guix environment
  369. ;; guix' always contains them.
  370. ("autoconf" ,autoconf)
  371. ("automake" ,automake)
  372. ("gettext" ,gettext-minimal)
  373. ("texinfo" ,texinfo)
  374. ("graphviz" ,graphviz)
  375. ("help2man" ,help2man)
  376. ("po4a" ,po4a)))
  377. (inputs
  378. `(("bzip2" ,bzip2)
  379. ("gzip" ,gzip)
  380. ("sqlite" ,sqlite)
  381. ("libgcrypt" ,libgcrypt)
  382. ("guile" ,guile-3.0-latest)
  383. ;; Some of the tests use "unshare" when it is available.
  384. ("util-linux" ,util-linux)
  385. ;; Many tests rely on the 'guile-bootstrap' package, which is why we
  386. ;; have it here.
  387. ("boot-guile" ,(bootstrap-guile-origin (%current-system)))
  388. ,@(if (and (not (%current-target-system))
  389. (string=? (%current-system) "x86_64-linux"))
  390. `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux")))
  391. '())
  392. ,@(if (%current-target-system)
  393. `(("xz" ,xz))
  394. '())
  395. ;; Tests also rely on these bootstrap executables.
  396. ("bootstrap/bash" ,(bootstrap-executable "bash" (%current-system)))
  397. ("bootstrap/mkdir" ,(bootstrap-executable "mkdir" (%current-system)))
  398. ("bootstrap/tar" ,(bootstrap-executable "tar" (%current-system)))
  399. ("bootstrap/xz" ,(bootstrap-executable "xz" (%current-system)))
  400. ("disarchive" ,disarchive) ;for 'guix perform-download'
  401. ("glibc-utf8-locales" ,glibc-utf8-locales)))
  402. (propagated-inputs
  403. `(("gnutls" ,gnutls)
  404. ;; Avahi requires "glib" which doesn't cross-compile yet.
  405. ,@(if (%current-target-system)
  406. '()
  407. `(("guile-avahi" ,guile-avahi)))
  408. ("guile-gcrypt" ,guile-gcrypt)
  409. ("guile-json" ,guile-json-4)
  410. ("guile-lib" ,guile-lib)
  411. ("guile-sqlite3" ,guile-sqlite3)
  412. ("guile-ssh" ,guile-ssh)
  413. ("guile-git" ,guile-git)
  414. ("guile-zlib" ,guile-zlib)
  415. ("guile-lzlib" ,guile-lzlib)
  416. ("guile-zstd" ,guile-zstd)))
  417. (native-search-paths
  418. (list (search-path-specification
  419. (variable "GUIX_EXTENSIONS_PATH")
  420. (files '("share/guix/extensions")))
  421. ;; (guix git) and (guix build download) honor this variable whose
  422. ;; name comes from OpenSSL.
  423. (search-path-specification
  424. (variable "SSL_CERT_DIR")
  425. (separator #f) ;single entry
  426. (files '("etc/ssl/certs")))))
  427. (home-page "https://www.gnu.org/software/guix/")
  428. (synopsis "Functional package manager for installed software packages and versions")
  429. (description
  430. "GNU Guix is a functional package manager for the GNU system, and is
  431. also a distribution thereof. It includes a virtual machine image. Besides
  432. the usual package management features, it also supports transactional
  433. upgrades and roll-backs, per-user profiles, and much more. It is based on
  434. the Nix package manager.")
  435. (license license:gpl3+)
  436. (properties '((ftp-server . "alpha.gnu.org"))))))
  437. (define-public guix-daemon
  438. ;; This package is for internal consumption: it allows us to quickly build
  439. ;; the 'guix-daemon' program and use that in (guix self), used by 'guix
  440. ;; pull'.
  441. (package
  442. (inherit guix)
  443. (properties `((hidden? . #t)))
  444. (name "guix-daemon")
  445. ;; Use a minimum set of dependencies.
  446. (native-inputs
  447. (fold alist-delete (package-native-inputs guix)
  448. '("po4a" "graphviz" "help2man")))
  449. (inputs
  450. `(("gnutls" ,gnutls)
  451. ("guile-git" ,guile-git)
  452. ("guile-json" ,guile-json-3)
  453. ("guile-gcrypt" ,guile-gcrypt)
  454. ,@(fold alist-delete (package-inputs guix)
  455. '("boot-guile" "boot-guile/i686" "util-linux"))))
  456. (propagated-inputs '())
  457. (arguments
  458. (substitute-keyword-arguments (package-arguments guix)
  459. ((#:configure-flags flags '())
  460. ;; Pretend we have those libraries; we don't actually need them.
  461. `(append ,flags
  462. '("guix_cv_have_recent_guile_sqlite3=yes"
  463. "guix_cv_have_recent_guile_ssh=yes")))
  464. ((#:tests? #f #f)
  465. #f)
  466. ((#:phases phases '%standard-phases)
  467. `(modify-phases ,phases
  468. (add-after 'unpack 'change-default-guix
  469. (lambda _
  470. ;; We need to tell 'guix-daemon' which 'guix' command to use.
  471. ;; Here we use a questionable hack where we hard-code root's
  472. ;; current guix, which could be wrong (XXX). Note that scripts
  473. ;; like 'guix perform-download' do not run as root so we assume
  474. ;; that they have access to /var/guix/profiles/per-user/root.
  475. (substitute* "nix/libstore/globals.cc"
  476. (("guixProgram = (.*)nixBinDir + \"/guix\"" _ before)
  477. (string-append "guixProgram = " before
  478. "/var/guix/profiles/per-user/root\
  479. /current-guix/bin/guix")))
  480. #t))
  481. (replace 'build
  482. (lambda _
  483. (invoke "make" "nix/libstore/schema.sql.hh")
  484. (invoke "make" "-j" (number->string
  485. (parallel-job-count))
  486. "guix-daemon")))
  487. (delete 'copy-bootstrap-guile)
  488. (replace 'install
  489. (lambda* (#:key outputs #:allow-other-keys)
  490. (invoke "make" "install-binPROGRAMS")))
  491. (delete 'wrap-program)))))))
  492. (define-public guile3.0-guix
  493. (deprecated-package "guile3.0-guix" guix))
  494. (define-public guix-minimal
  495. ;; A version of Guix which is built with the minimal set of dependencies, as
  496. ;; outlined in the README "Requirements" section. Intended as a CI job, so
  497. ;; marked as hidden.
  498. (hidden-package
  499. (package
  500. (inherit guix)
  501. (name "guix-minimal")
  502. (native-inputs
  503. (fold alist-delete
  504. (package-native-inputs guix)
  505. '("guile-ssh")))
  506. (propagated-inputs
  507. (fold alist-delete
  508. (package-propagated-inputs guix)
  509. '("guile-ssh"))))))
  510. (define (source-file? file stat)
  511. "Return true if FILE is likely a source file, false if it is a typical
  512. generated file."
  513. (define (wrong-extension? file)
  514. (or (string-suffix? "~" file)
  515. (member (file-extension file)
  516. '("o" "a" "lo" "so" "go"))))
  517. (match (basename file)
  518. ((or ".git" "autom4te.cache" "configure" "Makefile" "Makefile.in" ".libs")
  519. #f)
  520. ((? wrong-extension?)
  521. #f)
  522. (_
  523. #t)))
  524. (define-public current-guix-package
  525. ;; This parameter allows callers to override the package that 'current-guix'
  526. ;; returns. This is useful when 'current-guix' cannot compute it by itself,
  527. ;; for instance because it's not running from a source code checkout.
  528. (make-parameter #f))
  529. (define-public current-guix
  530. (let* ((repository-root (delay (canonicalize-path
  531. (string-append (current-source-directory)
  532. "/../.."))))
  533. (select? (delay (or (git-predicate (force repository-root))
  534. source-file?))))
  535. (lambda ()
  536. "Return a package representing Guix built from the current source tree.
  537. This works by adding the current source tree to the store (after filtering it
  538. out) and returning a package that uses that as its 'source'."
  539. (or (current-guix-package)
  540. (package
  541. (inherit guix)
  542. (version (string-append (package-version guix) "+"))
  543. (source (local-file (force repository-root) "guix-current"
  544. #:recursive? #t
  545. #:select? (force select?))))))))
  546. (define-public guix-icons
  547. (package
  548. (inherit guix)
  549. (name "guix-icons")
  550. (version "0.1")
  551. (source %artwork-repository)
  552. (build-system trivial-build-system)
  553. (native-inputs
  554. `(("imagemagick" ,imagemagick)))
  555. (inputs
  556. '())
  557. (arguments
  558. `(#:modules ((guix build utils)
  559. (gnu build svg))
  560. #:builder
  561. ,(with-extensions (list guile-rsvg guile-cairo)
  562. #~(begin
  563. (use-modules (guix build utils)
  564. (gnu build svg))
  565. (let* ((logo (string-append #$source "/logo/Guix.svg"))
  566. (logo-white
  567. (string-append #$source
  568. "/logo/Guix-horizontal-white.svg"))
  569. (theme "hicolor")
  570. (category "apps")
  571. (sizes '(16 24 32 48 64 72 96 128 256 512 1024))
  572. (icons
  573. (string-append #$output "/share/icons/" theme))
  574. (scalable-dir
  575. (string-append icons "/scalable/" category)))
  576. (setenv "XDG_CACHE_HOME" (getcwd))
  577. ;; Create the scalable icon files.
  578. (mkdir-p scalable-dir)
  579. (copy-file logo
  580. (string-append scalable-dir "/guix-icon.svg"))
  581. (copy-file logo-white
  582. (string-append scalable-dir
  583. "/guix-white-icon.svg"))
  584. ;; Create the fixed dimensions icon files.
  585. (for-each
  586. (lambda (size)
  587. (let* ((dimension
  588. (format #f "~ax~a" size size))
  589. (file
  590. (string-append icons "/" dimension "/" category
  591. "/guix-icon.png")))
  592. (mkdir-p (dirname file))
  593. (svg->png logo file
  594. #:width size
  595. #:height size)))
  596. sizes))))))
  597. (synopsis "GNU Guix icons")
  598. (description "This package contains GNU Guix icons organized according to
  599. the Icon Theme Specification. They can be used by applications querying the
  600. GTK icon cache for instance.")))
  601. ;;;
  602. ;;; Other tools.
  603. ;;;
  604. (define-public nix
  605. (package
  606. (name "nix")
  607. (version "2.3.13")
  608. (source (origin
  609. (method url-fetch)
  610. (uri (string-append "https://releases.nixos.org/nix/nix-"
  611. version "/nix-" version ".tar.xz"))
  612. (sha256
  613. (base32
  614. "0631qk2lgd76y6g2z45wy6lcpv647r2a08jd2dagzzpwniy68d3h"))))
  615. (build-system gnu-build-system)
  616. (arguments
  617. `(#:configure-flags '("--sysconfdir=/etc" "--enable-gc")
  618. #:phases
  619. (modify-phases %standard-phases
  620. (replace 'install
  621. ;; Don't try & fail to create subdirectories in /etc, but keep them
  622. ;; in the output as examples.
  623. (lambda* (#:key (make-flags '()) outputs #:allow-other-keys)
  624. (let* ((out (assoc-ref outputs "out"))
  625. (etc (string-append out "/etc")))
  626. (apply invoke "make" "install"
  627. (string-append "sysconfdir=" etc)
  628. (string-append "profiledir=" etc "/profile.d")
  629. make-flags)))))))
  630. (native-inputs `(("pkg-config" ,pkg-config)))
  631. (inputs `(("boost" ,boost)
  632. ("brotli" ,brotli)
  633. ("bzip2" ,bzip2)
  634. ("curl" ,curl)
  635. ("editline" ,editline)
  636. ("libgc" ,libgc)
  637. ("libseccomp" ,libseccomp)
  638. ("libsodium" ,libsodium)
  639. ("openssl" ,openssl)
  640. ("sqlite" ,sqlite)
  641. ("xz" ,xz)))
  642. (home-page "https://nixos.org/nix/")
  643. (synopsis "The Nix package manager")
  644. (description
  645. "Nix is a purely functional package manager. This means that it treats
  646. packages like values in purely functional programming languages such as
  647. Haskell—they are built by functions that don't have side-effects, and they
  648. never change after they have been built. Nix stores packages in the Nix
  649. store, usually the directory /nix/store, where each package has its own unique
  650. sub-directory.")
  651. (license license:lgpl2.1+)))
  652. (define-public stow
  653. (package
  654. (name "stow")
  655. (version "2.3.1")
  656. (source (origin
  657. (method url-fetch)
  658. (uri (string-append "mirror://gnu/stow/stow-"
  659. version ".tar.gz"))
  660. (sha256
  661. (base32
  662. "0jrxy12ywn7smdzdnvwzjw77l6knx6jkj2rckgykg1dpf6bdkm89"))))
  663. (build-system gnu-build-system)
  664. (inputs
  665. `(("perl" ,perl)))
  666. (native-inputs
  667. `(("perl-test-simple" ,perl-test-simple)
  668. ("perl-test-output" ,perl-test-output)
  669. ("perl-capture-tiny" ,perl-capture-tiny)
  670. ("perl-io-stringy" ,perl-io-stringy)))
  671. (home-page "https://www.gnu.org/software/stow/")
  672. (synopsis "Managing installed software packages")
  673. (description
  674. "GNU Stow is a symlink manager. It generates symlinks to directories
  675. of data and makes them appear to be merged into the same directory. It is
  676. typically used for managing software packages installed from source, by
  677. letting you install them apart in distinct directories and then create
  678. symlinks to the files in a common directory such as /usr/local.")
  679. (license license:gpl3+)))
  680. (define-public xstow
  681. (package
  682. (name "xstow")
  683. (version "1.0.2")
  684. (source (origin
  685. (method url-fetch)
  686. (uri (string-append "mirror://sourceforge/xstow/xstow-"
  687. version ".tar.bz2"))
  688. (sha256
  689. (base32
  690. "1vy6lcswpkixh7h5mvsmq2wbcih6lpsmcva3m7v6f5npllciy13g"))))
  691. (build-system gnu-build-system)
  692. (synopsis "Replacement of GNU Stow written in C++")
  693. (description
  694. "XStow is a replacement of GNU Stow written in C++. It supports all
  695. features of Stow with some extensions.")
  696. (home-page "http://xstow.sourceforge.net/")
  697. (license license:gpl2)))
  698. (define-public rpm
  699. (package
  700. (name "rpm")
  701. (version "4.16.1.3")
  702. (source (origin
  703. (method url-fetch)
  704. (uri (string-append "http://ftp.rpm.org/releases/rpm-"
  705. (version-major+minor version) ".x/rpm-"
  706. version ".tar.bz2"))
  707. (sha256
  708. (base32
  709. "07g2g0adgjm29wqy94iqhpp5dk0hacfw1yf7kzycrrxnfbwwfgai"))))
  710. (build-system gnu-build-system)
  711. (arguments
  712. '(#:configure-flags '("--with-external-db" ;use the system's bdb
  713. "--enable-python"
  714. "--without-lua")
  715. #:phases (modify-phases %standard-phases
  716. (add-before 'configure 'set-nss-library-path
  717. (lambda* (#:key inputs #:allow-other-keys)
  718. (let ((nss (assoc-ref inputs "nss")))
  719. (setenv "LIBRARY_PATH"
  720. (string-append (getenv "LIBRARY_PATH") ":"
  721. nss "/lib/nss"))
  722. #t))))))
  723. (native-inputs
  724. `(("pkg-config" ,pkg-config)))
  725. (inputs
  726. `(("python" ,python)
  727. ("xz" ,xz)
  728. ("bdb" ,bdb)
  729. ("popt" ,popt)
  730. ("nss" ,nss)
  731. ("nspr" ,nspr)
  732. ("libarchive" ,libarchive)
  733. ("libgcrypt" ,libgcrypt)
  734. ("file" ,file)
  735. ("bzip2" ,bzip2)
  736. ("zlib" ,zlib)
  737. ("cpio" ,cpio)))
  738. (home-page "https://rpm.org/")
  739. (synopsis "The RPM Package Manager")
  740. (description
  741. "The RPM Package Manager (RPM) is a command-line driven package
  742. management system capable of installing, uninstalling, verifying, querying,
  743. and updating computer software packages. Each software package consists of an
  744. archive of files along with information about the package like its version, a
  745. description. There is also a library permitting developers to manage such
  746. transactions from C or Python.")
  747. ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
  748. (license license:gpl2+)))
  749. (define-public python-anaconda-client
  750. (package
  751. (name "python-anaconda-client")
  752. (version "1.8.0")
  753. (source
  754. (origin
  755. (method git-fetch)
  756. (uri (git-reference
  757. (url "https://github.com/Anaconda-Platform/anaconda-client")
  758. (commit version)))
  759. (file-name (git-file-name name version))
  760. (sha256
  761. (base32
  762. "1vyk0g0gci4z9psisb8h50zi3j1nwfdg1jw3j76cxv0brln0v3fw"))))
  763. (build-system python-build-system)
  764. (propagated-inputs
  765. `(("python-clyent" ,python-clyent)
  766. ("python-nbformat" ,python-nbformat)
  767. ("python-pyyaml" ,python-pyyaml)
  768. ("python-requests" ,python-requests)))
  769. (native-inputs
  770. `(("python-coverage" ,python-coverage)
  771. ("python-dateutil" ,python-dateutil)
  772. ("python-freezegun" ,python-freezegun)
  773. ("python-mock" ,python-mock)
  774. ("python-pillow" ,python-pillow)
  775. ("python-pytz" ,python-pytz)))
  776. (arguments
  777. `(#:phases
  778. (modify-phases %standard-phases
  779. ;; This is needed for some tests.
  780. (add-before 'check 'set-up-home
  781. (lambda* _ (setenv "HOME" "/tmp") #t))
  782. (add-before 'check 'remove-network-tests
  783. (lambda* _
  784. ;; Remove tests requiring a network connection
  785. (let ((network-tests '("tests/test_upload.py"
  786. "tests/test_authorizations.py"
  787. "tests/test_login.py"
  788. "tests/test_whoami.py"
  789. "utils/notebook/tests/test_data_uri.py"
  790. "utils/notebook/tests/test_base.py"
  791. "utils/notebook/tests/test_downloader.py"
  792. "inspect_package/tests/test_conda.py")))
  793. (with-directory-excursion "binstar_client"
  794. (for-each delete-file network-tests)))
  795. #t)))))
  796. (home-page "https://github.com/Anaconda-Platform/anaconda-client")
  797. (synopsis "Anaconda Cloud command line client library")
  798. (description
  799. "Anaconda Cloud command line client library provides an interface to
  800. Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
  801. environments.")
  802. (license license:bsd-3)))
  803. (define-public python-conda-package-handling
  804. (package
  805. (name "python-conda-package-handling")
  806. (version "1.7.3")
  807. (source
  808. (origin
  809. (method git-fetch)
  810. (uri (git-reference
  811. (url "https://github.com/conda/conda-package-handling/")
  812. (commit version)))
  813. (file-name (git-file-name name version))
  814. (sha256
  815. (base32
  816. "1dq6f5ks3cinb355x712bls9bvv6bli6x3c43sdkqvawdw8xgv9j"))))
  817. (build-system python-build-system)
  818. (arguments
  819. `(#:phases
  820. (modify-phases %standard-phases
  821. (add-after 'unpack 'use-unmodified-libarchive
  822. (lambda _
  823. (substitute* "setup.py"
  824. (("archive_and_deps") "archive"))))
  825. (replace 'check
  826. (lambda* (#:key inputs outputs #:allow-other-keys)
  827. (add-installed-pythonpath inputs outputs)
  828. (invoke "pytest" "-vv" "tests"))))))
  829. (propagated-inputs
  830. `(("python-six" ,python-six)
  831. ("python-tqdm" ,python-tqdm)))
  832. (inputs
  833. `(("libarchive" ,libarchive)))
  834. (native-inputs
  835. `(("python-cython" ,python-cython)
  836. ("python-pytest" ,python-pytest)
  837. ("python-pytest-cov" ,python-pytest-cov)
  838. ("python-pytest-mock" ,python-pytest-mock)
  839. ("python-mock" ,python-mock)))
  840. (home-page "https://conda.io")
  841. (synopsis "Create and extract conda packages of various formats")
  842. (description
  843. "This library is an abstraction of Conda package handling and a tool for
  844. extracting, creating, and converting between formats.")
  845. (license license:bsd-3)))
  846. (define-public conda
  847. (package
  848. (name "conda")
  849. (version "4.10.3")
  850. (source
  851. (origin
  852. (method git-fetch)
  853. (uri (git-reference
  854. (url "https://github.com/conda/conda")
  855. (commit version)))
  856. (file-name (git-file-name name version))
  857. (sha256
  858. (base32
  859. "1w4yy62bsvkybjvcm5fspck4ns5j16nplzpbx6bxv7zhx69pcp4n"))))
  860. (build-system python-build-system)
  861. (arguments
  862. `(#:phases
  863. (modify-phases %standard-phases
  864. (add-after 'unpack 'fix-permissions
  865. (lambda _
  866. ;; This file is no longer writable after downloading with
  867. ;; 'git-fetch'
  868. (make-file-writable
  869. "tests/conda_env/support/saved-env/environment.yml")))
  870. (add-after 'unpack 'fix-ruamel-yaml-dependency
  871. (lambda _
  872. (substitute* "setup.py"
  873. (("ruamel_yaml_conda") "ruamel.yaml"))))
  874. (add-after 'unpack 'correct-python-executable-name
  875. (lambda* (#:key inputs #:allow-other-keys)
  876. (let ((python (assoc-ref inputs "python-wrapper")))
  877. #;
  878. (substitute* "conda/common/path.py"
  879. (("python_version or ''")
  880. "python_version or '3'"))
  881. (substitute* "conda/core/initialize.py"
  882. (("python_exe = join")
  883. (format #f "python_exe = \"~a/bin/python\" #"
  884. python))))
  885. #t))
  886. (add-after 'unpack 'do-not-use-python-root-as-prefix
  887. (lambda* (#:key inputs outputs #:allow-other-keys)
  888. (let ((out (assoc-ref outputs "out"))
  889. (python (assoc-ref inputs "python-wrapper")))
  890. (substitute* "tests/core/test_initialize.py"
  891. (("\"\"\"\\) % conda_prefix")
  892. (format #f "\"\"\") % \"~a\"" python))
  893. (("CONDA_PYTHON_EXE \"%s\"' % join\\(conda_prefix")
  894. (format #f "CONDA_PYTHON_EXE \"%s\"' % join(\"~a\""
  895. python))
  896. (("conda_prefix = abspath\\(sys.prefix\\)")
  897. (format #f "conda_prefix = abspath(\"~a\")" out)))
  898. (substitute* "conda/base/context.py"
  899. (("os.chdir\\(sys.prefix\\)")
  900. (format #f "os.chdir(\"~a\")" out))
  901. (("sys.prefix, '.condarc'")
  902. (format #f "\"~a\", '.condarc'" out))
  903. (("return abspath\\(sys.prefix\\)")
  904. (format #f "return abspath(\"~a\")" out))
  905. (("os.path.join\\(sys.prefix, bin_dir, exe\\)")
  906. (format #f "\"~a/bin/conda\"" out))
  907. (("'CONDA_EXE', sys.executable")
  908. (format #f "'CONDA_EXE', \"~a/bin/conda\"" out))))
  909. #t))
  910. (add-before 'build 'create-version-file
  911. (lambda _
  912. (with-output-to-file "conda/.version"
  913. (lambda () (display ,version)))
  914. #t))
  915. (replace 'check
  916. (lambda _
  917. (setenv "HOME" "/tmp")
  918. (invoke "py.test" "-vv"
  919. "-k"
  920. (string-append
  921. "not integration"
  922. ;; This one reports a newer version of conda than
  923. ;; expected.
  924. " and not test_auto_update_conda"
  925. ;; This fails because the output directory is not a
  926. ;; Conda environment.
  927. " and not test_list"
  928. ;; This fails because we patched the default root
  929. ;; prefix.
  930. " and not test_default_target_is_root_prefix"
  931. ;; These fail because ...
  932. ;; TODO: conda patches its own shebang to
  933. ;; $conda-prefix/bin/python, which is obviously wrong.
  934. " and not test_run_returns_int"
  935. " and not test_run_returns_zero_errorlevel"
  936. " and not test_run_returns_nonzero_errorlevel"
  937. ;; TODO: I don't understand what this failure means
  938. " and not test_PrefixData_return_value_contract"
  939. ;; TODO: same here
  940. " and not test_install_1"
  941. ;; Not sure if this is really wrong. This fails because
  942. ;; /gnu/store/...python-conda-4.8.3/bin/python
  943. ;; is not /gnu/store/...python-wrapper-3.8.2/bin/python
  944. " and not test_make_entry_point"))))
  945. (add-after 'install 'init
  946. ;; This writes a whole bunch of shell initialization files to the
  947. ;; prefix directory. Many features of conda can only be used after
  948. ;; running "conda init".
  949. (lambda* (#:key inputs outputs #:allow-other-keys)
  950. (add-installed-pythonpath inputs outputs)
  951. (setenv "HOME" "/tmp")
  952. (invoke (string-append (assoc-ref outputs "out")
  953. "/bin/conda")
  954. "init"))))))
  955. (inputs
  956. `(("python-wrapper" ,python-wrapper)))
  957. (propagated-inputs
  958. `(("python-anaconda-client" ,python-anaconda-client)
  959. ("python-conda-package-handling" ,python-conda-package-handling)
  960. ("python-cytoolz" ,python-cytoolz)
  961. ("python-pycosat" ,python-pycosat)
  962. ("python-pytest" ,python-pytest)
  963. ("python-pyyaml" ,python-pyyaml)
  964. ("python-requests" ,python-requests)
  965. ("python-responses" ,python-responses)
  966. ("python-ruamel.yaml" ,python-ruamel.yaml)
  967. ("python-tqdm" ,python-tqdm)
  968. ;; XXX: This is dragged in by libarchive and is needed at runtime.
  969. ("zstd" ,zstd)))
  970. (native-inputs
  971. `(("python-pytest-timeout" ,python-pytest-timeout)))
  972. (home-page "https://github.com/conda/conda")
  973. (synopsis "Cross-platform, OS-agnostic, system-level binary package manager")
  974. (description
  975. "Conda is a cross-platform, Python-agnostic binary package manager. It
  976. is the package manager used by Anaconda installations, but it may be used for
  977. other systems as well. Conda makes environments first-class citizens, making
  978. it easy to create independent environments even for C libraries. Conda is
  979. written entirely in Python.")
  980. (license license:bsd-3)))
  981. (define-public python-conda
  982. (deprecated-package "python-conda" conda))
  983. (define-public gwl
  984. (package
  985. (name "gwl")
  986. (version "0.3.0")
  987. (source (origin
  988. (method url-fetch)
  989. (uri (string-append "mirror://gnu/gwl/gwl-" version ".tar.gz"))
  990. (sha256
  991. (base32
  992. "1lqif00mq7fsaknbc2gvvcv1j89k311sm44jp9jklbrv0v2lc83n"))))
  993. (build-system gnu-build-system)
  994. (arguments
  995. `(#:parallel-build? #false ; for reproducibility
  996. #:make-flags
  997. '("GUILE_AUTO_COMPILE=0")))
  998. (native-inputs
  999. `(("autoconf" ,autoconf)
  1000. ("automake" ,automake)
  1001. ("pkg-config" ,pkg-config)
  1002. ("texinfo" ,texinfo)
  1003. ("graphviz" ,graphviz)))
  1004. (inputs
  1005. (let ((p (package-input-rewriting
  1006. `((,guile-3.0 . ,guile-3.0-latest))
  1007. #:deep? #false)))
  1008. `(("guix" ,guix)
  1009. ("guile" ,guile-3.0-latest)
  1010. ("guile-commonmark" ,(p guile-commonmark))
  1011. ("guile-config" ,(p guile-config))
  1012. ("guile-gcrypt" ,(p guile-gcrypt))
  1013. ("guile-pfds" ,(p guile-pfds))
  1014. ("guile-syntax-highlight" ,(p guile-syntax-highlight))
  1015. ("guile-wisp" ,(p guile-wisp)))))
  1016. (home-page "https://workflows.guix.info")
  1017. (synopsis "Workflow management extension for GNU Guix")
  1018. (description "The @dfn{Guix Workflow Language} (GWL) provides an
  1019. extension to GNU Guix's declarative language for package management to
  1020. automate the execution of programs in scientific workflows. The GWL
  1021. can use process engines to integrate with various computing
  1022. environments.")
  1023. ;; The Scheme modules in guix/ and gnu/ are licensed GPL3+,
  1024. ;; the web interface modules in gwl/ are licensed AGPL3+,
  1025. ;; and the fonts included in this package are licensed OFL1.1.
  1026. (license (list license:gpl3+ license:agpl3+ license:silofl1.1))))
  1027. (define-public guix-build-coordinator
  1028. (let ((commit "c2f0c5b36f8294bb4c699806f9e8c576ae9b9f90")
  1029. (revision "33"))
  1030. (package
  1031. (name "guix-build-coordinator")
  1032. (version (git-version "0" revision commit))
  1033. (source (origin
  1034. (method git-fetch)
  1035. (uri (git-reference
  1036. (url "https://git.cbaines.net/git/guix/build-coordinator")
  1037. (commit commit)))
  1038. (sha256
  1039. (base32
  1040. "0nlh1cyvpbsfy9pk22xmgx0vb625j7qgv79y527q91c9fjn7g37v"))
  1041. (file-name (string-append name "-" version "-checkout"))))
  1042. (build-system gnu-build-system)
  1043. (arguments
  1044. `(#:modules (((guix build guile-build-system)
  1045. #:select (target-guile-effective-version))
  1046. ,@%gnu-build-system-modules)
  1047. #:imported-modules ((guix build guile-build-system)
  1048. ,@%gnu-build-system-modules)
  1049. #:phases
  1050. (modify-phases %standard-phases
  1051. (add-before 'build 'set-GUILE_AUTO_COMPILE
  1052. (lambda _
  1053. ;; To avoid warnings relating to 'guild'.
  1054. (setenv "GUILE_AUTO_COMPILE" "0")
  1055. #t))
  1056. (add-after 'install 'wrap-executable
  1057. (lambda* (#:key inputs outputs target #:allow-other-keys)
  1058. (let* ((out (assoc-ref outputs "out"))
  1059. (bin (string-append out "/bin"))
  1060. (guile (assoc-ref inputs "guile"))
  1061. (version (target-guile-effective-version))
  1062. (scm (string-append out "/share/guile/site/" version))
  1063. (go (string-append out "/lib/guile/" version "/site-ccache")))
  1064. (for-each
  1065. (lambda (file)
  1066. (simple-format (current-error-port) "wrapping: ~A\n" file)
  1067. (let ((guile-inputs (list
  1068. "guile-json"
  1069. "guile-gcrypt"
  1070. "guix"
  1071. "guile-prometheus"
  1072. "guile-lib"
  1073. "guile-lzlib"
  1074. "guile-zlib"
  1075. "guile-sqlite3"
  1076. "gnutls"
  1077. ,@(if (hurd-target?)
  1078. '()
  1079. '("guile-fibers")))))
  1080. (wrap-program file
  1081. `("PATH" ":" prefix
  1082. (,bin
  1083. ;; Support building without sqitch as an input, as it
  1084. ;; can't be cross-compiled yet
  1085. ,@(or (and=> (assoc-ref inputs "sqitch")
  1086. list)
  1087. '())))
  1088. `("GUILE_LOAD_PATH" ":" prefix
  1089. (,scm ,(string-join
  1090. (map (lambda (input)
  1091. (simple-format
  1092. #f "~A/share/guile/site/~A"
  1093. (assoc-ref inputs input)
  1094. version))
  1095. guile-inputs)
  1096. ":")))
  1097. `("GUILE_LOAD_COMPILED_PATH" ":" prefix
  1098. (,go ,(string-join
  1099. (map (lambda (input)
  1100. (simple-format
  1101. #f "~A/lib/guile/~A/site-ccache"
  1102. (assoc-ref inputs input)
  1103. version))
  1104. guile-inputs)
  1105. ":"))))
  1106. (when target
  1107. ;; XXX work around wrap-program picking bash for the
  1108. ;; host rather than target
  1109. (let ((bash (assoc-ref inputs "bash")))
  1110. (substitute* file
  1111. (("^#!.*/bash")
  1112. (string-append "#! " bash "/bin/bash")))))))
  1113. (find-files bin)))
  1114. #t))
  1115. (delete 'strip)))) ; As the .go files aren't compatible
  1116. (native-inputs
  1117. `(("pkg-config" ,pkg-config)
  1118. ("autoconf" ,autoconf)
  1119. ("automake" ,automake)
  1120. ("gnutls" ,gnutls)
  1121. ;; Guile libraries are needed here for cross-compilation.
  1122. ("guile-json" ,guile-json-4)
  1123. ("guile-gcrypt" ,guile-gcrypt)
  1124. ("guix" ,guix)
  1125. ("guile-prometheus" ,guile-prometheus)
  1126. ("guile-fibers" ,guile-fibers)
  1127. ("guile-lib" ,guile-lib)
  1128. ("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))))
  1129. (inputs
  1130. `(("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))
  1131. ,@(if (%current-target-system)
  1132. `(("bash" ,bash-minimal))
  1133. '())
  1134. ("sqlite" ,sqlite)
  1135. ,@(if (hurd-target?)
  1136. '()
  1137. `(("sqitch" ,sqitch)))))
  1138. (propagated-inputs
  1139. `(,@(if (hurd-target?)
  1140. '()
  1141. `(("guile-fibers" ,guile-fibers)))
  1142. ("guile-prometheus" ,guile-prometheus)
  1143. ("guile-gcrypt" ,guile-gcrypt)
  1144. ("guile-json" ,guile-json-4)
  1145. ("guile-lib" ,guile-lib)
  1146. ("guile-lzlib" ,guile-lzlib)
  1147. ("guile-zlib" ,guile-zlib)
  1148. ("guile-sqlite3" ,guile-sqlite3)
  1149. ("guix" ,guix)
  1150. ("gnutls" ,gnutls)))
  1151. (home-page "https://git.cbaines.net/guix/build-coordinator/")
  1152. (synopsis "Tool to help build derivations")
  1153. (description
  1154. "The Guix Build Coordinator helps with performing lots of builds across
  1155. potentially many machines, and with doing something with the results and
  1156. outputs of those builds.")
  1157. (license license:gpl3+))))
  1158. (define-public guix-jupyter
  1159. (package
  1160. (name "guix-jupyter")
  1161. (version "0.2.2")
  1162. (home-page "https://gitlab.inria.fr/guix-hpc/guix-kernel")
  1163. (source (origin
  1164. (method git-fetch)
  1165. (uri (git-reference (url home-page)
  1166. (commit (string-append "v" version))))
  1167. (sha256
  1168. (base32
  1169. "17m6970wnvwlbarq4gxz5bakhzyhq5ch8qd8jw55ydccpv6473kq"))
  1170. (file-name (string-append "guix-jupyter-" version "-checkout"))))
  1171. (build-system gnu-build-system)
  1172. (arguments
  1173. `(#:modules ((srfi srfi-26)
  1174. (ice-9 match)
  1175. (ice-9 popen)
  1176. (ice-9 rdelim)
  1177. (guix build utils)
  1178. (guix build gnu-build-system))
  1179. #:phases
  1180. (modify-phases %standard-phases
  1181. (add-after 'install 'sed-kernel-json
  1182. (lambda* (#:key inputs outputs #:allow-other-keys)
  1183. (let* ((out (assoc-ref outputs "out"))
  1184. (guix (assoc-ref inputs "guix"))
  1185. (guile (assoc-ref inputs "guile"))
  1186. (json (assoc-ref inputs "guile-json"))
  1187. (git (assoc-ref inputs "guile-git"))
  1188. (bs (assoc-ref inputs "guile-bytestructures"))
  1189. (s-zmq (assoc-ref inputs "guile-simple-zmq"))
  1190. (gcrypt (assoc-ref inputs "guile-gcrypt"))
  1191. (deps (list out s-zmq guix json git bs gcrypt))
  1192. (effective
  1193. (read-line
  1194. (open-pipe* OPEN_READ
  1195. (string-append guile "/bin/guile")
  1196. "-c" "(display (effective-version))")))
  1197. (path (map (cut string-append "-L\", \"" <>
  1198. "/share/guile/site/"
  1199. effective)
  1200. deps))
  1201. (gopath (map (cut string-append "-C\", \"" <>
  1202. "/lib/guile/" effective
  1203. "/site-ccache")
  1204. deps))
  1205. (kernel-dir (string-append out "/share/jupyter/kernels/guix/")))
  1206. (substitute* (string-append kernel-dir "kernel.json")
  1207. (("-s")
  1208. (string-join
  1209. (list (string-join path "\",\n\t\t\"")
  1210. (string-join gopath "\",\n\t\t\"")
  1211. "-s")
  1212. "\",\n\t\t\""))
  1213. (("guix-jupyter-kernel.scm")
  1214. (string-append out "/share/guile/site/3.0/"
  1215. "guix-jupyter-kernel.scm")))
  1216. #t))))))
  1217. (native-inputs
  1218. `(("autoconf" ,autoconf)
  1219. ("automake" ,automake)
  1220. ("pkg-config" ,pkg-config)
  1221. ;; For testing.
  1222. ("jupyter" ,jupyter)
  1223. ("python-ipython" ,python-ipython)
  1224. ("python-ipykernel" ,python-ipykernel)))
  1225. (inputs
  1226. `(("guix" ,guix)
  1227. ("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))))
  1228. (propagated-inputs
  1229. `(("guile-json" ,guile-json-4)
  1230. ("guile-simple-zmq" ,guile-simple-zmq)
  1231. ("guile-gcrypt" ,guile-gcrypt)))
  1232. (synopsis "Guix kernel for Jupyter")
  1233. (description
  1234. "Guix-Jupyter is a Jupyter kernel. It allows you to annotate notebooks
  1235. with information about their software dependencies, such that code is executed
  1236. in the right software environment. Guix-Jupyter spawns the actual kernels
  1237. such as @code{python-ipykernel} on behalf of the notebook user and runs them
  1238. in an isolated environment, in separate namespaces.")
  1239. (license license:gpl3+)))
  1240. (define-public gcab
  1241. (package
  1242. (name "gcab")
  1243. (version "1.4")
  1244. (source (origin
  1245. (method url-fetch)
  1246. (uri (string-append "mirror://gnome/sources/gcab/"
  1247. version "/gcab-" version ".tar.xz"))
  1248. (sha256
  1249. (base32
  1250. "13q43iqld4l50yra45lhvkd376pn6qpk7rkx374zn8y9wsdzm9b7"))))
  1251. (build-system meson-build-system)
  1252. (native-inputs
  1253. `(("glib:bin" ,glib "bin") ; for glib-mkenums
  1254. ("intltool" ,intltool)
  1255. ("pkg-config" ,pkg-config)
  1256. ("vala" ,vala)))
  1257. (inputs
  1258. `(("glib" ,glib)
  1259. ("zlib" ,zlib)))
  1260. (arguments
  1261. `(#:configure-flags
  1262. ;; XXX This ‘documentation’ is for developers, and fails informatively:
  1263. ;; Error in gtkdoc helper script: 'gtkdoc-mkhtml' failed with status 5
  1264. (list "-Ddocs=false"
  1265. "-Dintrospection=false")))
  1266. (home-page "https://wiki.gnome.org/msitools") ; no dedicated home page
  1267. (synopsis "Microsoft Cabinet file manipulation library")
  1268. (description
  1269. "The libgcab library provides GObject functions to read, write, and modify
  1270. Microsoft cabinet (.@dfn{CAB}) files.")
  1271. (license (list license:gpl2+ ; tests/testsuite.at
  1272. license:lgpl2.1+)))) ; the rest
  1273. (define-public msitools
  1274. (package
  1275. (name "msitools")
  1276. (version "0.100")
  1277. (source (origin
  1278. (method url-fetch)
  1279. (uri (string-append "mirror://gnome/sources/msitools/"
  1280. version "/msitools-" version ".tar.xz"))
  1281. (sha256
  1282. (base32
  1283. "1skq17qr2ic4qr3779j49byfm8rncwbsq9rj1a33ncn2m7isdwdv"))))
  1284. (build-system gnu-build-system)
  1285. (native-inputs
  1286. `(("bison" ,bison)
  1287. ("pkg-config" ,pkg-config)))
  1288. (inputs
  1289. `(("gcab" ,gcab)
  1290. ("glib" ,glib)
  1291. ("libgsf" ,libgsf)
  1292. ("libxml2" ,libxml2)
  1293. ("uuid" ,util-linux "lib")))
  1294. (home-page "https://wiki.gnome.org/msitools")
  1295. (synopsis "Windows Installer file manipulation tool")
  1296. (description
  1297. "msitools is a collection of command-line tools to inspect, extract, build,
  1298. and sign Windows@tie{}Installer (.@dfn{MSI}) files. It aims to be a solution
  1299. for packaging and deployment of cross-compiled Windows applications.")
  1300. (license license:lgpl2.1+)))
  1301. (define-public libostree
  1302. (package
  1303. (name "libostree")
  1304. (version "2021.3")
  1305. (source
  1306. (origin
  1307. (method url-fetch)
  1308. (uri (string-append
  1309. "https://github.com/ostreedev/ostree/releases/download/v"
  1310. (version-major+minor version) "/libostree-" version ".tar.xz"))
  1311. (sha256
  1312. (base32 "1cyhr3s7xsgnsais5m4cjwdwcq46naf25r1k042c4n1y1jgs798g"))))
  1313. (build-system gnu-build-system)
  1314. (arguments
  1315. '(#:phases
  1316. (modify-phases %standard-phases
  1317. (add-before 'check 'pre-check
  1318. (lambda _
  1319. ;; Don't try to use the non-existing '/var/tmp' as test
  1320. ;; directory.
  1321. (setenv "TEST_TMPDIR" (getenv "TMPDIR"))
  1322. #t)))
  1323. ;; XXX: fails with:
  1324. ;; tap-driver.sh: missing test plan
  1325. ;; tap-driver.sh: internal error getting exit status
  1326. ;; tap-driver.sh: fatal: I/O or internal error
  1327. #:tests? #f))
  1328. (native-inputs
  1329. `(("attr" ,attr) ; for tests
  1330. ("bison" ,bison)
  1331. ("glib:bin" ,glib "bin") ; for 'glib-mkenums'
  1332. ("gobject-introspection" ,gobject-introspection)
  1333. ("pkg-config" ,pkg-config)
  1334. ("xsltproc" ,libxslt)))
  1335. (inputs
  1336. `(("avahi" ,avahi)
  1337. ("docbook-xml" ,docbook-xml-4.2)
  1338. ("docbook-xsl" ,docbook-xsl)
  1339. ("e2fsprogs" ,e2fsprogs)
  1340. ("fuse" ,fuse)
  1341. ("glib" ,glib)
  1342. ("gpgme" ,gpgme)
  1343. ("libarchive" ,libarchive)
  1344. ("libsoup" ,libsoup)
  1345. ("util-linux" ,util-linux)))
  1346. (home-page "https://ostree.readthedocs.io/en/latest/")
  1347. (synopsis "Operating system and container binary deployment and upgrades")
  1348. (description
  1349. "@code{libostree} is both a shared library and suite of command line
  1350. tools that combines a \"git-like\" model for committing and downloading
  1351. bootable file system trees, along with a layer for deploying them and managing
  1352. the boot loader configuration.")
  1353. (license license:lgpl2.0+)))
  1354. (define-public flatpak
  1355. (package
  1356. (name "flatpak")
  1357. (version "1.10.2")
  1358. (source
  1359. (origin
  1360. (method url-fetch)
  1361. (uri (string-append "https://github.com/flatpak/flatpak/releases/download/"
  1362. version "/flatpak-" version ".tar.xz"))
  1363. (sha256
  1364. (base32 "1r6xw7r3ir2vaa30n3mily6m7d51cf4qv22fkqlzzy3js0wjf5fv"))))
  1365. ;; Wrap 'flatpak' so that GIO_EXTRA_MODULES is set, thereby allowing GIO to
  1366. ;; find the TLS backend in glib-networking.
  1367. (build-system glib-or-gtk-build-system)
  1368. (arguments
  1369. '(#:configure-flags
  1370. (list
  1371. "--enable-documentation=no" ;; FIXME
  1372. "--enable-system-helper=no"
  1373. "--localstatedir=/var"
  1374. (string-append "--with-system-bubblewrap="
  1375. (assoc-ref %build-inputs "bubblewrap")
  1376. "/bin/bwrap")
  1377. (string-append "--with-system-dbus-proxy="
  1378. (assoc-ref %build-inputs "xdg-dbus-proxy")
  1379. "/bin/xdg-dbus-proxy"))
  1380. #:phases
  1381. (modify-phases %standard-phases
  1382. (add-after 'unpack 'fix-tests
  1383. (lambda* (#:key inputs #:allow-other-keys)
  1384. (copy-recursively
  1385. (search-input-directory inputs "lib/locale")
  1386. "/tmp/locale")
  1387. (for-each make-file-writable (find-files "/tmp"))
  1388. (substitute* "tests/make-test-runtime.sh"
  1389. (("cp `which.*") "echo guix\n")
  1390. (("cp -r /usr/lib/locale/C\\.\\*")
  1391. (string-append "mkdir ${DIR}/usr/lib/locale/en_US; \
  1392. cp -r /tmp/locale/*/en_US.*")))
  1393. (substitute* "tests/libtest.sh"
  1394. (("/bin/kill") (which "kill"))
  1395. (("/usr/bin/python3") (which "python3")))
  1396. #t))
  1397. ;; Many tests fail for unknown reasons, so we just run a few basic
  1398. ;; tests.
  1399. (replace 'check
  1400. (lambda _
  1401. (setenv "HOME" "/tmp")
  1402. (invoke "make" "check"
  1403. "TESTS=tests/test-basic.sh tests/test-config.sh testcommon"))))))
  1404. (native-inputs
  1405. `(("bison" ,bison)
  1406. ("dbus" ,dbus) ; for dbus-daemon
  1407. ("gettext" ,gettext-minimal)
  1408. ("glib:bin" ,glib "bin") ; for glib-mkenums + gdbus-codegen
  1409. ("glibc-utf8-locales" ,glibc-utf8-locales)
  1410. ("gobject-introspection" ,gobject-introspection)
  1411. ("libcap" ,libcap)
  1412. ("pkg-config" ,pkg-config)
  1413. ("python" ,python)
  1414. ("python-pyparsing" ,python-pyparsing)
  1415. ("socat" ,socat)
  1416. ("which" ,which)))
  1417. (propagated-inputs `(("glib-networking" ,glib-networking)
  1418. ("gnupg" ,gnupg)
  1419. ("gsettings-desktop-schemas"
  1420. ,gsettings-desktop-schemas)))
  1421. (inputs
  1422. `(("appstream-glib" ,appstream-glib)
  1423. ("bubblewrap" ,bubblewrap)
  1424. ("dconf" ,dconf)
  1425. ("fuse" ,fuse)
  1426. ("gdk-pixbuf" ,gdk-pixbuf)
  1427. ("gpgme" ,gpgme)
  1428. ("json-glib" ,json-glib)
  1429. ("libarchive" ,libarchive)
  1430. ("libostree" ,libostree)
  1431. ("libseccomp" ,libseccomp)
  1432. ("libsoup" ,libsoup)
  1433. ("libxau" ,libxau)
  1434. ("libxml2" ,libxml2)
  1435. ("util-linux" ,util-linux)
  1436. ("xdg-dbus-proxy" ,xdg-dbus-proxy)))
  1437. (home-page "https://flatpak.org")
  1438. (synopsis "System for building, distributing, and running sandboxed desktop
  1439. applications")
  1440. (description "Flatpak is a system for building, distributing, and running
  1441. sandboxed desktop applications on GNU/Linux.")
  1442. (license license:lgpl2.1+)))
  1443. (define-public akku
  1444. (package
  1445. (name "akku")
  1446. (version "1.0.1")
  1447. (source (origin
  1448. (method git-fetch)
  1449. (uri (git-reference
  1450. (url "https://gitlab.com/akkuscm/akku.git")
  1451. (commit (string-append "v" version))))
  1452. (file-name (git-file-name name version))
  1453. (sha256 (base32 "1dm32ws3nshnnscd7k75zswxxs1pp25y2q4k8j5ms241hz47by3c"))))
  1454. (build-system gnu-build-system)
  1455. (arguments
  1456. '(#:phases (modify-phases %standard-phases
  1457. (replace 'bootstrap
  1458. (lambda* (#:key outputs #:allow-other-keys)
  1459. (for-each patch-shebang
  1460. '("bootstrap"
  1461. ".akku/env"))
  1462. (let* ((home "/tmp")
  1463. (datadir (string-append home "/.local/share/akku/")))
  1464. (mkdir-p datadir)
  1465. (invoke "touch" (string-append datadir "index.db"))
  1466. (setenv "HOME" home))
  1467. (invoke "./bootstrap")
  1468. #t))
  1469. (add-after 'install 'wrap-executables
  1470. (lambda* (#:key outputs inputs #:allow-other-keys)
  1471. (let ((out (assoc-ref outputs "out"))
  1472. (curl (assoc-ref inputs "curl")))
  1473. (wrap-program (string-append out "/bin/akku")
  1474. `("LD_LIBRARY_PATH" ":" prefix (,(string-append curl "/lib"))))
  1475. #t))))))
  1476. (native-inputs
  1477. `(("which" ,which)
  1478. ("autoconf" ,autoconf)
  1479. ("automake" ,automake)
  1480. ("pkg-config" ,pkg-config)))
  1481. (inputs
  1482. `(("guile" ,guile-3.0)
  1483. ("curl" ,curl)))
  1484. (home-page "https://akkuscm.org/")
  1485. (synopsis "Language package manager for Scheme")
  1486. (description
  1487. "Akku.scm is a project-based language package manager for R6RS and R7RS Scheme.
  1488. It is mainly meant for programmers who develop portable programs or libraries in Scheme,
  1489. but could potentially work for end-users of those programs. It also has a translator
  1490. from R7RS, which allows most R7RS code to run on R6RS implementations.")
  1491. (license license:gpl3+)))
  1492. (define-public modules
  1493. (package
  1494. (name "modules")
  1495. (version "4.8.0")
  1496. (source
  1497. (origin
  1498. (method url-fetch)
  1499. (uri (string-append "mirror://sourceforge/modules/Modules/modules-"
  1500. version "/modules-" version ".tar.bz2"))
  1501. (sha256 (base32 "1amz8qdqbvfdc8jv0j4720vywbz2gi7l3sr1lh37ilfbxy9lq9g9"))))
  1502. (build-system gnu-build-system)
  1503. (arguments
  1504. `(#:configure-flags
  1505. (list (string-append "--with-bin-search-path="
  1506. (assoc-ref %build-inputs "tcl") "/bin" ":"
  1507. (assoc-ref %build-inputs "procps") "/bin" ":"
  1508. (assoc-ref %build-inputs "less") "/bin" ":"
  1509. (assoc-ref %build-inputs "coreutils") "/bin")
  1510. (string-append "--with-tcl=" (assoc-ref %build-inputs "tcl") "/lib")
  1511. "--disable-compat-version")
  1512. #:test-target "test"
  1513. #:phases
  1514. (modify-phases %standard-phases
  1515. (add-before 'configure 'patch-add-modules
  1516. (lambda* (#:key inputs #:allow-other-keys)
  1517. (let ((coreutils (assoc-ref inputs "coreutils")))
  1518. (substitute* "script/add.modules.in"
  1519. (("/bin/(cat|cp|rm)" _ command)
  1520. (string-append coreutils "/bin/" command))
  1521. (("/bin/echo")
  1522. "echo")))))
  1523. (add-before 'configure 'patch-scripts-for-python-3
  1524. (lambda _
  1525. ;; Patch the script for python-3.
  1526. (substitute* "script/createmodule.py.in"
  1527. (("pathkeys.sort\\(\\)") "pathkeys = sorted(pathkeys)")
  1528. (("print\\(\"\\\\t\"\\*") "print(\"\\t\"*int")
  1529. (("@PYTHON@") (which "python3")))))
  1530. (add-before 'check 'patch-/bin/sh-and-nixbld-groups-in-tests
  1531. (lambda _
  1532. (use-modules (srfi srfi-1))
  1533. (let* ((groups-file (string-append (getcwd) "/nixbld-groups"))
  1534. (groups-file-z (string-append groups-file "-z"))
  1535. (nixbld-groups
  1536. (fold
  1537. (lambda (id prev)
  1538. (catch #t
  1539. (lambda () (cons (group:name (getgrnam id)) prev))
  1540. (lambda _ prev)))
  1541. '()
  1542. (vector->list (getgroups)))))
  1543. ;; Simulate "id -G -n" command output.
  1544. (call-with-output-file groups-file
  1545. (lambda (port)
  1546. (display (string-join nixbld-groups " ") port)
  1547. (display #\newline port)))
  1548. ;; Simulate "id -G -n -z" command output.
  1549. (call-with-output-file groups-file-z
  1550. (lambda (port)
  1551. (for-each
  1552. (lambda (group-name)
  1553. (display group-name port)
  1554. (display #\null port))
  1555. nixbld-groups)))
  1556. ;; Generate "modulecmd-test.tcl" before running "make test".
  1557. (invoke "make" "modulecmd-test.tcl")
  1558. ;; Substitute shell.
  1559. (substitute*
  1560. '("modulecmd-test.tcl"
  1561. "modulecmd.tcl"
  1562. "testsuite/modules.70-maint/380-edit.exp"
  1563. "compat/init/filter")
  1564. (("/bin/sh") (which "sh")))
  1565. ;; Skip tests that use supplementary groups.
  1566. (for-each
  1567. delete-file
  1568. '("testsuite/modules.20-locate/112-hide-user-group.exp"
  1569. "testsuite/modules.20-locate/117-forbid-user-group.exp"
  1570. "testsuite/modules.20-locate/119-hide-cascading.exp"
  1571. "testsuite/modules.50-cmds/140-system.exp"
  1572. "testsuite/modules.50-cmds/287-info-usergroups.exp"
  1573. "testsuite/modules.50-cmds/440-module-tag.exp"
  1574. "testsuite/modules.70-maint/220-config.exp"))
  1575. (for-each
  1576. (lambda (file)
  1577. (substitute* file
  1578. (("/bin/sh") (which "bash"))
  1579. ;; For some reason "kvm" group cannot be resolved for
  1580. ;; "nixbld" user. We replace "id ..." commands with
  1581. ;; "cat ..." that simulates them.
  1582. (("exec id -G -n -z") (string-append "exec cat " groups-file-z))
  1583. (("exec id -G -n") (string-append "exec cat " groups-file))))
  1584. '("testsuite/modules.00-init/005-init_ts.exp"
  1585. "testsuite/install.00-init/005-init_ts.exp"
  1586. "modulecmd-test.tcl"))))))))
  1587. (native-inputs
  1588. `(("dejagnu" ,dejagnu)
  1589. ("autoconf" ,autoconf)
  1590. ("which" ,which)))
  1591. (inputs
  1592. `(("tcl" ,tcl)
  1593. ("less" ,less)
  1594. ("procps" ,procps)
  1595. ("coreutils" ,coreutils)
  1596. ("python" ,python-3)))
  1597. (home-page "http://modules.sourceforge.net/")
  1598. (synopsis "Shell environment variables and aliases management")
  1599. (description "Modules simplify shell initialization and let users
  1600. modify their environment during the session with modulefiles. Modules are
  1601. used on high-performance clusters to dynamically add and remove paths
  1602. to specific versions of applications.")
  1603. (license license:gpl2+)))