aboutsummaryrefslogtreecommitdiff
path: root/.guix/modules
diff options
context:
space:
mode:
authorEfraim Flashner2023-06-28 12:52:50 +0300
committerEfraim Flashner2023-07-19 15:44:33 +0300
commitc886655cea330037bda00a07d6d1708d435f4daf (patch)
treedd308f134a1e5b694634bd61516945945939ab34 /.guix/modules
parent88006dd282fc2945cd9cd510ef336e9c077cc8ce (diff)
downloadgenenetwork2-c886655cea330037bda00a07d6d1708d435f4daf.tar.gz
Also have repository function as a guix channel
Diffstat (limited to '.guix/modules')
-rw-r--r--.guix/modules/genenetwork2.scm45
1 files changed, 45 insertions, 0 deletions
diff --git a/.guix/modules/genenetwork2.scm b/.guix/modules/genenetwork2.scm
new file mode 100644
index 00000000..46814c37
--- /dev/null
+++ b/.guix/modules/genenetwork2.scm
@@ -0,0 +1,45 @@
+;; Make sure you have the
+;; https://git.genenetwork.org/guix-bioinformatics/guix-bioinformatics
+;; channel set up.
+;;
+;; To drop into a development environment, run
+;;
+;; guix shell -Df guix.scm
+;;
+;; To get a development environment in a container, run
+;;
+;; guix shell -C -Df guix.scm
+
+(define-module (genenetwork2))
+(use-modules (gn packages genenetwork)
+ (guix gexp)
+ (guix utils)
+ (guix git-download)
+ (guix packages)
+ (ice-9 popen)
+ (ice-9 rdelim))
+
+(define %source-dir
+ (string-append (current-source-directory)
+ "/../.."))
+
+;; This isn't kept up-to-date.
+(define %version
+ (call-with-input-file (string-append %source-dir "/VERSION")
+ (lambda (port)
+ (read-line port))))
+
+(define (%version package)
+ (or (version-major+minor+point (package-version package))
+ (version-major+minor (package-version package))))
+
+(define-public genenetwork2-head
+ (package
+ (inherit genenetwork2)
+ (version (string-append (%version genenetwork2) "-HEAD"))
+ (source (local-file %source-dir "genenetwork2-checkout"
+ #:recursive? #t
+ #:select? (or (git-predicate %source-dir)
+ (const #t))))))
+
+genenetwork2-head