package-management.scm 79 KB

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