aboutsummaryrefslogtreecommitdiffstats
path: root/mcgoron/guix
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2025-08-16 22:17:12 -0400
committerGravatar Peter McGoron 2025-08-16 22:17:47 -0400
commit75c6f8ac409aa3484f3e6265af07494e3967285c (patch)
tree0a1f18bd954c8beb22c4d51d3201220e59d96b90 /mcgoron/guix
parenttr7 (diff)
mosh
Diffstat (limited to 'mcgoron/guix')
-rw-r--r--mcgoron/guix/patches/mosh-0.2.9-rc1-fix-ffitest.patch13
-rw-r--r--mcgoron/guix/scheme-packages.scm62
2 files changed, 72 insertions, 3 deletions
diff --git a/mcgoron/guix/patches/mosh-0.2.9-rc1-fix-ffitest.patch b/mcgoron/guix/patches/mosh-0.2.9-rc1-fix-ffitest.patch
new file mode 100644
index 0000000..a6bcab4
--- /dev/null
+++ b/mcgoron/guix/patches/mosh-0.2.9-rc1-fix-ffitest.patch
@@ -0,0 +1,13 @@
+diff --git a/src/ffitest.c b/src/ffitest.c
+index 84b4b854..53e3e19c 100644
+--- a/src/ffitest.c
++++ b/src/ffitest.c
+@@ -235,7 +235,7 @@ void qsort(void *base, size_t num, size_t size,
+ for (i = 0; i < num; i++) {
+ printf("[%d]=%d\n", i, ((uint8_t*)base)[i]);
+ }
+- compare(1, 2);
++ compare((const void *)1, (const void *)2);
+ }
+
+ /* callouts return type functions */
diff --git a/mcgoron/guix/scheme-packages.scm b/mcgoron/guix/scheme-packages.scm
index b302582..f5d0b59 100644
--- a/mcgoron/guix/scheme-packages.scm
+++ b/mcgoron/guix/scheme-packages.scm
@@ -35,6 +35,8 @@
#:use-module (gnu packages bdw-gc)
#:use-module (gnu packages libffi)
#:use-module (gnu packages tls)
+ #:use-module (gnu packages textutils)
+ #:use-module (gnu packages multiprecision)
#:use-module (guix gexp))
;;;;;;;;;;;;;
@@ -92,7 +94,7 @@
(import (scheme base) (scheme write))
(export hello-world)
(begin (define (hello-world)
- (display "hello, world")
+ (display "hello, r7rs")
(newline)))))))))))))
(define-public hello-world-r6rs
@@ -110,14 +112,14 @@
#:builder
(begin
(use-modules (guix build utils))
- (let ((dir (string-append (assoc-ref %outputs "out") "/" ,r7rs-lib-dir)))
+ (let ((dir (string-append (assoc-ref %outputs "out") "/" ,r6rs-lib-dir)))
(mkdir-p dir)
(with-output-to-file (string-append dir "/hello-world.sls")
(lambda () (write '(library (hello-world)
(export hello-world)
(import (rnrs (6)))
(define (hello-world)
- (display "hello, world")
+ (display "hello, r6rs")
(newline))))))))))))
(define-public r7rs-search-path-specification
@@ -576,3 +578,57 @@ developers freedom in balancing features and footprint.")
,(append-to "TR7_LIB_PATH" "GUIX_TR7_PATH" "R7RS_LIBRARY_PATH")
impl))))
+;;;;;;;;;;;;;;;;
+;;;; Mosh
+;;;;;;;;;;;;;;;;
+
+(define-public mosh-lib-dir "share/mosh")
+
+(define-public mosh-build-system
+ (default-copying-build-system 'mosh
+ "Copy Scheme libraries into Mosh directory"
+ foment-lib-dir))
+
+(define-public mosh-scheme
+ (package
+ (name "mosh-scheme")
+ (version "0.2.9-rc1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri "https://github.com/higepon/mosh/releases/download/mosh-0.2.9-rc1/mosh-0.2.9-rc1.tar.gz")
+ (patches (search-patches "mcgoron/guix/patches/mosh-0.2.9-rc1-fix-ffitest.patch"))
+ (sha256 (base32 "07w49dbhy3zgn9kq8lqwshjy66plpjkb9dv20sczkqr8w4vbs4cz"))))
+ (build-system gnu-build-system)
+ #;(arguments '(#:phases (modify-phases %standard-phases
+ ;; Tests don't work yet. Issues with network.
+ (add-before 'check 'remove-broken-tests
+ (lambda _ )))))
+ (inputs (list oniguruma gmp openssl))
+ (home-page "https://mosh.monaos.org")
+ (synopsis "Free and fast R6RS interpreter")
+ (license bsd-2)
+ (description "Mosh is a free and fast interpreter for Scheme as specified in the R7RS & R6RS. (R7RS is the latest revision of the Scheme standard)
+
+The current release of Mosh supports all of the features R7RS small and R6RS.")))
+
+(define-public mosh-scheme-with-path
+ (package/path mosh-scheme
+ "mosh-scheme"
+ "Mosh with Guix paths"
+ "Wrapper for Mosh that adds Guix-managed paths"
+ "/bin/mosh"
+ "/bin/mosh"
+ "GUIX_MOSH_PATH"
+ (list r6rs-search-path-specification)
+ mosh-lib-dir
+ `(lambda (sh impl)
+ (format #t
+ "#!~a
+
+ ~a
+ exec -a $0 \"~a\" \"$@\""
+ sh
+ ,(append-to "MOSH_LOADPATH" "GUIX_MOSH_PATH" "R6RS_LIBRARY_PATH")
+ impl))))
+