aboutsummaryrefslogblamecommitdiff
path: root/src/xyz/euandreh/packages/euandreh.scm
blob: c573e197b124b06c1f99ce04d552b6d31b625bd9 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
                                               
                     










                                                              




















                                                                             
                                                          


                                                               










                                                                         
(define-module (xyz euandreh packages euandreh)
  #:use-module (json)
  #:use-module ((ice-9 textual-ports) #:prefix textual-ports:)
  #:use-module ((guix licenses) #:prefix license:)
  #: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 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)))
    (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)
                                  "/../../../../packages.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")
          (content-hash (assoc-ref package "tarbal-sha256"))))
			 (vector->list (assoc-ref packages "packages"))))