diff options
| author | 2025-08-08 11:01:14 -0400 | |
|---|---|---|
| committer | 2025-08-08 11:01:14 -0400 | |
| commit | 968fd0780ec069f720b8aa6af0bf66a5a5697b90 (patch) | |
| tree | c94dcfa45672d44f68a4fefd1977ce4a39c07899 /lib/mcgoron/guix/foment.scm | |
| parent | rationalize packages, add foment (diff) | |
reorganize under custom namespace
Diffstat (limited to 'lib/mcgoron/guix/foment.scm')
| -rw-r--r-- | lib/mcgoron/guix/foment.scm | 69 |
1 files changed, 68 insertions, 1 deletions
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."))) + + |
