aboutsummaryrefslogtreecommitdiff
path: root/guix-module-dir/sheets-websites.scm
blob: d40cc034d730e9957338cef5cca8a4319e77fb04 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
;; SPDX-License-Identifier: CC0-1.0

;; Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
;;
;; Available under the terms of Creative Commons Zero v1.0 Universal.

(define-module (sheets-websites))

(use-modules
 (ice-9 rdelim)
 (ice-9 regex))

(define %source-dir
  (let* ((this-file (search-path %load-path "sheets-websites.scm"))
         (proj-dir (dirname (dirname this-file))))
    (cond ((equal? proj-dir ".")
           (getcwd))
          ((absolute-file-name? proj-dir)
           proj-dir)
          (#t
           (string-append (getcwd) "/" proj-dir)))))

(use-modules
 (guix packages)
 (guix build-system copy)
 (guix gexp)
 ((guix licenses) #:prefix license:))

(define-public sheets-websites
  (package
   (name "sheets-websites")
   (version "current")
   (source
    (local-file %source-dir #:recursive? #t))
   (build-system copy-build-system)
   (arguments
    `(#:phases
      (let ((call-make-on-websites
             (lambda (outputs target)
               (let ((out (assoc-ref outputs "out")))
                 (for-each
                  (lambda (website)
                    (invoke "make" target
                            (string-append "WEBSITE=" website)
                            (string-append "DEST=" out "/share/"
                                           website "-website")))
                  '("pray" "sheets"))))))
        (modify-phases %standard-phases
          (add-before 'install 'build
            (lambda* (#:key outputs #:allow-other-keys)
              (call-make-on-websites outputs "all")))
          (add-after 'install 'install-websites
            (lambda* (#:key outputs #:allow-other-keys)
              (call-make-on-websites outputs "install")))))
      #:install-plan
      '()))
   (home-page "https://git.koszko.org/sheets-websites/")
   (synopsis "Sheets websites files")
   (description "This is the packaging of the websites at pray.koszko.org and
 sheets.koszko.org.")
   (license (list license:cc0
                  (license:x11-style "file://LICENSES/LicenseRef-Normalize-CSS-MIT.txt")))))