aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2025-08-08 11:01:14 -0400
committerGravatar Peter McGoron 2025-08-08 11:01:14 -0400
commit968fd0780ec069f720b8aa6af0bf66a5a5697b90 (patch)
treec94dcfa45672d44f68a4fefd1977ce4a39c07899
parentrationalize packages, add foment (diff)
reorganize under custom namespace
-rw-r--r--examples-lib/mcgoron/guix/mcgoron-hello-world.scm (renamed from examples-lib/gnu/packages/mcgoron-hello-world.scm)4
-rw-r--r--lib/gnu/packages/chibi-scheme-with-path.scm32
-rw-r--r--lib/gnu/packages/foment.scm87
-rw-r--r--lib/mcgoron/guix/chibi.scm17
-rw-r--r--lib/mcgoron/guix/foment.scm69
5 files changed, 85 insertions, 124 deletions
diff --git a/examples-lib/gnu/packages/mcgoron-hello-world.scm b/examples-lib/mcgoron/guix/mcgoron-hello-world.scm
index bb6caca..7f54c55 100644
--- a/examples-lib/gnu/packages/mcgoron-hello-world.scm
+++ b/examples-lib/mcgoron/guix/mcgoron-hello-world.scm
@@ -14,13 +14,11 @@
| with this program. If not, see <https://www.gnu.org/licenses/>.
|#
-(define-module (gnu packages mcgoron-hello-world)
+(define-module (mcgoron guix mcgoron-hello-world)
#:use-module (guix packages)
#:use-module (guix licenses)
#:use-module (guix gexp)
- #:use-module (gnu packages chibi-scheme-with-path)
#:use-module (mcgoron guix chibi)
- #:use-module (gnu packages foment)
#:use-module (mcgoron guix foment))
(define hello-world-path "./examples-src/hello-world")
diff --git a/lib/gnu/packages/chibi-scheme-with-path.scm b/lib/gnu/packages/chibi-scheme-with-path.scm
deleted file mode 100644
index cd01b9c..0000000
--- a/lib/gnu/packages/chibi-scheme-with-path.scm
+++ /dev/null
@@ -1,32 +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 (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
deleted file mode 100644
index cbe2885..0000000
--- a/lib/gnu/packages/foment.scm
+++ /dev/null
@@ -1,87 +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 (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
index 7f256b5..9419013 100644
--- a/lib/mcgoron/guix/chibi.scm
+++ b/lib/mcgoron/guix/chibi.scm
@@ -17,7 +17,8 @@
(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 packages)
+ #:use-module (gnu packages scheme)
#:use-module (guix gexp))
(define-public chibi-scheme-build-system
@@ -36,3 +37,17 @@
#:install-plan
`'(("." ,(string-append chibi-lib-dir
"/"))))))))))))
+
+(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/mcgoron/guix/foment.scm b/lib/mcgoron/guix/foment.scm
index bc38da7..b1ce4af 100644
--- a/lib/mcgoron/guix/foment.scm
+++ b/lib/mcgoron/guix/foment.scm
@@ -15,9 +15,14 @@
|#
(define-module (mcgoron guix 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 build-system gnu)
#: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
@@ -38,3 +43,65 @@
"/"))))))))))))
+(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://github.com/leftmike/foment")
+ (synopsis "Foment is an implementation of R7RS Scheme.")
+ (license expat)
+ (inputs '())
+ (native-inputs (list bash))
+ (description "Foment is an implementation of Scheme.")))
+
+