guix.scm 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. (use-modules (guix packages)
  2. (guix licenses)
  3. (guix git-download)
  4. (guix build-system gnu)
  5. (gnu packages)
  6. (gnu packages autotools)
  7. (gnu packages guile)
  8. (gnu packages guile-xyz)
  9. (gnu packages pkg-config)
  10. (gnu packages texinfo))
  11. (define haunt-from-git
  12. (package
  13. (inherit haunt)
  14. (version "git")
  15. (source (origin
  16. (method git-fetch)
  17. (uri (git-reference
  18. (url "https://gitlab.com/dustyweb/haunt.git")
  19. (commit "7243f98c6eda325288bb3c92c55e26303c38f7dc")))
  20. (sha256
  21. (base32
  22. "1px7yxv3a6g4nnd4p7xjxdbsvaf0b6x6n8x9xqv7a9j51h3wjsps"))))
  23. (arguments
  24. `(#:modules ((ice-9 match) (ice-9 ftw)
  25. ,@%gnu-build-system-modules)
  26. #:tests? #f ; test suite is non-deterministic :(
  27. ; (or it was when I first wrote this
  28. ; comment?)
  29. #:phases (modify-phases %standard-phases
  30. ;; this one is custom
  31. (add-before 'configure 'bootstrap
  32. (lambda _
  33. (zero? (system* "./bootstrap"))))
  34. ;; This one came straight from haunt's definition
  35. ;; in Guix
  36. (add-after 'install 'wrap-haunt
  37. (lambda* (#:key inputs outputs #:allow-other-keys)
  38. ;; Wrap the 'haunt' command to refer to the right
  39. ;; modules.
  40. (let* ((out (assoc-ref outputs "out"))
  41. (bin (string-append out "/bin"))
  42. (site (string-append
  43. out "/share/guile/site"))
  44. (guile-reader (assoc-ref inputs "guile-reader"))
  45. (deps `(,@(if guile-reader
  46. (list guile-reader)
  47. '())
  48. ,(assoc-ref inputs "guile-commonmark"))))
  49. (match (scandir site)
  50. (("." ".." version)
  51. (let ((modules (string-append site "/" version))
  52. (compiled-modules (string-append
  53. out "/lib/guile/" version
  54. "/site-ccache")))
  55. (wrap-program (string-append bin "/haunt")
  56. `("GUILE_LOAD_PATH" ":" prefix
  57. (,modules
  58. ,@(map (lambda (dep)
  59. (string-append dep
  60. "/share/guile/site/"
  61. version))
  62. deps)))
  63. `("GUILE_LOAD_COMPILED_PATH" ":" prefix
  64. (,compiled-modules
  65. ,@(map (lambda (dep)
  66. (string-append dep "/lib/guile/"
  67. version
  68. "/site-ccache"))
  69. deps))))
  70. #t)))))))))
  71. (native-inputs
  72. `(("autoconf" ,autoconf)
  73. ("automake" ,automake)
  74. ("libtool" ,libtool)
  75. ,@(package-native-inputs haunt)))))
  76. (package
  77. (name "spritely-site")
  78. (version "git")
  79. (source #f)
  80. (build-system gnu-build-system)
  81. (synopsis #f)
  82. (description #f)
  83. (license gpl3+)
  84. (home-page "https://spritelyproject.org")
  85. (inputs
  86. `(("guile" ,guile-3.0)
  87. ("haunt" ,haunt-from-git)
  88. ("guile-lib" ,guile-lib)
  89. ("guile-reader" ,guile-reader)
  90. ("guile-sjson" ,guile-sjson)
  91. ("guile-syntax-highlight" ,guile-syntax-highlight)
  92. ("guile-commonmark" ,guile-commonmark))))