about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gn/packages/guile.scm97
1 files changed, 96 insertions, 1 deletions
diff --git a/gn/packages/guile.scm b/gn/packages/guile.scm
index 815df1f..f7eeccc 100644
--- a/gn/packages/guile.scm
+++ b/gn/packages/guile.scm
@@ -18,8 +18,9 @@
   #:use-module ((gnu packages bash) #:select (bash-minimal))
   #:use-module ((gnu packages bioinformatics) #:select (gemma))
   #:use-module ((gnu packages nss) #:select (nss-certs))
+  #:use-module ((gnu packages gnupg) #:select (guile-gcrypt))
   #:use-module ((gnu packages guile) #:select (guile-json-4 guile-3.0 guile-2.2 guile-readline))
-  #:use-module ((gnu packages guile-xyz) #:select (guile-dbi guile-dbd-mysql guile-fibers guile-redis guile-hashing guile-commonmark guile-lmdb guile-lib))
+  #:use-module ((gnu packages guile-xyz) #:select (guile-dbi guile-dbd-mysql guile-fibers guile-redis guile-hashing guile-commonmark guile-lmdb guile-lib guile-uuid))
   #:use-module ((gnu packages parallel) #:select (parallel))
   #:use-module ((gnu packages perl) #:select (perl))
   #:use-module ((gnu packages tls) #:select (guile-gnutls openssl)))
@@ -254,3 +255,97 @@ for MySQL.")
       (synopsis "Next generation GN code in guile")
       (description "Use of guile.")
       (license license:gpl3))))
+
+(define-public guile-sheepdog
+  (let ((commit "b55cb7c56c661f0a1104bfbd7f7cb9bbcf9fc112")
+	(revision "0"))
+    (package
+     (name "guile-sheepdog")
+     (version "0.0.0")
+     (source (origin
+	      (method git-fetch)
+	      (uri (git-reference
+		    (url "https://github.com/BonfaceKilz/guile-sheepdog.git")
+		    (commit commit)))
+	      (file-name (string-append name "-" version))
+	      (sha256
+	       (base32
+                "1h01n8wxm4bn4blhx47cj9ilczl4iwbwvx53npjgjzw1kq62s210"))))
+     (build-system guile-build-system)
+     (native-inputs (list guile-3.0))
+     (propagated-inputs
+      (list bash-minimal guile-3.0 guile-uuid guile-hashing guile-fibers guile-json-4 guile-gcrypt guile-gnutls))
+     (arguments
+      (list
+       #:not-compiled-file-regexp "(guix|guix/.*)[.]scm$"
+       #:modules '((srfi srfi-1)
+		   (ice-9 popen)
+		   (guix build guile-build-system)
+		   (guix build utils))
+       #:phases
+       #~(modify-phases %standard-phases
+			(add-before 'build 'remove-conf
+				    (lambda* _
+				      (delete-file "conf.example.scm")))
+			(add-after 'build 'install-script
+				   (lambda* _
+				     (let* ((bash #$(this-package-input "bash-minimal"))
+					    (bash (string-append bash "/bin/bash"))
+					    (guile #$(this-package-input "guile"))
+					    (guile (string-append guile "/bin/guile"))
+					    (build-guile #$(this-package-native-input "guile"))
+					    (build-guile (string-append build-guile "/bin/guile"))
+					    (guile-uuid #$(this-package-input "guile-uuid"))
+					    (guile-gnutls #$(this-package-input "guile-gnutls"))
+					    (guile-hashing #$(this-package-input "guile-hashing"))
+					    (guile-fibers #$(this-package-input "guile-fibers"))
+					    (guile-json-4 #$(this-package-input "guile-json"))
+					    (guile-gcrypt #$(this-package-input "guile-gcrypt"))
+					    (guile-lib #$(this-package-input "guile-lib"))
+					    (out #$output)
+					    (bin (string-append out "/bin"))
+					    (effective (read
+							(open-pipe* OPEN_READ
+								    build-guile "-c"
+								    "(write (effective-version))")))
+					    (path (list (string-append guile "/bin")))
+					    (guile-sheepdog (string-append
+							     out
+							     "/share/guile/site/"
+							     effective
+							     "/gn-monitor.scm"))
+					    (scm-dir (string-append "/share/guile/site/" effective))
+					    (guile-inputs (list guile-fibers
+								guile-hashing
+								guile-uuid
+								guile-gnutls
+								guile-gcrypt
+								guile-json-4))
+					    (scm-path
+					     (cons*
+					      scm-dir
+					      (map (lambda (x) (string-append x scm-dir))
+						   (cons* out guile-inputs))))
+					    (go-dir (string-append "/lib/guile/" effective
+								   "/site-ccache/"))
+					    (go-path
+					     (map (lambda (x) (string-append x go-dir))
+						  (cons* out guile-inputs))))
+				       (mkdir-p "bin")
+				       (copy-file "sheepdog.sh" "bin/guile-sheepdog")
+				       (substitute* "bin/guile-sheepdog"
+						    (("@SHELL@") bash)
+						    (("guile") guile)
+						    (("gn-monitor.scm") guile-sheepdog))
+				       (chmod "bin/guile-sheepdog" #o755)
+				       (install-file "bin/guile-sheepdog" bin)
+				       (wrap-script
+					(string-append out "/bin/guile-sheepdog")
+					`("PATH" ":" prefix ,path)
+					`("GUILE_AUTO_COMPILE" ":" = ("0"))
+					`("GUILE_LOAD_PATH" ":" prefix ,scm-path)
+					`("GUILE_LOAD_COMPILED_PATH" ":" prefix ,go-path))))))))
+     (home-page "https://github.com/BonfaceKilz/guile-sheepdog.git")
+     (synopsis "Genenetwork monitoring tool")
+     (description "Genenetwork monitoring tool")
+     (license license:gpl3))))