guix-env.scm 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. ;;; This file is part of GNUnet.
  2. ;;; Copyright (C) 2016, 2017, 2018 GNUnet e.V.
  3. ;;;
  4. ;;; GNUnet is free software: you can redistribute it and/or modify it
  5. ;;; under the terms of the GNU Affero General Public License as published
  6. ;;; by the Free Software Foundation, either version 3 of the License,
  7. ;;; or (at your option) any later version.
  8. ;;;
  9. ;;; GNUnet is distributed in the hope that it will be useful, but
  10. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. ;;; 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. (use-modules
  17. (ice-9 popen)
  18. (ice-9 match)
  19. (ice-9 rdelim)
  20. (guix packages)
  21. (guix build-system gnu)
  22. (guix gexp)
  23. ((guix build utils) #:select (with-directory-excursion))
  24. (guix git-download)
  25. (guix utils) ; current-source-directory
  26. (gnu packages)
  27. (gnu packages aidc)
  28. (gnu packages autotools)
  29. (gnu packages backup)
  30. (gnu packages base)
  31. (gnu packages compression)
  32. (gnu packages curl)
  33. (gnu packages databases)
  34. (gnu packages file)
  35. (gnu packages gettext)
  36. (gnu packages glib)
  37. (gnu packages gnome)
  38. (gnu packages gnunet)
  39. (gnu packages gnupg)
  40. (gnu packages gnuzilla)
  41. (gnu packages groff)
  42. (gnu packages gstreamer)
  43. (gnu packages gtk)
  44. (gnu packages guile)
  45. (gnu packages image)
  46. (gnu packages image-viewers)
  47. (gnu packages libidn)
  48. (gnu packages libunistring)
  49. (gnu packages linux)
  50. (gnu packages maths)
  51. (gnu packages multiprecision)
  52. (gnu packages perl)
  53. (gnu packages pkg-config)
  54. (gnu packages pulseaudio)
  55. (gnu packages python)
  56. (gnu packages tex)
  57. (gnu packages texinfo)
  58. (gnu packages tex)
  59. (gnu packages tls)
  60. (gnu packages upnp)
  61. (gnu packages video)
  62. (gnu packages web)
  63. (gnu packages xiph)
  64. ((guix licenses) #:prefix license:))
  65. (define %source-dir (current-source-directory))
  66. (define gnunet-dev-env
  67. (let* ((revision "1")
  68. (select? (delay (or (git-predicate
  69. (current-source-directory))
  70. source-file?))))
  71. (package
  72. (inherit gnunet)
  73. (name "gnunet")
  74. (version (string-append "git" revision))
  75. (source
  76. (local-file
  77. (string-append (getcwd))
  78. #:recursive? #t))
  79. (inputs
  80. `(("glpk" ,glpk)
  81. ("gnurl" ,gnurl)
  82. ("gstreamer" ,gstreamer)
  83. ("gst-plugins-base" ,gst-plugins-base)
  84. ("gnutls/dane" ,gnutls/dane)
  85. ("libextractor" ,libextractor)
  86. ("libgcrypt" ,libgcrypt)
  87. ("libidn" ,libidn)
  88. ("libmicrohttpd" ,libmicrohttpd)
  89. ("libltdl" ,libltdl)
  90. ("libunistring" ,libunistring)
  91. ("openssl" ,openssl)
  92. ("opus" ,opus)
  93. ("pulseaudio" ,pulseaudio)
  94. ("sqlite" ,sqlite)
  95. ("postgresql" ,postgresql)
  96. ("mysql" ,mariadb)
  97. ("zlib" ,zlib)
  98. ("perl" ,perl)
  99. ("python-2" ,python-2) ; tests and gnunet-qr
  100. ("python2-future" ,python2-future)
  101. ("jansson" ,jansson)
  102. ("nss" ,nss)
  103. ("glib" ,glib "bin")
  104. ("gmp" ,gmp)
  105. ("bluez" ,bluez) ; for optional bluetooth feature
  106. ("glib" ,glib)
  107. ;; ("texlive" ,texlive) ;FIXME: minimize.
  108. ("texlive-tiny" ,texlive-tiny) ;; Seems to be enough for _just_ info output.
  109. ("miniupnpc" ,miniupnpc)
  110. ("libogg" ,libogg)))
  111. (native-inputs
  112. `(("pkg-config" ,pkg-config)
  113. ("autoconf" ,autoconf)
  114. ("automake" ,automake)
  115. ("gnu-gettext" ,gnu-gettext)
  116. ("which" ,which)
  117. ("texinfo" ,texinfo-5) ; Debian stable: 5.2
  118. ("libtool" ,libtool)))
  119. (outputs '("out" "debug"))
  120. (arguments
  121. `(;#:configure-flags
  122. ;;(list (string-append "--with-nssdir=" %output "/lib")
  123. ;;"--enable-gcc-hardening"
  124. ;;"--enable-linker-hardening"
  125. ;;;;"--enable-documentation-only")
  126. ;;;"--enable-logging=verbose"
  127. ;;;"CFLAGS=-ggdb -O0")
  128. #:phases
  129. ;; swap check and install phases and set paths to installed bin
  130. (modify-phases %standard-phases
  131. (add-after 'unpack 'patch-bin-sh
  132. (lambda _
  133. (for-each (lambda (f) (chmod f #o755))
  134. (find-files "po" ""))
  135. #t))
  136. (add-after 'patch-bin-sh 'bootstrap
  137. (lambda _
  138. (invoke "sh" "bootstrap")))
  139. ;;(add-before 'build 'chdir
  140. ;; (lambda _
  141. ;; (chdir "doc/documentation")))
  142. (delete 'check)
  143. ;; XXX: https://gnunet.org/bugs/view.php?id=4619
  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. (invoke "make" "check"))))))))))
  152. gnunet-dev-env