diff options
| author | 2025-08-14 18:10:52 -0400 | |
|---|---|---|
| committer | 2025-08-14 18:10:52 -0400 | |
| commit | 4f4634541cbf7755ed84f17fded7588190237ec2 (patch) | |
| tree | 5b5341b2b44284e94f5c23fd0cee98b54dd7be10 /mcgoron/guix | |
| parent | patch sagittarius to use R7RS_LIBRARY_PATH, add copyright notice (diff) | |
wrapper-based module loading for foment
Diffstat (limited to '')
| -rw-r--r-- | mcgoron/guix/scheme-packages.scm | 101 |
1 files changed, 77 insertions, 24 deletions
diff --git a/mcgoron/guix/scheme-packages.scm b/mcgoron/guix/scheme-packages.scm index 16ed092..701294f 100644 --- a/mcgoron/guix/scheme-packages.scm +++ b/mcgoron/guix/scheme-packages.scm @@ -25,6 +25,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system) #:use-module (guix build-system copy) + #:use-module (guix build-system trivial) #:use-module (gnu packages scheme) #:use-module (gnu packages cmake) #:use-module (guix build-system cmake) @@ -81,6 +82,66 @@ (variable "R7RS_LIBRARY_PATH") (files (list r7rs-lib-dir)))) +(define* (package/path imported-package + package-name + synopsis + description + binary-name + target-binary-name + impl-envar + guix-impl-envar + portable-envar + #:optional (set-environment-beforehand "")) +(package + (name (string-append package-name "-with-path")) + (synopsis synopsis) + (description description) + (version "1.0.0") + (source #f) + (license gpl3+) + (build-system trivial-build-system) + (home-page "https://florida.moe/guix-scheme") + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((bin (assoc-ref %outputs "out")) + (impl (string-append + (assoc-ref %build-inputs ,package-name) + ,binary-name)) + (sh (string-append + (assoc-ref %build-inputs "bash-minimal") + "/bin/bash")) + (script (string-append bin ,target-binary-name))) + (mkdir-p (dirname script)) + (with-output-to-file script + (lambda () + (format #t +"#!~a + +if [ -z \"$~a\" ] && [ -z \"$~a\" ]; then + exec -a $0 \"~a\" \"$@\" +else + ~a + ~a=\"${~a:+${~a}:}${~a:+${~a}:}${~a:+${~a}:}\" exec -a $0 \"~a\" \"$@\" +fi" + sh + ,guix-impl-envar ,portable-envar + impl + ,set-environment-beforehand + ,impl-envar ,impl-envar ,impl-envar + ,guix-impl-envar ,guix-impl-envar + ,portable-envar ,portable-envar + impl))) + (chmod script #o755))))) + (inputs (list imported-package bash-minimal)) + (native-inputs (list imported-package bash-minimal)) + (native-search-paths (list (search-path-specification + (variable guix-impl-envar) + (files (list foment-lib-dir))) + r7rs-search-path-specification)))) + ;;;;;;;;;;;;;; ;;;; Foment ;;;;;;;;;;;;;; @@ -101,14 +162,8 @@ (uri (git-reference (url "https://github.com/leftmike/foment") (commit "6089c3c9e762875f619ef382d27943819bbe002b"))) (sha256 (base32 "1a6q8qfd6ggc6fl9lf1d8m20q8k498jrswc4qcn3bb7rkq4w258a")) - (patches (search-patches "mcgoron/guix/patches/foment-0.4.1-library-path.patch")))) + #;(patches (search-patches "mcgoron/guix/patches/foment-0.4.1-library-path.patch")))) (build-system gnu-build-system) - (native-search-paths (list - (search-path-specification - (variable "FOMENT_LIBPATH") - (files (list foment-lib-dir))) - r7rs-search-path-specification)) - (arguments (list #:phases @@ -151,7 +206,18 @@ (license expat) (inputs '()) (native-inputs (list bash)) - (description "Foment is an implementation of Scheme."))) + (description "Foment is an implementation of R7RS Scheme written in C++ with support for continuation marks and many SRFIs."))) + +(define-public foment-with-path + (package/path foment + "foment" + "Foment with Guix paths" + "Wrapper for Foment Scheme that adds Guix-managed paths to Foment search path" + "/bin/foment" + "/bin/foment" + "FOMENT_LIBPATH" + "GUIX_FOMENT_PATH" + "R7RS_LIBRARY_PATH")) ;;;;;;;;;;;;;;;;;;; ;;;; Chibi @@ -165,23 +231,15 @@ "Copy Scheme libraries into Chibi Scheme directory" foment-lib-dir)) -(define-public chibi-scheme-with-path +#;(define-public chibi-scheme-with-path (package - (inherit chibi-scheme) (name "chibi-scheme-with-path") (home-page "https://github.com/ashinn/chibi-scheme") (version "0.11") - (source - (origin - (method git-fetch) - (uri (git-reference (url home-page) (commit version))) - (file-name (git-file-name name version)) - (sha256 - (base32 "02zq35hdbi03rmmamx6ml4ihsigdl4mmbf6d9ysazv8ciiln5v4b")) - (patches (search-patches "mcgoron/guix/patches/chibi-scheme-0.11-library-path.patch")))) + (source #f) (native-search-paths (list (search-path-specification - (variable "CHIBI_MODULE_PATH") + (variable "GUIX_CHIBI_PATH") (files (list chibi-lib-dir chibi-binlib-dir))) r7rs-search-path-specification)))) @@ -213,11 +271,6 @@ (inputs (list libgc zlib libffi openssl)) (home-page "https://ktakashi.github.io/") (synopsis "Script interpreter with many built-in libraries") - (native-search-paths (list - (search-path-specification - (variable "SAGITTARIUS_LOADPATH") - (files (list sagittarius-lib-dir))) - r7rs-search-path-specification)) (license bsd-2) (description "Sagittarius Scheme is a R6RS/R7RS Scheme implementation with a lot of practical libraries, especially cryptographic libraries."))) |
