guix-kakafarm-channel

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

ribbit.scm (5434B)


      1 ;;; Kakafarm's Guix Channel
      2 ;;; Copyright © 2023-2024 Yuval Langer <yuval.langer@gmail.com>
      3 ;;;
      4 ;;; This file is part of Kakafarm's Guix Channel.
      5 ;;;
      6 ;;; Kakafarm's Guix Channel is free software; you can redistribute it
      7 ;;; and/or modify it under the terms of the GNU General Public License
      8 ;;; as published by the Free Software Foundation; either version 3 of
      9 ;;; the License, or (at your option) any later version.
     10 ;;;
     11 ;;; Kakafarm's Guix Channel is distributed in the hope that it will be
     12 ;;; useful, but WITHOUT ANY WARRANTY; without even the implied
     13 ;;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     14 ;;; See the GNU General Public License for more details.
     15 ;;;
     16 ;;; You should have received a copy of the GNU General Public License
     17 ;;; along with Kakafarm's Guix Channel.  If not, see
     18 ;;; <http://www.gnu.org/licenses/>.
     19 
     20 (define-module (kakafarm packages ribbit)
     21   #:use-module (gnu packages base)
     22   #:use-module (gnu packages bash)
     23   #:use-module (gnu packages commencement)
     24   #:use-module (gnu packages scheme)
     25 
     26   #:use-module (guix build-system copy)
     27   #:use-module (guix build-system trivial)
     28   #:use-module (guix modules)
     29   #:use-module (guix build utils)
     30   #:use-module (guix gexp)
     31   #:use-module (guix git-download)
     32   #:use-module ((guix licenses) #:prefix license:)
     33   #:use-module (guix packages)
     34   )
     35 
     36 (define ribbit-commit "11dd04a9546f99c557b81fa0fd069c693f5eddb5")
     37 (define git-repository-url "https://github.com/udem-dlteam/ribbit")
     38 (define ribbit-base32-string "1kvfa6zi9jbjy2c5cqh5y84mcxd68rz77xzq3h59qr7lji3rjj47")
     39 
     40 (define-public ribbit-rsc.exe
     41   (let ((revision "1"))
     42     (package
     43       (name "ribbit-rsc.exe")
     44       (version (git-version "0.0.0" revision ribbit-commit))
     45       (source
     46        (origin
     47          (uri (git-reference
     48                (url git-repository-url)
     49                (commit ribbit-commit)))
     50          (method git-fetch)
     51          (file-name (git-file-name name version))
     52          (sha256
     53           (base32 ribbit-base32-string))))
     54       (native-inputs (list
     55                       coreutils
     56                       bash-minimal
     57                       gcc-toolchain
     58                       gambit-c
     59                       ))
     60       ;; (inputs (list gcc-toolchain))
     61       (build-system copy-build-system)
     62       (arguments
     63        (list
     64         #:phases
     65         #~(modify-phases %standard-phases
     66             (add-after 'unpack 'move-create-and-delete-files
     67               (lambda _
     68                 (chdir "src")
     69                 (system* "make" "rsc.exe")
     70                 (chdir ".."))))
     71         #:install-plan
     72         #~(let ((docs (string-append "share/doc/"
     73                                      #$name
     74                                      "-"
     75                                      #$version
     76                                      "/"))
     77                 (src (string-append "usr/src/"
     78                                     #$name
     79                                     "-"
     80                                     #$version
     81                                     "/"))
     82                 )
     83             `(
     84               ("README.md" ,docs)
     85               ("CITATION.md" ,docs)
     86               ("AUTHORS" ,docs)
     87               ("LICENSE" ,docs)
     88               ("docs" ,docs)
     89               ("src/" ,src)
     90               ))
     91         ))
     92       (home-page git-repository-url)
     93       (synopsis
     94        "A Scheme runtime compiler")
     95       (description
     96        "A Scheme runtime compiler.")
     97       (license license:expat))))
     98 
     99 (define-public ribbit-javascript-r4rs
    100   (let ((revision "1"))
    101     (package
    102       (name "ribbit-javascript-r4rs")
    103       (version (git-version "0.0.0" revision ribbit-commit))
    104       (source #f)
    105       (native-inputs (list
    106                       coreutils
    107                       bash-minimal
    108                       gcc-toolchain
    109                       ribbit-rsc.exe
    110                       ))
    111       ;; (inputs (list gcc-toolchain))
    112       (build-system trivial-build-system)
    113       (arguments
    114        (list
    115         #:builder
    116         (with-imported-modules (source-module-closure
    117                                 '((guix build utils)))
    118           #~(let* ((ribbit-src-path (string-append #$ribbit-rsc.exe
    119                                                    "/usr/src/"
    120                                                    #$(package-name ribbit-rsc.exe)
    121                                                    "-"
    122                                                    #$(package-version ribbit-rsc.exe)))
    123                    (output-lib-path (string-append #$output
    124                                                    "/usr/lib/"
    125                                                    #$name
    126                                                    "-"
    127                                                    #$version))
    128                    (output-repl-target (string-append output-lib-path
    129                                                       "/repl.js")))
    130               (import (ice-9 ftw)
    131                       (guix build utils))
    132               (mkdir-p output-lib-path)
    133               (chdir ribbit-src-path)
    134               (system* "./rsc.exe"
    135                        "-t" "js"
    136                        "-l" "r4rs"
    137                        "lib/r4rs/repl.scm"
    138                        "-o" output-repl-target
    139                        )
    140               #t))))
    141       (home-page git-repository-url)
    142       (synopsis
    143        "A Javascript Ribbit Scheme runtime")
    144       (description
    145        "A Javascript Ribbit Scheme runtime.")
    146       (license license:expat))))