git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #44840 from nicknovitski/mruby-init

mruby: init at 1.4.1

commitcfb7ccb08c871c77aa11b3b1549f177eb7025820 authorSamuel Dionne-Riel <samuel@dionne-riel.com> dateFri 10 Aug 2018, 19:34 (8 years ago) parentf51dc2a53bfb47
3 files changed+76
pkgs/development/compilers/mruby/0001-Disables-IO-isatty-test-for-sandboxed-builds.patch+36 pkgs/development/compilers/mruby/default.nix+38 pkgs/top-level/all-packages.nix+2
pkgs/development/compilers/mruby/0001-Disables-IO-isatty-test-for-sandboxed-builds.patchnew file+36
@@ -0,0 +1,36 @@
1+From f3db284516105fd30b5513a5528104574a7b8545 Mon Sep 17 00:00:00 2001
2+From: Samuel Dionne-Riel <samuel@dionne-riel.com>
3+Date: Thu, 9 Aug 2018 19:07:45 -0400
4+Subject: [PATCH] Disables `IO#isatty` test for sandboxed builds.
5+
6+---
7+ mrbgems/mruby-io/test/io.rb | 13 -------------
8+ 1 file changed, 13 deletions(-)
9+
10+diff --git a/mrbgems/mruby-io/test/io.rb b/mrbgems/mruby-io/test/io.rb
11+index e06b1499..e8a54736 100644
12+--- a/mrbgems/mruby-io/test/io.rb
13++++ b/mrbgems/mruby-io/test/io.rb
14+@@ -342,19 +342,6 @@ assert('IO#_read_buf') do
15+ io.closed?
16+ end
17+
18+-assert('IO#isatty') do
19+- skip "isatty is not supported on this platform" if MRubyIOTestUtil.win?
20+- f1 = File.open("/dev/tty")
21+- f2 = File.open($mrbtest_io_rfname)
22+-
23+- assert_true f1.isatty
24+- assert_false f2.isatty
25+-
26+- f1.close
27+- f2.close
28+- true
29+-end
30+-
31+ assert('IO#pos=, IO#seek') do
32+ fd = IO.sysopen $mrbtest_io_rfname
33+ io = IO.new fd
34+--
35+2.16.4
36+
pkgs/development/compilers/mruby/default.nixnew file+38
@@ -0,0 +1,38 @@
1+{ stdenv, ruby, bison, fetchFromGitHub }:
2+
3+stdenv.mkDerivation rec {
4+ name = "mruby-${version}";
5+ version = "1.4.1";
6+
7+ src = fetchFromGitHub {
8+ owner = "mruby";
9+ repo = "mruby";
10+ rev = version;
11+ sha256 = "0pw72acbqgs4n1qa297nnja23v9hxz9g7190yfx9kwm7mgbllmww";
12+ };
13+
14+ patches = [
15+ ./0001-Disables-IO-isatty-test-for-sandboxed-builds.patch
16+ ];
17+
18+ nativeBuildInputs = [ ruby bison ];
19+
20+ # Necessary so it uses `gcc` instead of `ld` for linking.
21+ # https://github.com/mruby/mruby/blob/35be8b252495d92ca811d76996f03c470ee33380/tasks/toolchains/gcc.rake#L25
22+ preBuild = if stdenv.isLinux then "unset LD" else null;
23+
24+ installPhase = ''
25+ mkdir $out
26+ cp -R build/host/{bin,lib} $out
27+ '';
28+
29+ doCheck = true;
30+
31+ meta = with stdenv.lib; {
32+ description = "An embeddable implementation of the Ruby language";
33+ homepage = https://mruby.org;
34+ maintainers = [ maintainers.nicknovitski ];
35+ license = licenses.mit;
36+ platforms = platforms.unix;
37+ };
38+}
pkgs/top-level/all-packages.nix+2
@@ -7632,6 +7632,8 @@ with pkgs;
76327632
76337633 ruby = ruby_2_4;
76347634
7635+ mruby = callPackage ../development/compilers/mruby { };
7636+
76357637 scsh = callPackage ../development/interpreters/scsh { };
76367638
76377639 scheme48 = callPackage ../development/interpreters/scheme48 { };