guix-kakafarm-channel

Kaka Farm's GNU Guix channel.
git clone https://kaka.farm/~git/guix-kakafarm-channel
Log | Files | Refs | README | LICENSE

commit 9b18d6eecb2dadbaf701b1f53b9aca1091db2251
parent a673bb71b666f810d0d51d025bde39a7ea9fdd1f
Author: Yuval Langer <yuval.langer@gmail.com>
Date:   Thu, 24 Oct 2024 16:48:36 +0300

Adding ribbit-javascript-repl target.  Doesn't work, but it is progress.

Diffstat:
Mkakafarm/packages/ribbit.scm | 83++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 70 insertions(+), 13 deletions(-)

diff --git a/kakafarm/packages/ribbit.scm b/kakafarm/packages/ribbit.scm @@ -24,30 +24,33 @@ #:use-module (gnu packages scheme) #:use-module (guix build-system copy) + #:use-module (guix build-system trivial) + #:use-module (guix modules) + #:use-module (guix build utils) #:use-module (guix gexp) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) ) -(define-public ribbit - (let ((commit "11dd04a9546f99c557b81fa0fd069c693f5eddb5") - (revision "1") - (base32-string "1kvfa6zi9jbjy2c5cqh5y84mcxd68rz77xzq3h59qr7lji3rjj47") - (git-repository-url - "https://github.com/udem-dlteam/ribbit")) +(define ribbit-commit "11dd04a9546f99c557b81fa0fd069c693f5eddb5") +(define git-repository-url "https://github.com/udem-dlteam/ribbit") +(define ribbit-base32-string "1kvfa6zi9jbjy2c5cqh5y84mcxd68rz77xzq3h59qr7lji3rjj47") + +(define-public ribbit-rsc.exe + (let ((revision "1")) (package - (name "ribbit") - (version (git-version "0.0.0" revision commit)) + (name "ribbit-rsc.exe") + (version (git-version "0.0.0" revision ribbit-commit)) (source (origin (uri (git-reference (url git-repository-url) - (commit commit))) + (commit ribbit-commit))) (method git-fetch) (file-name (git-file-name name version)) (sha256 - (base32 base32-string)))) + (base32 ribbit-base32-string)))) (native-inputs (list coreutils bash-minimal @@ -62,7 +65,6 @@ #~(modify-phases %standard-phases (add-after 'unpack 'move-create-and-delete-files (lambda _ - (import (ice-9 ftw) (srfi srfi-1) (srfi srfi-26)) (chdir "src") (system* "make" "rsc.exe") (chdir "..")))) @@ -71,14 +73,20 @@ #$name "-" #$version - "/"))) + "/")) + (src (string-append "usr/src/" + #$name + "-" + #$version + "/")) + ) `( - ("src/rsc.exe" "bin/") ("README.md" ,docs) ("CITATION.md" ,docs) ("AUTHORS" ,docs) ("LICENSE" ,docs) ("docs" ,docs) + ("src/" ,src) )) )) (home-page git-repository-url) @@ -87,3 +95,52 @@ (description "A Scheme runtime compiler.") (license license:expat)))) + +(define-public ribbit-javascript-r4rs + (let ((revision "1")) + (package + (name "ribbit-javascript-r4rs") + (version (git-version "0.0.0" revision ribbit-commit)) + (source #f) + (native-inputs (list + coreutils + bash-minimal + gcc-toolchain + ribbit-rsc.exe + )) + ;; (inputs (list gcc-toolchain)) + (build-system trivial-build-system) + (arguments + (list + #:builder + (with-imported-modules (source-module-closure + '((guix build utils))) + #~(let* ((ribbit-src-path (string-append #$ribbit-rsc.exe + "/usr/src")) + (ribbit-r4rs-repl-source-file (string-append #$ribbit-rsc.exe + "/usr/src/lib/r4rs/repl.scm")) + (lib-path (string-append #$output + "/usr/lib/" + #$name + "-" + #$version)) + (repl-target (string-append lib-path + "/repl.js"))) + (import (ice-9 ftw) + (guix build utils)) + (mkdir-p lib-path) + (chdir ribbit-src-path) + (system* ,rsc.exe + "-t" "js" + "-l" "r4rs" + ,ribbit-r4rs-repl-source-file + "-o" ,repl-target + ) + (format #t "######## ~S~%" (scandir lib-path)) + #t)))) + (home-page git-repository-url) + (synopsis + "A Javascript Ribbit Scheme runtime") + (description + "A Javascript Ribbit Scheme runtime.") + (license license:expat))))