guix.scm 1.55 KB
Newer Older
Ludovic Courtès's avatar
Ludovic Courtès committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
;;; This module is part of Guix-HPC and is licensed under the same terms,
;;; those of the GNU GPL version 3 or (at your option) any later version.
;;;
;;; Copyright © 2017 Inria

;; Run 'guix build -f guix.scm' to build the web site.

(use-modules (guix) (gnu)
             (guix modules)
             (guix git-download))

(define haunt
  (specification->package "haunt"))

(define guile-commonmark
  (specification->package "guile-commonmark"))

18 19 20
(define guile-syntax-highlight
  (specification->package "guile-syntax-highlight"))

Ludovic Courtès's avatar
Ludovic Courtès committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34
(define source
  (local-file "." "guix-hpc-web"
              #:recursive? #t
              #:select? (git-predicate ".")))

(with-imported-modules (source-module-closure
                        '((guix build utils)))
  #~(begin
      (use-modules (guix build utils))

      (copy-recursively #$source ".")

      ;; For Haunt.
      (setenv "GUILE_LOAD_PATH"
35 36 37 38 39 40
              (string-append
               #+(file-append guile-commonmark
                              "/share/guile/site/2.2")
               ":"
               #+(file-append guile-syntax-highlight
                              "/share/guile/site/2.2")))
Ludovic Courtès's avatar
Ludovic Courtès committed
41 42 43 44 45 46 47 48 49 50 51 52

      ;; So we can read/write UTF-8 files.
      (setenv "GUIX_LOCPATH"
              #+(file-append (specification->package "glibc-utf8-locales")
                             "/lib/locale"))
      (setenv "LC_ALL" "en_US.utf8")

      (and (zero? (system* #+(file-append haunt "/bin/haunt")
                           "build"))
           (begin
             (mkdir-p #$output)
             (copy-recursively "site" #$output)))))