aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.guix-channel8
-rw-r--r--.guix/modules/gn-guile.scm34
l---------[-rw-r--r--]guix.scm80
3 files changed, 43 insertions, 79 deletions
diff --git a/.guix-channel b/.guix-channel
new file mode 100644
index 0000000..6e0982a
--- /dev/null
+++ b/.guix-channel
@@ -0,0 +1,8 @@
+(channel
+ (version 0)
+ (directory ".guix/modules")
+ (dependencies
+ (channel
+ (name guix-bioinformatics)
+ (url "https://git.genenetwork.org/guix-bioinformatics")
+ (branch "master")))) \ No newline at end of file
diff --git a/.guix/modules/gn-guile.scm b/.guix/modules/gn-guile.scm
new file mode 100644
index 0000000..03f2b14
--- /dev/null
+++ b/.guix/modules/gn-guile.scm
@@ -0,0 +1,34 @@
+;; To use this file to build HEAD of gn-guile:
+;;
+;; guix build -f guix.scm
+;;
+;; To get a development container
+;;
+;; guix shell -C -D -f guix.scm
+;;
+
+(define-module (gn-guile)
+ #:use-module ((gn packages guile) #:select (gn-guile) #:prefix gn:)
+ #:use-module (guix gexp)
+ #:use-module (guix utils)
+ #:use-module (guix packages)
+ #:use-module (guix git-download))
+
+(define %source-dir (dirname (dirname (current-source-directory))))
+
+(define vcs-file?
+ (or (git-predicate %source-dir)
+ (const #t)))
+
+(define-public gn-guile
+ (package
+ (inherit gn:gn-guile)
+ (source
+ (local-file "../.."
+ "gn-guile-checkout"
+ #:recursive? #t
+ #:select? vcs-file?))))
+
+;; Add definition for tests should you need it, here.
+
+gn-guile
diff --git a/guix.scm b/guix.scm
index 1cde2e0..973f44f 100644..120000
--- a/guix.scm
+++ b/guix.scm
@@ -1,79 +1 @@
-;; To use this file to build HEAD of gn-guile:
-;;
-;; guix build -f guix.scm
-;;
-;; To get a development container
-;;
-;; guix shell -C -D -f guix.scm
-;;
-
-(define-module (gn-guile-package)
- #:use-module ((guix licenses) #:prefix license:)
- #:use-module (guix gexp)
- #:use-module (guix packages)
- #:use-module (guix git-download)
- #:use-module (guix build-system guile)
- #:use-module (guix utils)
- #:use-module (gnu packages build-tools)
- #:use-module (gnu packages package-management)
- #:use-module ((gnu packages bash) #:select (bash-minimal))
- #:use-module ((gnu packages bioinformatics) #:select (gemma))
- #:use-module ((gnu packages certs) #:select (nss-certs))
- #:use-module ((gnu packages guile) #:select (guile-json-4 guile-3.0 guile-readline))
- #:use-module ((gnu packages guile-xyz) #:select (guile-dbi guile-dbd-mysql guile-fibers guile-redis guile-hashing guile-commonmark))
- #:use-module ((gnu packages parallel) #:select (parallel))
- #:use-module ((gnu packages perl) #:select (perl))
- #:use-module ((gnu packages tls) #:select (guile-gnutls openssl))
- #:use-module (srfi srfi-1)
- #:use-module (ice-9 popen)
- #:use-module (ice-9 rdelim))
-
-(define %source-dir (dirname (current-filename)))
-
-(define %git-commit
- (read-string (open-pipe "git show HEAD | head -1 | cut -d ' ' -f 2" OPEN_READ)))
-
-(define-public gn-guile-git
- (package
- (name "gn-guile-git")
- (version (git-version "4.0.0-" "HEAD" %git-commit))
- (source (local-file %source-dir
- #:recursive? #t
- #:select? (or (git-predicate (dirname (current-source-directory)))
- (const #t))))
- (build-system guile-build-system)
- (propagated-inputs
- (list guile-3.0 guile-dbi guile-dbd-mysql guile-fibers guile-gnutls guile-readline
- guile-commonmark guile-redis openssl nss-certs gemma parallel guile-hashing
- guile-json-4))
- (arguments
- (list
- #:phases
- #~(modify-phases %standard-phases
- ;; When using the guile-build-system, guild doesn't
- ;; correctly set the GUILE_LOAD_PATH for the various guile
- ;; packages in the build phase leading to build failures.
- (add-before 'build 'augment-GUILE_LOAD_PATH
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((guile-version (target-guile-effective-version))
- (guile-dbi-scm (string-append #$guile-dbi "/share/guile/site/2.2")))
- ;; guild uses this: "\\.(scm|sls)$" regexp to try and
- ;; compile all scm files in this repository. We don't
- ;; need to compile guix.scm
- (delete-file "guix.scm")
- (setenv "GUILE_LOAD_PATH"
- (string-append
- guile-dbi-scm ":"
- (format
- #f "~{~a:~}"
- (map (lambda (package)
- (format #f "~a/share/guile/site/~a"
- package guile-version))
- (list #$guile-fibers #$guile-commonmark #$guile-json-4 #$guile-hashing)))
- #$(getenv "GUILE_LOAD_PATH")))))))))
- (home-page "https://git.genenetwork.com/gn-guile")
- (synopsis "Next generation GN code in guile")
- (description "Use of guile.")
- (license license:gpl3)))
-
-gn-guile-git
+.guix/modules/gn-guile.scm \ No newline at end of file