aboutsummaryrefslogtreecommitdiff
path: root/src/xyz/euandreh/packages.scm
diff options
context:
space:
mode:
Diffstat (limited to 'src/xyz/euandreh/packages.scm')
-rw-r--r--src/xyz/euandreh/packages.scm55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/xyz/euandreh/packages.scm b/src/xyz/euandreh/packages.scm
new file mode 100644
index 0000000..2ee6f64
--- /dev/null
+++ b/src/xyz/euandreh/packages.scm
@@ -0,0 +1,55 @@
+(define-module (xyz euandreh packages)
+ #:use-module (json)
+ #:use-module ((ice-9 textual-ports) #:prefix textual-ports:)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (gnu packages)
+ #:use-module (guix transformations)
+ #:use-module (guix gexp)
+ #:use-module (guix packages)
+ #:use-module (guix download)
+ #:use-module (guix git-download)
+ #:use-module (guix utils)
+ #:use-module (guix store)
+ #:use-module (guix build-system gnu))
+
+(define (euandreh-package name version-prefix version check-inputs hash)
+ (package
+ (name name)
+ (version version)
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://git.euandreh.xyz/"
+ name
+ "/snapshot/"
+ name
+ "-"
+ version-prefix
+ version
+ ".tar.gz"))
+ (hash hash)))
+ (inputs
+ (map (lambda (name)
+ (list name (specification->package name)))
+ (vector->list check-inputs)))
+ (build-system gnu-build-system)
+ ;; This shouldn't be necessary, but
+ ;; the `gnu-build-system' doesn't provide a c99 variable
+ (arguments `(#:make-flags (list (string-append "CC=" ,(cc-for-target)))))
+ (synopsis (file-append source "/description"))
+ (description (file-append source "/long-description"))
+ (home-page (string-append "https://" name ".euandreh.xyz"))
+ (license license:agpl3+)))
+
+(let* ((json-file (canonicalize-path
+ (string-append (current-source-directory)
+ "/../../../paku.json")))
+ (packages (call-with-input-file json-file json->scm)))
+ (map (lambda (package)
+ (euandreh-package
+ (assoc-ref package "name")
+ (assoc-ref package "version-prefix")
+ (assoc-ref package "version")
+ (assoc-ref package "check-inputs")
+ (content-hash (assoc-ref package "tarbal-sha256"))))
+ (vector->list (assoc-ref packages "packages"))))