guix.scm 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2020 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)
  28. (guix build-system gnu)
  29. (guix git-download)
  30. (guix packages)
  31. (guix gexp)
  32. ((guix licenses) #:prefix license:))
  33. ;; some bugs to squash:
  34. ;; guile-gnunet installs .go in $GUILE_LOAD_PATH
  35. (define debug? #t)
  36. ;; guix commit: 0ed6c7444e9a5509df11d4802bb257f3bc883733
  37. ;; TODO: guile bindings
  38. (define gnunet/debug
  39. (package
  40. (inherit gnunet)
  41. (outputs '("out"))
  42. (arguments `(#:tests? #f
  43. #:strip-binaries? #f
  44. #:configure-flags
  45. `("--without-x" "--without-libpulse"
  46. "--without-libogg" "--without-libopus"
  47. "--disable-documentation")
  48. #:make-flags
  49. `("CFLAGS=-Og -g3")))))
  50. ;; cross-compilation is broken,
  51. ;; but ordinary compilation isn't
  52. (define guile2.2-bytestructures/broken
  53. (package
  54. (inherit guile2.2-bytestructures)
  55. (version "1.0.7")
  56. (name (package-name guile2.2-bytestructures))
  57. (home-page (package-home-page
  58. guile2.2-bytestructures))
  59. (source
  60. (origin
  61. (method git-fetch)
  62. (uri (git-reference
  63. (url home-page)
  64. (commit (string-append "v" version))))
  65. (file-name (git-file-name name version))
  66. (sha256
  67. (base32
  68. "0q0habjiy3h9cigb7q1br9kz6z212dn2ab31f6dgd3rrmsfn5rvb"))))))
  69. (define guile2.2-webutils
  70. (package
  71. (inherit guile-webutils)
  72. (name "guile2.2-webutils")
  73. (inputs
  74. `(("guile" ,guile-2.2)))
  75. (propagated-inputs
  76. `(("guile-irregex" ,guile2.2-irregex)
  77. ("guile-gcrypt" ,guile2.2-gcrypt)))))
  78. (define guile-gnunet/fixed
  79. (let ((commit "dbc873b4a1041a51e0e342cae178cb2fda014ab6")
  80. (revision "1"))
  81. (package
  82. (inherit guile-gnunet)
  83. (name (package-name guile-gnunet))
  84. (version (git-version "0.0" revision commit))
  85. (source (origin
  86. (method git-fetch)
  87. (uri (git-reference
  88. (url "https://git.gnunet.org/gnunet-guile2.git")
  89. (commit commit)))
  90. (file-name (git-file-name name version))
  91. (sha256
  92. (base32
  93. "0azsdi8sa5kvv7qwc0b096w4a5ggfzcmi4kb06fb4sc59f36fzmq"))))
  94. (native-inputs `(("pkg-config" ,pkg-config)
  95. ("autoconf" ,autoconf-wrapper)
  96. ("texinfo" ,texinfo)
  97. ("automake" ,automake)))
  98. (inputs `(("guile" ,guile-2.2)
  99. ("gnunet" ,gnunet/debug)))
  100. (propagated-inputs
  101. `(("guile-bytestructures" ,guile2.2-bytestructures/broken)))
  102. (home-page "https://gnu.org/software/gnunet"))))
  103. (define rehash
  104. (package
  105. (name "rehash")
  106. (version "0")
  107. (source #f)
  108. (build-system gnu-build-system)
  109. (inputs `(("gnunet" ,(if debug? gnunet/debug gnunet))
  110. ("guile" ,guile-3.0) ; guile-gnunet uses guile-2.0!
  111. ,@(if debug?
  112. `(("guile:debug" ,guile-2.2 "debug"))
  113. '())
  114. ("guile-fibers" ,guile-fibers)
  115. ;; GNUnet headers refer to extractor.h
  116. ("libextractor" ,libextractor)
  117. ;; likewise for gcrypt
  118. ("libgcrypt" ,libgcrypt)
  119. ;; perhaps a bug in GNUnet's pkg-config files
  120. ("zlib" ,zlib)
  121. ;; for web demo
  122. ;; TODO guile2.0-gcrypt FTB
  123. ("guile-webutils" ,guile-webutils)))
  124. (native-inputs
  125. `(("autoconf" ,autoconf)
  126. ("automake" ,automake)
  127. ("libtool" ,libtool)
  128. ("guile" ,guile-3.0)
  129. ("pkg-config" ,pkg-config)
  130. ,@(if debug?
  131. `(("gdb" ,(specification->package "gdb")))
  132. '())))
  133. (synopsis "Map hashes to other hashes with the GNUnet DHT")
  134. (license license:gpl3+)
  135. (home-page "https://notabug.org/mdevos/guix-gnunet")
  136. ;; TODO: somewhat malicious decentralised hash->hash mapping
  137. ;; operating on GNUnet
  138. (description "")))
  139. rehash