Skip to content

Instantly share code, notes, and snippets.

@pjotrp
Created December 13, 2018 01:15
Show Gist options
  • Save pjotrp/44757cc97239a91e0b6d37aab07387bc to your computer and use it in GitHub Desktop.
Save pjotrp/44757cc97239a91e0b6d37aab07387bc to your computer and use it in GitHub Desktop.
GNU Guix package for mruby
(define-public mruby
(package
(name "mruby")
(version "2.0.0")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/mruby/mruby/archive/" version ".zip"))
(sha256
(base32
"00308wlldj59imsdxp1k9dwbw1x2cz90kvygq9l4hq9m64lj6kfm"))))
(build-system ruby-build-system)
(inputs
`(("bison" ,bison)
("unzip" ,unzip)))
(arguments
`(#:tests? #f)) ;; Tests require network access
(home-page "http://mruby.org")
(synopsis "Lightweight embedable implementation of the Ruby programming language")
(description "Bytecode compiler for linking and embedding Ruby within an application.")
(license license:expat)))
@pjotrp
Copy link
Author

pjotrp commented Dec 13, 2018

Above installs mruby but I still need to copy binaries, include path and libs into the store to make it work. Should be fairly trivial.

You can build mruby in a GNU Guix container with

~/.config/guix/current/bin/guix environment -C guix --ad-hoc ruby bison

Tests pass without network access


>>> Test test <<<
mrbtest - Embeddable Ruby Test

.....................................................................................?.?...............................................................................................................................?...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Skip: File.expand_path (with ENV) =>  (mrbgems: mruby-io)
Skip: File.symlink => target directory of File.symlink is not found (mrbgems: mruby-io)
Skip: Struct.new removes existing constant => redefining Struct with same name cause warnings (mrbgems: mruby-struct)
Total: 1076
   OK: 1076
   KO: 0
Crash: 0
 Time: 0.48 seconds

....................
Total: 20
   OK: 20
   KO: 0
Crash: 0
 Time: 0.17 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment