aboutsummaryrefslogtreecommitdiff
path: root/guix-module-dir
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-12-10 13:08:42 +0100
committerWojtek Kosior <koszko@koszko.org>2022-12-10 13:08:42 +0100
commit20ec27c878cb4dc571ffb789adb62320c56b4e24 (patch)
tree07ee2dc9c48b78d5c67e550b075a3019a3ef900d /guix-module-dir
parentf8e1787c1a705902851b2f3aa87bceaa83f45147 (diff)
downloadsheets-websites-20ec27c878cb4dc571ffb789adb62320c56b4e24.tar.gz
sheets-websites-20ec27c878cb4dc571ffb789adb62320c56b4e24.zip
add updated websites files and facilitate deployment under Guix
Diffstat (limited to 'guix-module-dir')
-rw-r--r--guix-module-dir/sheets-websites.scm62
1 files changed, 62 insertions, 0 deletions
diff --git a/guix-module-dir/sheets-websites.scm b/guix-module-dir/sheets-websites.scm
new file mode 100644
index 0000000..d40cc03
--- /dev/null
+++ b/guix-module-dir/sheets-websites.scm
@@ -0,0 +1,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")))))