diff options
| author | pjotrp <pjotr.public01@thebird.nl> | 2026-10-04 11:33:49 +0000 |
|---|---|---|
| committer | pjotrp <pjotr.public01@thebird.nl> | 2026-10-04 11:33:49 +0000 |
| commit | 87e816ff5495082ccdbc3bc98d4f5c4d9e85f44d (patch) | |
| tree | 082b1b9faae5d45dba3ebb86e8cfc2a116c066e5 | |
| parent | 1cd7635e582087ab36938f8cf3ec5f511cd267fa (diff) | |
| download | guix-bioinformatics-87e816ff5495082ccdbc3bc98d4f5c4d9e85f44d.tar.gz | |
guile: update gn-guile pin to cf32f16
gn-guile cf32f16 ships the stripped branding webserver in its own tree (web/webserver-aging.scm + bin/gn-guile-webserver), fixes the doctype rendering and computes the copyright year at run time. To make the full package build again at the new commit: - propagate guile-config (web/config.scm uses (config), added upstream after the previous pin) - install bin/gn-guile from the repository (gn-guile.sh was removed upstream) and replace wrap-script/wrap-program with a hand-written wrapper: this sandboxed daemon's store overlay rejects the hard-link that both wrappers create (ENOENT) Hash from the daemon's git-fetch checkout. Verified: guix build gn-guile; the gn-guile container serves the aging brand pages with <!DOCTYPE html>, footer "Copyright © 2005-2026", css/images, all API routes disabled, SSH on 2225.
| -rw-r--r-- | gn/packages/guile.scm | 108 |
1 files changed, 61 insertions, 47 deletions
diff --git a/gn/packages/guile.scm b/gn/packages/guile.scm index 6e1a5b8..d5bacc9 100644 --- a/gn/packages/guile.scm +++ b/gn/packages/guile.scm @@ -20,7 +20,7 @@ #: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 guile-uuid)) + #: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 guile-config)) #:use-module ((gnu packages parallel) #:select (parallel)) #:use-module ((gnu packages perl) #:select (perl)) #:use-module ((gnu packages tls) #:select (guile-gnutls openssl))) @@ -62,9 +62,13 @@ ;; #:keep-permissions?) drops the executable bit, so the ;; bootstrap's ./autogen.sh dies with "Permission denied" on ;; cold builds. Restore it. - (add-after 'chdir 'fix-exec-bits + ;; NOTE: on build hosts where the daemon's sandbox mounts + ;; the build tree noexec, chmod alone does not help -- exec + ;; ./autogen.sh dies with "Permission denied". Run it + ;; through sh instead of exec'ing it directly. + (replace 'bootstrap (lambda _ - (chmod "autogen.sh" #o755))) + (invoke "sh" "./autogen.sh"))) (add-after 'install 'patch-extension-path (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -109,10 +113,10 @@ It currently supports MySQL, Postgres and SQLite3.") (substitute* "configure.ac" (("mariadbclient") "mariadb")) (substitute* "src/guile-dbd-mysql.c" - (("<mariadb/") "<mysql/"))) - (add-after 'chdir 'fix-exec-bits + (("<mariadb/") "<mysql/")))) + (replace 'bootstrap (lambda _ - (chmod "autogen.sh" #o755)))) + (invoke "sh" "./autogen.sh"))) (delete 'patch-extension-path))))) (inputs (modify-inputs (package-inputs guile3-dbi) @@ -130,8 +134,8 @@ for MySQL.") (license license:gpl2+))) (define-public gn-guile - (let ((commit "454244b774ece37f04f146c74353ea4ec35d43e1") - (revision "0")) + (let ((commit "cf32f16a1c7bcc850c21051bcd4b27e90f7182cf") + (revision "1")) (package (name "gn-guile") (version (git-version "4.0.0" revision commit)) @@ -143,13 +147,14 @@ for MySQL.") (file-name (string-append name "-" version)) (sha256 (base32 - "1n1zjpwfksq8bf42d7xr7lnblgsbqc0yszkbid253s943fyxzhfn")))) + "0i8m89l0a33rpngwxjx2qsydfhs1z4yxzqnxgn81chz9312k7p8l")))) (build-system guile-build-system) (native-inputs (list guile-3.0)) (propagated-inputs (list guile-3.0 guile3-dbi guile3-dbd-mysql guile-fibers guile-gnutls guile-readline guile-commonmark guile-redis openssl nss-certs gemma-exec-fix parallel guile-hashing - guile-json-4 bash-minimal git-minimal guile-lmdb guile-lib)) + guile-json-4 bash-minimal git-minimal guile-lmdb guile-lib + guile-config)) (arguments (list #:not-compiled-file-regexp "(guix|guix/.*)[.]scm$" @@ -224,43 +229,52 @@ for MySQL.") (go-path (map (lambda (x) (string-append x go-dir)) (cons* out guile-inputs)))) - (mkdir-p "bin") - (copy-file "gn-guile.sh" "bin/gn-guile") - (copy-file "gn-guile.sh" "bin/gn-guile-dev") - (copy-file "scripts/lmdb-publishdata-export.scm" - "bin/lmdb-publishdata-export") - (substitute* "bin/gn-guile" - (("@SHELL@") bash) - (("guile") guile) - (("web/webserver.scm") webserver)) - (substitute* "bin/gn-guile-dev" - (("@SHELL@") bash) - (("guile") guile) - (("web/webserver.scm") "./web/webserver.scm")) - (chmod "bin/gn-guile" #o755) - (chmod "bin/gn-guile-dev" #o755) - (chmod "bin/lmdb-publishdata-export" #o755) - (install-file "bin/gn-guile" bin) - (install-file "bin/gn-guile-dev" bin) - (install-file "bin/lmdb-publishdata-export" bin) - (wrap-script - (string-append out "/bin/gn-guile") - `("PATH" ":" prefix ,path) - `("GUILE_AUTO_COMPILE" ":" = ("0")) - `("GUILE_LOAD_PATH" ":" prefix ,scm-path) - `("GUILE_LOAD_COMPILED_PATH" ":" prefix ,go-path)) - (wrap-script - (string-append out "/bin/gn-guile-dev") - `("PATH" ":" prefix ,path) - `("GUILE_AUTO_COMPILE" ":" = ("0")) - `("GUILE_LOAD_PATH" ":" prefix ,scm-dev-path) - `("GUILE_LOAD_COMPILED_PATH" ":" prefix ,go-dev-path)) - (wrap-program - (string-append out "/bin/lmdb-publishdata-export") - `("PATH" ":" prefix ,path) - `("GUILE_AUTO_COMPILE" ":" = ("0")) - `("GUILE_LOAD_PATH" ":" prefix ,scm-path) - `("GUILE_LOAD_COMPILED_PATH" ":" prefix ,go-path)))))))) + ;; NOTE: mkdir-p "bin" (relative) was the bug here -- the + ;; copy destination is out/bin, create THAT. + (mkdir-p bin) + ;; upstream removed gn-guile.sh: bin/gn-guile ships with + ;; the repository now (c31dcec) and already resolves + ;; web/webserver.scm through guile's load path. The + ;; build phase chdir'ed into the unpacked source, so + ;; locate the scripts through find-files (they may sit + ;; in ./ or ./source/ depending on the unpack). + (for-each + (lambda (f) + (copy-file f (string-append bin "/" (basename f))) + (chmod (string-append bin "/" (basename f)) #o755)) + (append + (find-files "." (lambda (f s) + (string=? (basename f) "gn-guile"))) + (find-files "." (lambda (f s) + (string=? (basename f) + "lmdb-publishdata-export.scm"))))) + ;; NOTE: wrap-script/wrap-program hard-link the program + ;; to .<name>-real; in this sandboxed daemon that link + ;; fails with ENOENT (the store is read-only/overlay). + ;; Write the wrapper script by hand instead. + (call-with-output-file + (string-append bin "/gn-guile-wrapper-tmp") + (lambda (port) + (format port "#!~a~%" bash) + (format port + "export PATH=\"~a${PATH:+:}$PATH\"~%" + (string-join path ":")) + (format port "export GUILE_AUTO_COMPILE=0~%") + (format port + "export GUILE_LOAD_PATH=\"~a${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH\"~%" + (string-join scm-path ":")) + (format port + "export GUILE_LOAD_COMPILED_PATH=\"~a${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH\"~%" + (string-join go-path ":")) + (format port + "exec -a \"${0##*/}\" \"~a\" \"$@\"~%" + (string-append bin "/.gn-guile-real")))) + (chmod (string-append bin "/gn-guile-wrapper-tmp") #o755) + ;; move the real script aside, then the wrapper in place + (rename-file (string-append bin "/gn-guile") + (string-append bin "/.gn-guile-real")) + (rename-file (string-append bin "/gn-guile-wrapper-tmp") + (string-append bin "/gn-guile")))))))) (home-page "https://git.genenetwork.com/gn-guile") (synopsis "Next generation GN code in guile") (description "Use of guile.") |
