about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEfraim Flashner2023-06-28 12:52:50 +0300
committerEfraim Flashner2023-07-19 15:44:33 +0300
commitc886655cea330037bda00a07d6d1708d435f4daf (patch)
treedd308f134a1e5b694634bd61516945945939ab34
parent88006dd282fc2945cd9cd510ef336e9c077cc8ce (diff)
downloadgenenetwork2-c886655cea330037bda00a07d6d1708d435f4daf.tar.gz
Also have repository function as a guix channel
-rw-r--r--.guix-channel20
-rw-r--r--.guix/modules/genenetwork2.scm45
-rw-r--r--README.md17
l---------[-rw-r--r--]guix.scm25
4 files changed, 83 insertions, 24 deletions
diff --git a/.guix-channel b/.guix-channel
new file mode 100644
index 00000000..6baeee2f
--- /dev/null
+++ b/.guix-channel
@@ -0,0 +1,20 @@
+;; This file lets us present this repo as a Guix channel.
+
+(channel
+  (version 0)
+  (directory ".guix/modules")
+  (url "https://github.com/genenetwork/genenetwork2.git") ;the primary URL
+  (dependencies
+   (channel
+    (name guix-bioinformatics)
+    (url "https://gitlab.com/genenetwork/guix-bioinformatics.git"))
+   ;; This shouldn't be needed, it should be pulled in by guix-bioinformatics.
+   (channel
+    (name guix-past)
+    (url "https://gitlab.inria.fr/guix-hpc/guix-past")
+    (introduction
+     (channel-introduction
+      (version 0)
+      (commit "0c119db2ea86a389769f4d2b9c6f5c41c027e336")
+      (signer
+       "3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5"))))))
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
diff --git a/README.md b/README.md
index e5a50fac..dbb979df 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,23 @@ git and sending us pull requests.
 
 For development GN2 has a room on matrix. Ask us for an invitation.
 
+## Installing development snapshots with Guix
+
+The Genenetwork repository can be used as a Guix “channel”.  To do that, change
+~/.config/guix/channels.scm along these lines:
+
+  (append (list (channel
+                 (name 'genenetwork2)
+                 (url "https://github.com/genenetwork/genenetwork2.git")))
+   %default-channels)
+
+  Once that is done, run ‘guix pull’.  This will give you additional ‘genenetwork2’
+  packages with higher version numbers:
+
+    guix package -A genenetwork2
+
+    You can then install it with ‘guix install genenetwork2’ or similar.
+
 ## License
 
 The GeneNetwork2 source code is released under the Affero General
diff --git a/guix.scm b/guix.scm
index 766fddf6..f35981b9 100644..120000
--- a/guix.scm
+++ b/guix.scm
@@ -1,24 +1 @@
-;; 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
-
-(use-modules (gn packages genenetwork)
-             (guix gexp)
-             (guix git-download)
-             (guix packages))
-
-(define %source-dir (dirname (current-filename)))
-
-(package
-  (inherit genenetwork2)
-  (source (local-file %source-dir "genenetwork2-checkout"
-                      #:recursive? #t
-                      #:select? (git-predicate %source-dir))))
+.guix/modules/genenetwork2.scm
\ No newline at end of file