guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: gnu: Add mruby.


From: guix-commits
Subject: 01/01: gnu: Add mruby.
Date: Thu, 7 Mar 2019 18:08:00 -0500 (EST)

rekado pushed a commit to branch master
in repository guix.

commit 933dad9156bfb05fc264fda01de351839403316b
Author: Ricardo Wurmus <address@hidden>
Date:   Fri Mar 8 00:04:33 2019 +0100

    gnu: Add mruby.
    
    * gnu/packages/ruby.scm (mruby): New variable.
---
 gnu/packages/ruby.scm | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 66eb260..8185538 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -34,6 +34,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bison)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
@@ -160,6 +161,66 @@ a focus on simplicity and productivity.")
                    (delete-file-recursively "ext/fiddle/libffi-3.2.1")
                    #t))))))
 
+(define-public mruby
+  (package
+    (name "mruby")
+    (version "2.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/mruby/mruby.git";)
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1r6w1asjshff43ymdwa6xmrkggza99mi2kw88k7ic6ag2j81hcj5"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:test-target "test"
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'unpack 'enable-verbose-tests
+           (lambda _
+             (substitute* "Makefile"
+               (("ruby ./minirake" m)
+                (string-append m " --verbose")))
+             #t))
+         (add-after 'unpack 'disable-broken-tests
+           (lambda _
+             (substitute* "mrbgems/mruby-io/test/io.rb"
+               (("assert\\('IO.popen.+$" m)
+                (string-append m "skip \"Hangs in the Guix build 
environment\"\n"))
+               (("assert\\('IO#isatty.+$" m)
+                (string-append m "skip \"Disable for Guix; there is no 
/dev/tty\"\n"))
+               ;; This one is really weird.  The *expected* output is all 
wrong.
+               (("assert\\('`cmd`.*" m)
+                (string-append m "skip \"Disable for Guix\"\n"))
+               (("echo foo")
+                (string-append (which "echo") " foo")))
+             #t))
+         ;; There is no install target
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin"))
+                    (lib (string-append out "/lib")))
+               (mkdir-p bin)
+               (copy-recursively "build/host/bin" bin)
+               (mkdir-p lib)
+               (copy-recursively "build/host/lib" lib))
+             #t)))))
+    (native-inputs
+     `(("ruby" ,ruby)
+       ("bison" ,bison)))
+    (home-page "https://github.com/mruby/mruby";)
+    (synopsis "Lightweight Ruby")
+    (description "mruby is the lightweight implementation of the Ruby
+language.  Its syntax is Ruby 1.9 compatible.  mruby can be linked and
+embedded within your application.")
+    (license license:expat)))
+
 (define-public ruby-commander
   (package
     (name "ruby-commander")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]