guix.scm 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2020, 2021 Maxime Devos <maxime.devos@student.kuleuven.be>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. ;; TODO integrate in Guix upstream when in reasonable shape
  19. (use-modules (gnu packages gnunet)
  20. (gnu packages guile)
  21. (gnu packages guile-xyz)
  22. (gnu packages autotools)
  23. (gnu packages pkg-config)
  24. (gnu packages gnupg)
  25. (gnu packages compression)
  26. (gnu packages texinfo)
  27. (gnu packages tls)
  28. (gnu packages xorg)
  29. (gnu packages text-editors)
  30. (gnu packages)
  31. (guix build-system gnu)
  32. (guix git-download)
  33. (guix packages)
  34. (guix gexp)
  35. ((guix licenses) #:prefix license:))
  36. ;; some bugs to squash:
  37. ;; guile-gnunet installs .go in $GUILE_LOAD_PATH
  38. (define debug? #t)
  39. ;; guix commit: 0ed6c7444e9a5509df11d4802bb257f3bc883733
  40. ;; TODO: guile bindings
  41. (define gnunet/debug
  42. (package
  43. (inherit gnunet)
  44. (outputs '("out"))
  45. (arguments `(#:tests? #f
  46. #:strip-binaries? #f
  47. #:configure-flags
  48. `("--without-x" "--without-libpulse"
  49. "--without-libogg" "--without-libopus"
  50. "--disable-documentation")
  51. #:make-flags
  52. `("CFLAGS=-Og -g3")))))
  53. ;; cross-compilation is broken,
  54. ;; but ordinary compilation isn't
  55. (define guile2.2-bytestructures/broken
  56. (package
  57. (inherit guile2.2-bytestructures)
  58. (version "1.0.7")
  59. (name (package-name guile2.2-bytestructures))
  60. (home-page (package-home-page
  61. guile2.2-bytestructures))
  62. (source
  63. (origin
  64. (method git-fetch)
  65. (uri (git-reference
  66. (url home-page)
  67. (commit (string-append "v" version))))
  68. (file-name (git-file-name name version))
  69. (sha256
  70. (base32
  71. "0q0habjiy3h9cigb7q1br9kz6z212dn2ab31f6dgd3rrmsfn5rvb"))))))
  72. (define guile2.2-webutils
  73. (package
  74. (inherit guile-webutils)
  75. (name "guile2.2-webutils")
  76. (inputs
  77. `(("guile" ,guile-2.2)))
  78. (propagated-inputs
  79. `(("guile-irregex" ,guile2.2-irregex)
  80. ("guile-gcrypt" ,guile2.2-gcrypt)))))
  81. (define guile-gnunet/fixed
  82. (let ((commit "dbc873b4a1041a51e0e342cae178cb2fda014ab6")
  83. (revision "1"))
  84. (package
  85. (inherit guile-gnunet)
  86. (name (package-name guile-gnunet))
  87. (version (git-version "0.0" revision commit))
  88. (source (origin
  89. (method git-fetch)
  90. (uri (git-reference
  91. (url "https://git.gnunet.org/gnunet-guile2.git")
  92. (commit commit)))
  93. (file-name (git-file-name name version))
  94. (sha256
  95. (base32
  96. "0azsdi8sa5kvv7qwc0b096w4a5ggfzcmi4kb06fb4sc59f36fzmq"))))
  97. (native-inputs `(("pkg-config" ,pkg-config)
  98. ("autoconf" ,autoconf-wrapper)
  99. ("texinfo" ,texinfo)
  100. ("automake" ,automake)))
  101. (inputs `(("guile" ,guile-2.2)
  102. ("gnunet" ,gnunet/debug)))
  103. (propagated-inputs
  104. `(("guile-bytestructures" ,guile2.2-bytestructures/broken)))
  105. (home-page "https://gnu.org/software/gnunet"))))
  106. ;; 3.0.2 has problems with CONNECT method
  107. (define suitable-guile
  108. (specification->package "guile@3.0.4"))
  109. (define rehash
  110. (package
  111. (name "rehash")
  112. (version "0")
  113. (source #f)
  114. (build-system gnu-build-system)
  115. (inputs `(("gnunet" ,(if debug? gnunet/debug gnunet))
  116. ("guile" ,suitable-guile) ; guile-gnunet uses guile-2.0!
  117. ,@(if debug?
  118. `(("guile:debug" ,suitable-guile "debug"))
  119. '())
  120. ("guile-fibers" ,guile-fibers)
  121. ;; GNUnet headers refer to extractor.h
  122. ("libextractor" ,libextractor)
  123. ;; likewise for gcrypt
  124. ("libgcrypt" ,libgcrypt)
  125. ;; perhaps a bug in GNUnet's pkg-config files
  126. ("zlib" ,zlib)
  127. ("gnutls" ,gnutls)
  128. ;; for web demo
  129. ;; TODO guile2.0-gcrypt FTB
  130. ("guile-webutils" ,guile-webutils)))
  131. (native-inputs
  132. `(("autoconf" ,autoconf)
  133. ("automake" ,automake)
  134. ("libtool" ,libtool)
  135. ("guile" ,suitable-guile)
  136. ("pkg-config" ,pkg-config)
  137. ;; For documentation
  138. ;; TODO start a fake X server
  139. ("xorg" ,xorg-server-for-tests)
  140. ("texmacs" ,texmacs)
  141. ,@(if debug?
  142. `(("gdb" ,(specification->package "gdb")))
  143. '())))
  144. (synopsis "Map hashes to other hashes with the GNUnet DHT")
  145. (license license:gpl3+)
  146. (home-page "https://notabug.org/mdevos/guix-gnunet")
  147. ;; TODO: somewhat malicious decentralised hash->hash mapping
  148. ;; operating on GNUnet
  149. (description "")))
  150. rehash