diff options
| author | 2025-08-08 10:42:27 -0400 | |
|---|---|---|
| committer | 2025-08-08 10:42:27 -0400 | |
| commit | 44433f42f14eb0c86b87555710c3d950dd300099 (patch) | |
| tree | 6bacee719592db24f6e86ec2818ab06bd01429db /lib | |
| parent | update README.md (diff) | |
rationalize packages, add foment
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gnu/packages/chibi-scheme-with-path.scm | 32 | ||||
| -rw-r--r-- | lib/gnu/packages/foment.scm | 87 | ||||
| -rw-r--r-- | lib/mcgoron/guix/chibi.scm | 38 | ||||
| -rw-r--r-- | lib/mcgoron/guix/foment.scm | 40 |
4 files changed, 197 insertions, 0 deletions
diff --git a/lib/gnu/packages/chibi-scheme-with-path.scm b/lib/gnu/packages/chibi-scheme-with-path.scm new file mode 100644 index 0000000..cd01b9c --- /dev/null +++ b/lib/gnu/packages/chibi-scheme-with-path.scm @@ -0,0 +1,32 @@ +#| 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 (gnu packages chibi-scheme-with-path) + #:use-module (guix packages) + #:use-module (gnu packages scheme)) + +(define-public chibi-lib-dir "share/guix-chibi") +(define-public chibi-binlib-dir "lib/guix-chibi") + +(define-public chibi-scheme-with-path + (package + (inherit chibi-scheme) + (name "chibi-scheme-with-path") + (native-search-paths + (list (search-path-specification + (variable "CHIBI_MODULE_PATH") + (files (list chibi-lib-dir chibi-binlib-dir))))))) + diff --git a/lib/gnu/packages/foment.scm b/lib/gnu/packages/foment.scm new file mode 100644 index 0000000..cbe2885 --- /dev/null +++ b/lib/gnu/packages/foment.scm @@ -0,0 +1,87 @@ +#| 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 (gnu packages foment) + #:use-module (guix packages) + #:use-module (guix licenses) + #:use-module (guix git-download) + #:use-module (gnu packages version-control) + #:use-module (gnu packages bash) + #:use-module (guix gexp) + #:use-module (guix build-system gnu)) + +(define-public foment-lib-dir "share/foment") + +(define-public foment + (package + (name "foment") + (version "6089c3c") + (source + (origin + (method git-fetch) + (uri (git-reference (url "https://github.com/leftmike/foment") + (commit "6089c3c9e762875f619ef382d27943819bbe002b"))) + (sha256 (base32 "1a6q8qfd6ggc6fl9lf1d8m20q8k498jrswc4qcn3bb7rkq4w258a")))) + (build-system gnu-build-system) + (native-search-paths (list + (search-path-specification + (variable "FOMENT_LIBPATH") + (files (list foment-lib-dir))))) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'patch-makefile + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "unix/makefile" + (("sudo *") "") + (("git rev-parse --abbrev-ref HEAD") "echo \"master\"") + (("git rev-parse --short HEAD") "echo 6089c3c")) +;; Replace hardcoded path /bin/sh with the current interpreter. +;; This follows what racket does: +;; https://issues.guix.gnu.org/47180 + (substitute* "src/base.scm" + (("\"/bin/sh\"") + (let ((sh (which "sh"))) + (string-append "(if (file-exists? \"" sh "\")\n" + " \"" sh "\"\n" + " \"/bin/sh\")")))))) + (replace 'build + (lambda _ + (with-directory-excursion "unix" + (invoke "make")))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "unix" + (invoke "make" "test") + (invoke "make" "stress-test"))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((bin (string-append (assoc-ref outputs "out") + "/bin"))) + (install-file "unix/release/foment" bin) + (copy-recursively "unix/debug/foment" + (string-append bin "/foment-debug")))))))) + (home-page "https://ktakashi.github.io/") + (synopsis "Foment is an implementation of R7RS Scheme.") + (license expat) + (inputs '()) + (native-inputs (list bash)) + (description "Foment is an implementation of Scheme."))) + diff --git a/lib/mcgoron/guix/chibi.scm b/lib/mcgoron/guix/chibi.scm new file mode 100644 index 0000000..7f256b5 --- /dev/null +++ b/lib/mcgoron/guix/chibi.scm @@ -0,0 +1,38 @@ +#| 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 chibi) + #:use-module (guix build-system) + #:use-module (guix build-system copy) + #:use-module (gnu packages chibi-scheme-with-path) + #:use-module (guix gexp)) + +(define-public chibi-scheme-build-system + (let ((lower* (build-system-lower copy-build-system))) + (build-system + (name 'chibi-pure) + (description "Build system for copying Scheme libraries to Chibi module directory") + (lower + (lambda args + (apply lower* + (if (memq #:install-plan args) + args + (append + args + (list + #:install-plan + `'(("." ,(string-append chibi-lib-dir + "/")))))))))))) diff --git a/lib/mcgoron/guix/foment.scm b/lib/mcgoron/guix/foment.scm new file mode 100644 index 0000000..bc38da7 --- /dev/null +++ b/lib/mcgoron/guix/foment.scm @@ -0,0 +1,40 @@ +#| 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 foment) + #:use-module (guix build-system) + #:use-module (guix build-system copy) + #:use-module (gnu packages foment) + #:use-module (guix gexp)) + +(define-public foment-build-system + (let ((lower* (build-system-lower copy-build-system))) + (build-system + (name 'foment-scheme) + (description "Build system for copying Scheme libraries to Foment module directory") + (lower + (lambda args + (apply lower* + (if (memq #:install-plan args) + args + (append + args + (list + #:install-plan + `'(("." ,(string-append foment-lib-dir + "/")))))))))))) + + |
