aboutsummaryrefslogtreecommitdiff
path: root/guix.scm
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-11-22 21:51:37 +0100
committerWojtek Kosior <koszko@koszko.org>2022-11-22 21:51:37 +0100
commit366d927d626065db29cdf4aeb92a2122683cdf73 (patch)
treee46a8fabd79a31d70cda4cd90ddf11b7a08e993b /guix.scm
parente5d9ee98a548e2b863104e52eb2bc309b1336179 (diff)
downloadhydrilla-website-366d927d626065db29cdf4aeb92a2122683cdf73.tar.gz
hydrilla-website-366d927d626065db29cdf4aeb92a2122683cdf73.zip
move Guix packaging to a module
Diffstat (limited to 'guix.scm')
-rw-r--r--guix.scm63
1 files changed, 9 insertions, 54 deletions
diff --git a/guix.scm b/guix.scm
index d6e3d6b..a364943 100644
--- a/guix.scm
+++ b/guix.scm
@@ -4,60 +4,15 @@
;;
;; Available under the terms of Creative Commons Zero v1.0 Universal.
-;; This file is based on `hydrilla-guix/hydrilla.scm` from Hydrilla&Haketilo
-;; repository at ../pydrilla.
+;; We need the actual website package to be defined in a module so that the
+;; parent repository can more easily use it with `guix system`. Hence, the bulk
+;; of Guile code resides in `guix-module-dir/hydrilla-website.scm` and this file
+;; is just a thin wrapper around that.
-(use-modules
- (ice-9 rdelim)
- (ice-9 regex))
+(add-to-load-path (string-append
+ (dirname (current-filename))
+ "/guix-module-dir"))
-;; We're mostly running from Makefile, so it's pretty safe to use `getcwd`.
-(define %source-dir (getcwd))
+(use-modules (hydrilla-website))
-;; The PKG-INFO file is generated when running `python3 -m build -s` or similar.
-;; It is also automatically included in the source release tarballs.
-(define %website-version
- (if (access? "src/hydrilla_website.egg-info/PKG-INFO" R_OK)
- (let* ((port (open-input-file "src/hydrilla_website.egg-info/PKG-INFO"))
- (process-line
- (lambda (self-ref)
- (let ((match-result
- (string-match "^Version: (.*)" (read-line port))))
- (if match-result (match:substring match-result 1)
- (self-ref self-ref))))))
- (process-line process-line))
- "unknown"))
-
-(define source-tarball-name
- (string-append "hydrilla_website-" %website-version ".tar.gz"))
-
-(use-modules
- (guix packages)
- (guix gexp)
- (guix build-system python)
- ((guix licenses) #:prefix license:)
- (gnu packages python-build)
- (gnu packages python-web)
- (gnu packages python-xyz)
- (gnu packages python-check))
-
-(package
- (name "hydrilla-website")
- (version %website-version)
- (source
- ;; setuptools_scm makes it impossible to build directly from git
- ;; checkout. We instead build from source tarball generated under ./dist/.
- (local-file (string-append %source-dir "/dist/" source-tarball-name)))
- (build-system python-build-system)
- (propagated-inputs
- (list python-flask))
- (native-inputs
- (list python-setuptools-scm
- python-babel
- python-pypa-build
- python-mypy))
- (home-page "https://git.koszko.org/hydrilla-website")
- (synopsis "Website for Haketilo & Hydrilla")
- (description "This is the packaging of the website of Haketilo, a content
-blocker + user script manager and Hydrilla, its script repository.")
- (license (list license:agpl3+ license:gpl3+ license:cc0)))
+hydrilla-website