gnunet.scm 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. ;;; packages - package definitions for GNU Guix
  2. ;;; Copyright (C) 2016, 2017 ng0
  3. ;;;
  4. ;;; This program is free software: you can redistribute it and/or modify
  5. ;;; it under the terms of the GNU Affero General Public License as
  6. ;;; published by the Free Software Foundation, either version 3 of the
  7. ;;; License, or (at your option) any later version.
  8. ;;;
  9. ;;; This program is distributed in the hope that it will be useful,
  10. ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;;; GNU Affero General Public License for more details.
  13. ;;;
  14. ;;; You should have received a copy of the GNU Affero General Public License
  15. ;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. (define-module (ng0 packages gnunet)
  17. #:use-module (guix build-system gnu)
  18. #:use-module (guix download)
  19. #:use-module (guix git-download)
  20. #:use-module ((guix licenses) #:prefix license:)
  21. #:use-module (guix packages)
  22. #:use-module (gnu packages)
  23. #:use-module (gnu packages admin)
  24. #:use-module (gnu packages aidc)
  25. #:use-module (gnu packages autotools)
  26. #:use-module (gnu packages bison)
  27. #:use-module (gnu packages compression)
  28. #:use-module (gnu packages databases)
  29. #:use-module (gnu packages gettext)
  30. #:use-module (gnu packages glib)
  31. #:use-module (gnu packages gnome)
  32. #:use-module (gnu packages gnunet)
  33. #:use-module (gnu packages gnupg)
  34. #:use-module (gnu packages gnuzilla)
  35. #:use-module (gnu packages gstreamer)
  36. #:use-module (gnu packages gtk)
  37. #:use-module (gnu packages libidn)
  38. #:use-module (gnu packages libunistring)
  39. #:use-module (gnu packages linux)
  40. #:use-module (gnu packages man)
  41. #:use-module (gnu packages image-viewers)
  42. #:use-module (gnu packages maths)
  43. #:use-module (gnu packages multiprecision)
  44. #:use-module (gnu packages ncurses)
  45. #:use-module (gnu packages pcre)
  46. #:use-module (gnu packages perl)
  47. #:use-module (gnu packages pkg-config)
  48. #:use-module (gnu packages pulseaudio)
  49. #:use-module (gnu packages python)
  50. #:use-module (gnu packages tls)
  51. #:use-module (gnu packages upnp)
  52. #:use-module (gnu packages web)
  53. #:use-module (gnu packages xiph))
  54. ;; TODO: Use HEAD without checking sum of it.
  55. ;; Explanation for name scheme: UNIXPATH is capped at 108 characters,
  56. ;; this causes lots of tests to fail.
  57. (define-public gnunetg
  58. (let* ((commit "61ef51d43a9069b5a2d680883b5d47c1fb237d82")
  59. (revision "14"))
  60. (package
  61. (inherit gnunet)
  62. (name "gnunetg")
  63. (version (string-append "0.10.1" revision
  64. (string-take commit 7)))
  65. (source
  66. (origin
  67. (method git-fetch)
  68. (uri (git-reference
  69. (url "https://gnunet.org/git/gnunet.git")
  70. (commit commit)))
  71. (file-name (string-append name "-" version "-checkout"))
  72. (sha256
  73. (base32
  74. "1d546nh58h575gcmqki8scnhc7i35dlkaf9x2ci8vv6l43f6pk3q"))))
  75. (build-system gnu-build-system)
  76. (inputs
  77. `(("glpk" ,glpk)
  78. ("gnurl" ,gnurl)
  79. ("gstreamer" ,gstreamer)
  80. ("gst-plugins-base" ,gst-plugins-base)
  81. ("gnutls" ,gnutls)
  82. ("libextractor" ,libextractor)
  83. ("libgcrypt" ,libgcrypt)
  84. ("libidn" ,libidn)
  85. ("libmicrohttpd" ,libmicrohttpd)
  86. ("libltdl" ,libltdl)
  87. ("libunistring" ,libunistring)
  88. ("openssl" ,openssl)
  89. ("opus" ,opus)
  90. ("pulseaudio" ,pulseaudio)
  91. ("sqlite" ,sqlite)
  92. ("zlib" ,zlib)
  93. ("perl" ,perl)
  94. ("python" ,python-2) ; tests and gnunet-qr
  95. ("jansson" ,jansson)
  96. ("ncurses" ,ncurses)
  97. ("nss" ,nss)
  98. ("gmp" ,gmp)
  99. ("miniupnpc" ,miniupnpc)
  100. ("bluez" ,bluez) ; for optional bluetooth feature
  101. ("glib" ,glib)
  102. ;; ("texlive-minimal" ,texlive-minimal) ; optional.
  103. ("libogg" ,libogg)))
  104. (native-inputs
  105. `(("pkg-config" ,pkg-config)
  106. ("autoconf" ,autoconf)
  107. ("automake" ,automake)
  108. ("gnu-gettext" ,gnu-gettext)
  109. ("libtool" ,libtool)))
  110. (outputs '("out" "debug"))
  111. (arguments
  112. `(#:configure-flags
  113. (list (string-append "--with-nssdir=" %output "/lib")
  114. "--enable-experimental")
  115. #:parallel-tests? #f ; parallel building is not functional
  116. #:tests? #f ; FAIL: test_gnunet_statistics.py
  117. #:phases
  118. ;; swap check and install phases and set paths to installed bin
  119. (modify-phases %standard-phases
  120. (add-after 'unpack 'patch-bin-sh
  121. (lambda _
  122. (substitute* "bootstrap"
  123. (("contrib/pogen.sh") "sh contrib/pogen.sh"))
  124. (for-each (lambda (f) (chmod f #o755))
  125. (find-files "po" ""))
  126. #t))
  127. (add-after 'patch-bin-sh 'bootstrap
  128. (lambda _
  129. (zero? (system* "sh" "bootstrap"))))
  130. ;; DISABLED until failing testcases are fixed.
  131. ;; this test fails in our environment, disable it:
  132. ;; XXX: specify which ones fail.
  133. ;; (add-after 'patch-bin-sh 'disable-test_quota_compliance_tcp_asymmetric
  134. ;; (lambda _
  135. ;; (substitute* '("src/transport/Makefile.am")
  136. ;; (("test_quota_compliance_tcp_asymmetric") ""))))
  137. ;; (("test_quota_compliance_http_asymmetric") "")
  138. ;; (("test_quota_compliance_https_asymmetric") "")
  139. ;; (("test_quota_compliance_unix") "")
  140. ;; (("test_quota_compliance_unix_asymmetric") ""))))
  141. ;; check is between build and install, fix this to:
  142. ;; build - install - check, else the test suite fails.
  143. (delete 'check)))))))
  144. ;; (add-after 'install 'set-path-for-check
  145. ;; (lambda* (#:key outputs #:allow-other-keys)
  146. ;; (let* ((out (assoc-ref outputs "out"))
  147. ;; (bin (string-append out "/bin"))
  148. ;; (lib (string-append out "/lib")))
  149. ;; (setenv "GNUNET_PREFIX" lib)
  150. ;; (setenv "PATH" (string-append (getenv "PATH") ":" bin))
  151. ;; ;; XXX: https://gnunet.org/bugs/view.php?id=4619#c11061
  152. ;; ;; Enable core dump before the tests.
  153. ;; ;; XXX: HOW??? ulimit -c unlimited
  154. ;; (zero? (system* "make" "check"))))))))
  155. (define-public gnunetgpg
  156. (package
  157. (inherit gnunetg)
  158. (name "gnunetgpg")
  159. (inputs
  160. `(("postgresql" ,postgresql)
  161. ,@(package-inputs gnunetg)))
  162. (synopsis "gnunet, variant with postgres")))
  163. (define-public gnunetgf
  164. (package
  165. (inherit gnunetg)
  166. (name "gnunetgf")
  167. (inputs
  168. `(("postgresql" ,postgresql)
  169. ("mysql" ,mysql)
  170. ,@(package-inputs gnunetg)))
  171. (arguments
  172. `(#:configure-flags
  173. (list (string-append "--with-nssdir=" %output "/lib")
  174. "--enable-gcc-hardening"
  175. "--enable-linker-hardening"
  176. "--enable-poisoning"
  177. "--enable-sanitizer"
  178. "--enable-experimental"
  179. "--enable-logging=verbose"
  180. "CFLAGS=-ggdb -O0")
  181. #:parallel-tests? #f ; parallel building is not supported.
  182. ;;#:tests? #f ; fail: test_gnunet_statistics.py
  183. #:phases
  184. ;; swap check and install phases and set paths to installed bin
  185. (modify-phases %standard-phases
  186. (add-after 'unpack 'patch-bin-sh
  187. (lambda _
  188. (substitute* "bootstrap"
  189. (("contrib/pogen.sh") "sh contrib/pogen.sh"))
  190. (for-each (lambda (f) (chmod f #o755))
  191. (find-files "po" ""))
  192. #t))
  193. (add-after 'patch-bin-sh 'bootstrap
  194. (lambda _
  195. (zero? (system* "sh" "bootstrap"))))
  196. (delete 'check))))
  197. (synopsis "gnunet, full git build without tests")))
  198. ;; A package to run the test suite.
  199. (define-public gnunetgft
  200. (package
  201. (inherit gnunetg)
  202. (name "gnunetgft")
  203. (arguments
  204. `(#:configure-flags
  205. (list (string-append "--with-nssdir=" %output "/lib")
  206. "--enable-gcc-hardening"
  207. "--enable-linker-hardening"
  208. "--enable-poisoning"
  209. "--enable-sanitizer"
  210. "--enable-experimental"
  211. "--enable-logging=verbose"
  212. "CFLAGS=-ggdb -O0")
  213. ;; #:parallel-tests? #f ; parallel building seems to fail
  214. ;;#:tests? #f ; fail: test_gnunet_statistics.py
  215. #:phases
  216. ;; swap check and install phases and set paths to installed bin
  217. (modify-phases %standard-phases
  218. (add-after 'unpack 'patch-bin-sh
  219. (lambda _
  220. (substitute* "bootstrap"
  221. (("contrib/pogen.sh") "sh contrib/pogen.sh"))
  222. (for-each (lambda (f) (chmod f #o755))
  223. (find-files "po" ""))
  224. #t))
  225. (add-after 'patch-bin-sh 'bootstrap
  226. (lambda _
  227. (zero? (system* "sh" "bootstrap"))))
  228. (delete 'check)
  229. ;; XXX: https://gnunet.org/bugs/view.php?id=4619
  230. (add-after 'install 'set-path-for-check
  231. (lambda* (#:key outputs #:allow-other-keys)
  232. (let* ((out (assoc-ref outputs "out"))
  233. (bin (string-append out "/bin"))
  234. (lib (string-append out "/lib")))
  235. (setenv "GNUNET_PREFIX" lib)
  236. (setenv "PATH" (string-append (getenv "PATH") ":" bin))
  237. (zero? (system* "make" "check"))))))))
  238. (synopsis "gnunet, full git with tests enabled with parallel tests")))
  239. ;; A package for debugging memory leaks revealed by the test suite - no ASan
  240. (define-public gnunetgft-no-asan
  241. (package
  242. (inherit gnunetg)
  243. (name "gnunetgft-no-asan")
  244. (arguments
  245. `(#:configure-flags
  246. (list (string-append "--with-nssdir=" %output "/lib")
  247. "--enable-gcc-hardening"
  248. "--enable-linker-hardening"
  249. "--enable-poisoning"
  250. "--enable-experimental"
  251. "--enable-logging=verbose"
  252. "CFLAGS=-ggdb -O0")
  253. ;; #:parallel-tests? #f ; parallel building seems to fail
  254. ;;#:tests? #f ; fail: test_gnunet_statistics.py
  255. #:phases
  256. ;; swap check and install phases and set paths to installed bin
  257. (modify-phases %standard-phases
  258. (add-after 'unpack 'patch-bin-sh
  259. (lambda _
  260. (substitute* "bootstrap"
  261. (("contrib/pogen.sh") "sh contrib/pogen.sh"))
  262. (for-each (lambda (f) (chmod f #o755))
  263. (find-files "po" ""))
  264. #t))
  265. (add-after 'patch-bin-sh 'bootstrap
  266. (lambda _
  267. (zero? (system* "sh" "bootstrap"))))
  268. (delete 'check)
  269. ;; XXX: https://gnunet.org/bugs/view.php?id=4619
  270. (add-after 'install 'set-path-for-check
  271. (lambda* (#:key outputs #:allow-other-keys)
  272. (let* ((out (assoc-ref outputs "out"))
  273. (bin (string-append out "/bin"))
  274. (lib (string-append out "/lib")))
  275. (setenv "GNUNET_PREFIX" lib)
  276. (setenv "PATH" (string-append (getenv "PATH") ":" bin))
  277. (zero? (system* "make" "check"))))))))
  278. (synopsis "gnunet, full git, without address sanitizer and with tests enabled")))
  279. ;; ... and one package to test the package with "parallel-tests? #f"
  280. (define-public gnunetgftn
  281. (package
  282. (inherit gnunetg)
  283. (name "gnunetgftn")
  284. (arguments
  285. `(#:configure-flags
  286. (list (string-append "--with-nssdir=" %output "/lib")
  287. "--enable-gcc-hardening"
  288. "--enable-linker-hardening"
  289. "--enable-poisoning"
  290. "--enable-sanitizer"
  291. "--enable-experimental"
  292. "--enable-logging=verbose"
  293. "CFLAGS=-ggdb"); -O0")
  294. #:parallel-tests? #f ; parallel building seems to fail
  295. ;;#:tests? #f ; fail: test_gnunet_statistics.py
  296. #:phases
  297. ;; swap check and install phases and set paths to installed bin
  298. (modify-phases %standard-phases
  299. (add-after 'unpack 'patch-bin-sh
  300. (lambda _
  301. (substitute* "bootstrap"
  302. (("contrib/pogen.sh") "sh contrib/pogen.sh"))
  303. (for-each (lambda (f) (chmod f #o755))
  304. (find-files "po" ""))
  305. #t))
  306. (add-after 'patch-bin-sh 'bootstrap
  307. (lambda _
  308. (zero? (system* "sh" "bootstrap"))))
  309. (delete 'check)
  310. ;; XXX: https://gnunet.org/bugs/view.php?id=4619
  311. (add-after 'install 'set-path-for-check
  312. (lambda* (#:key outputs #:allow-other-keys)
  313. (let* ((out (assoc-ref outputs "out"))
  314. (bin (string-append out "/bin"))
  315. (lib (string-append out "/lib")))
  316. (setenv "GNUNET_PREFIX" lib)
  317. (setenv "PATH" (string-append (getenv "PATH") ":" bin))
  318. (zero? (system* "make" "check"))))))))))
  319. (define-public gnunet-gtkg
  320. (let* ((commit "087f8e166ee6d1fc59a6bd5d05f656528761ede7")
  321. (revision "5"))
  322. (package
  323. (inherit gnunetgf)
  324. (name "gnunet-gtkg")
  325. (version (package-version gnunetgf))
  326. (source
  327. (origin
  328. (method git-fetch)
  329. (uri (git-reference
  330. (url "https://gnunet.org/git/gnunet-gtk.git")
  331. (commit commit)))
  332. (file-name (string-append name "-" version "-checkout"))
  333. (sha256
  334. (base32
  335. "1k03d8l0yz4fpliy5bg5s7qkpidzd6ryr4cd63wgmd227p32i87q"))))
  336. (arguments
  337. `(#:configure-flags
  338. (list "--with-libunique"
  339. "--with-qrencode"
  340. (string-append "--with-gnunet="
  341. (assoc-ref %build-inputs "gnunetgf")))
  342. #:phases
  343. (modify-phases %standard-phases
  344. (add-before 'configure 'bootstrap
  345. (lambda _
  346. (zero? (system* "autoreconf" "-vfi")))))))
  347. (inputs
  348. `(("gnunetgf" ,gnunetgf)
  349. ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
  350. ("gnutls" ,gnutls)
  351. ("libgcrypt" ,libgcrypt)
  352. ("gtk+" ,gtk+)
  353. ("libextractor" ,libextractor)
  354. ("glade3" ,glade3)
  355. ("qrencode" ,qrencode)
  356. ("libunique" ,libunique)))
  357. (native-inputs
  358. `(("pkg-config" ,pkg-config)
  359. ("libglade" ,libglade)
  360. ("autoconf" ,autoconf)
  361. ("gnu-gettext" ,gnu-gettext)
  362. ("automake" ,automake)
  363. ("libtool" ,libtool)))
  364. (synopsis "Graphical front-end tools for GNUnet")
  365. (home-page "https://gnunet.org"))))
  366. ;; fuse, pointing to the tests disabled version of gnunet-git
  367. (define-public gnunet-fuse
  368. (let* ((commit "c25f3acb22f386f2836cd7c7ae21fcef272c0352")
  369. (revision "2"))
  370. (package
  371. (inherit gnunetg)
  372. (name "gnunet-fuse")
  373. (version (package-version gnunetgf))
  374. (source
  375. (origin
  376. (method git-fetch)
  377. (uri (git-reference
  378. (url "https://gnunet.org/git/gnunet-fuse.git")
  379. (commit commit)))
  380. (file-name (string-append name "-" version "-checkout"))
  381. (sha256
  382. (base32
  383. "131b7zgy94n10lamn6m5ijzfw9mqzanq3g0k69fszx674rx0ql6s"))))
  384. (arguments
  385. `(#:configure-flags
  386. (list "--with-qrencode"
  387. (string-append "--with-gnunet="
  388. (assoc-ref %build-inputs "gnunetgf")))
  389. #:phases
  390. (modify-phases %standard-phases
  391. (add-before 'configure 'bootstrap
  392. (lambda _
  393. (zero? (system* "autoreconf" "-vfi")))))))
  394. (inputs
  395. `(("gnunetgf" ,gnunetgf)))
  396. (native-inputs
  397. `(("pkg-config" ,pkg-config)
  398. ("fuse" ,fuse)
  399. ("autoconf" ,autoconf)
  400. ("gnu-gettext" ,gnu-gettext)
  401. ("automake" ,automake)
  402. ("libtool" ,libtool)))
  403. (synopsis "Graphical front-end tools for GNUnet")
  404. (home-page "https://gnunet.org"))))
  405. ;; A package to run the test suite (with libressl)
  406. (define-public gnunetgftl
  407. (package
  408. (inherit gnunetg)
  409. (name "gnunetgftl")
  410. (inputs
  411. `(("glpk" ,glpk)
  412. ("gnurl" ,gnurl)
  413. ("gstreamer" ,gstreamer)
  414. ("gst-plugins-base" ,gst-plugins-base)
  415. ("gnutls" ,gnutls)
  416. ("libextractor" ,libextractor)
  417. ("libgcrypt" ,libgcrypt)
  418. ("libidn" ,libidn)
  419. ("libmicrohttpd" ,libmicrohttpd)
  420. ("libltdl" ,libltdl)
  421. ("libunistring" ,libunistring)
  422. ("libressl" ,libressl)
  423. ("opus" ,opus)
  424. ("pulseaudio" ,pulseaudio)
  425. ("sqlite" ,sqlite)
  426. ("zlib" ,zlib)
  427. ("perl" ,perl)
  428. ("python" ,python-2) ; tests and gnunet-qr
  429. ("postgresql" ,postgresql)
  430. ("jansson" ,jansson)
  431. ("ncurses" ,ncurses)
  432. ("nss" ,nss)
  433. ("gmp" ,gmp)
  434. ("miniupnpc" ,miniupnpc)
  435. ("bluez" ,bluez) ; for optional bluetooth feature
  436. ("glib" ,glib)
  437. ;; ("texlive-minimal" ,texlive-minimal) ; optional.
  438. ("libogg" ,libogg)))
  439. (synopsis "gnunet git full with tests and libressl")))