aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2025-08-12 19:19:35 -0400
committerGravatar Peter McGoron 2025-08-12 19:19:35 -0400
commit609aa7dc1e76a0d1733bc0c2f929e9d1be7eb772 (patch)
tree69343d34fd2380d04f7568b9428c506b7bde9d1b
parentpatch chibi to use R7RS_LIBRARY_PATH (diff)
patch sagittarius to use R7RS_LIBRARY_PATH, add copyright notice
-rw-r--r--mcgoron/guix/patches/COPYING15
-rw-r--r--mcgoron/guix/patches/sagittarius-scheme-0.9.13-library-path.patch23
-rw-r--r--mcgoron/guix/sagittarius.scm70
-rw-r--r--mcgoron/guix/scheme-packages.scm53
4 files changed, 91 insertions, 70 deletions
diff --git a/mcgoron/guix/patches/COPYING b/mcgoron/guix/patches/COPYING
new file mode 100644
index 0000000..e389742
--- /dev/null
+++ b/mcgoron/guix/patches/COPYING
@@ -0,0 +1,15 @@
+The source code to all patches is licensed under the zero-clause BSD license:
+
+Copyright © 2025 Peter McGoron
+
+Permission to use, copy, modify, and/or distribute this software for
+any purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/mcgoron/guix/patches/sagittarius-scheme-0.9.13-library-path.patch b/mcgoron/guix/patches/sagittarius-scheme-0.9.13-library-path.patch
new file mode 100644
index 0000000..b47d17e
--- /dev/null
+++ b/mcgoron/guix/patches/sagittarius-scheme-0.9.13-library-path.patch
@@ -0,0 +1,23 @@
+diff --git a/src/os/posix/system.c b/src/os/posix/system.c
+index 474891c5..9bb991ce 100644
+--- a/src/os/posix/system.c
++++ b/src/os/posix/system.c
+@@ -131,12 +131,17 @@ SgObject Sg_GetLastErrorMessage()
+
+ SgObject Sg_GetDefaultLoadPath()
+ {
+- SgObject env = Sg_Getenv(UC("SAGITTARIUS_LOADPATH"));
++ SgObject env = Sg_Getenv(UC("R7RS_LIBRARY_PATH"));
+ SgObject h = SG_NIL, t = SG_NIL;
+ if (!SG_FALSEP(env) && SG_STRING_SIZE(env) != 0) {
+ SG_APPEND(h, t, Sg_StringSplitChar(SG_STRING(env), ':'));
+ }
+
++ env = Sg_Getenv(UC("SAGITTARIUS_LOADPATH"));
++ if (!SG_FALSEP(env) && SG_STRING_SIZE(env) != 0) {
++ SG_APPEND(h, t, Sg_StringSplitChar(SG_STRING(env), ':'));
++ }
++
+ SG_APPEND1(h, t, Sg_SitelibPath());
+ SG_APPEND1(h, t, SG_MAKE_STRING(SAGITTARIUS_SHARE_SITE_LIB_PATH));
+ SG_APPEND1(h, t, SG_MAKE_STRING(SAGITTARIUS_SHARE_LIB_PATH));
diff --git a/mcgoron/guix/sagittarius.scm b/mcgoron/guix/sagittarius.scm
deleted file mode 100644
index 880391e..0000000
--- a/mcgoron/guix/sagittarius.scm
+++ /dev/null
@@ -1,70 +0,0 @@
-#| Copyright (C) 2025 Peter McGoron
- |
- | This program is free software: you can redistribute it and/or modify it
- | under the terms of the GNU General Public License as published by the
- | Free Software Foundation, either version 3 of the License, or (at your
- | option) any later version.
- |
- | This program is distributed in the hope that it will be useful, but
- | WITHOUT ANY WARRANTY; without even the implied warranty of
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- | General Public License for more details.
- |
- | You should have received a copy of the GNU General Public License along
- | with this program. If not, see <https://www.gnu.org/licenses/>.
- |#
-
-
-(define-module (mcgoron guix sagittarius)
- #:use-module (guix packages)
- #:use-module (guix licenses)
- #:use-module (gnu packages bdw-gc)
- #:use-module (gnu packages compression)
- #:use-module (gnu packages tls)
- #:use-module (gnu packages libffi)
- #:use-module (guix download)
- #:use-module (guix build-system)
- #:use-module (guix build-system copy)
- #:use-module (guix build-system cmake))
-
-(define-public sagittarius-lib-dir "share/guix-sagittarius")
-
-(define-public sagittarius-scheme
- (package
- (name "sagittarius-scheme")
- (version "0.9.13")
- (source
- (origin
- (method url-fetch)
- (uri "https://github.com/ktakashi/sagittarius-scheme/releases/download/v0.9.13/sagittarius-0.9.13.tar.gz")
- (sha256 (base32 "0wspsv7mr1lchv0lfc50s750a358534pgri1c2fqlws31hci5y4c"))))
- (build-system cmake-build-system)
- (arguments '(#:phases (modify-phases %standard-phases
- ;; Tests don't work yet. Issues with network.
- (delete 'check))))
- (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)))))
- (license bsd-2)
- (description "Sagittarius Scheme is a R6RS/R7RS Scheme implementation with a lot of practical libraries, especially cryptographic libraries.")))
-
-(define-public sagittarius-build-system
- (let ((lower* (build-system-lower copy-build-system)))
- (build-system
- (name 'sagittarius-scheme)
- (description "Build system for copying Scheme libraries to Sagittarius Scheme module directory")
- (lower
- (lambda args
- (apply lower*
- (if (memq #:install-plan args)
- args
- (append
- args
- (list
- #:install-plan
- `'(("." ,(string-append sagittarius-lib-dir "/"))))))))))))
-
diff --git a/mcgoron/guix/scheme-packages.scm b/mcgoron/guix/scheme-packages.scm
index 648f654..16ed092 100644
--- a/mcgoron/guix/scheme-packages.scm
+++ b/mcgoron/guix/scheme-packages.scm
@@ -26,8 +26,18 @@
#:use-module (guix build-system)
#:use-module (guix build-system copy)
#:use-module (gnu packages scheme)
+ #:use-module (gnu packages cmake)
+ #:use-module (guix build-system cmake)
+ #:use-module (gnu packages compression)
+ #:use-module (gnu packages bdw-gc)
+ #:use-module (gnu packages libffi)
+ #:use-module (gnu packages tls)
#:use-module (guix gexp))
+;;;;;;;;;;;;;
+;;;; Portable
+;;;;;;;;;;;;;
+
(define-public r7rs-lib-dir "share/scheme/r7rs")
(define-public r6rs-lib-dir "share/scheme/r6rs")
@@ -71,6 +81,10 @@
(variable "R7RS_LIBRARY_PATH")
(files (list r7rs-lib-dir))))
+;;;;;;;;;;;;;;
+;;;; Foment
+;;;;;;;;;;;;;;
+
(define-public foment-lib-dir "share/foment")
(define-public foment-build-system
(default-copying-build-system 'foment-scheme
@@ -139,6 +153,10 @@
(native-inputs (list bash))
(description "Foment is an implementation of Scheme.")))
+;;;;;;;;;;;;;;;;;;;
+;;;; Chibi
+;;;;;;;;;;;;;;;;;;;
+
(define-public chibi-lib-dir "share/guix-chibi")
(define-public chibi-binlib-dir "lib/guix-chibi")
@@ -167,4 +185,39 @@
(files (list chibi-lib-dir chibi-binlib-dir)))
r7rs-search-path-specification))))
+;;;;;;;;;;;;;;;;
+;;;; Sagittarius
+;;;;;;;;;;;;;;;;
+
+(define-public sagittarius-lib-dir "share/guix-sagittarius")
+
+(define-public sagittarius-scheme-build-system
+ (default-copying-build-system 'sagittarius
+ "Copy Scheme libraries into Sagittarius directory"
+ foment-lib-dir))
+
+(define-public sagittarius-scheme
+ (package
+ (name "sagittarius-scheme")
+ (version "0.9.13")
+ (source
+ (origin
+ (method url-fetch)
+ (uri "https://github.com/ktakashi/sagittarius-scheme/releases/download/v0.9.13/sagittarius-0.9.13.tar.gz")
+ (patches (search-patches "mcgoron/guix/patches/sagittarius-scheme-0.9.13-library-path.patch"))
+ (sha256 (base32 "0wspsv7mr1lchv0lfc50s750a358534pgri1c2fqlws31hci5y4c"))))
+ (build-system cmake-build-system)
+ (arguments '(#:phases (modify-phases %standard-phases
+ ;; Tests don't work yet. Issues with network.
+ (delete 'check))))
+ (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.")))