From f7fcbbcc014686ac597b783a8dcb38b43024b9d6 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 4 Aug 2023 09:28:29 +0300 Subject: Initialise the repository. --- .guix/modules/guix-package.scm | 71 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .guix/modules/guix-package.scm (limited to '.guix/modules') diff --git a/.guix/modules/guix-package.scm b/.guix/modules/guix-package.scm new file mode 100644 index 0000000..bda9204 --- /dev/null +++ b/.guix/modules/guix-package.scm @@ -0,0 +1,71 @@ +(define-module (genenetwork-auth) + #:use-module (guix) + #:use-module (guix git-download) + #:use-module (guix build-system python) + #:use-module ((guix licenses) #:prefix license:) + + #:use-module (git oid) + #:use-module (git bindings) + #:use-module (git reference) + #:use-module (git repository) + + + ;; Packages from guix + #:use-module (gnu packages check) + + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages python-crypto) + + #:use-module (gnu packages databases) + + + ;; Packages from guix-bioinformatics + #:use-module (gn packages python-web)) + +(define %source-dir (dirname (dirname (dirname (current-filename))))) + +(define (get-commit) + "Retrieve the commit if the source directory is a repository." + (if (git-predicate %source-dir) + (begin (let ((commit #f)) + (libgit2-init!) + (set! commit (oid->string + (reference-target + (repository-head (repository-open %source-dir))))) + (libgit2-shutdown!) + commit)) + "NOTAREPOSITORY")) + +(define (get-latest-version) + "Get latest version tag from repository." + ;; TODO: Implement + "v0.0.0") + +(define vcs-file? + (or (git-predicate %source-dir) + (const #t))) + +(package + (name "genenetwork-auth") + (version (string-append (get-latest-version) + "-git-" + (substring (get-commit) 0 9))) + (source (local-file %source-dir "genenetwork-auth-checkout" + #:recursive? #t + #:select? vcs-file?)) + (build-system python-build-system) + ;; (inputs (list)) + (native-inputs + (list python-pytest + python-pylint)) + (propagated-inputs + (list python-flask + python-authlib + yoyo-migrations + python-argon2-cffi + python-email-validator)) + (home-page "https://github.com/genenetwork/gn-auth") + (synopsis "Authentication and Authorisation server for GeneNetwork services.") + (description "Authentication and Authorisation server for GeneNetwork services.") + (license license:agpl3+)) -- cgit v1.2.3