Merge pull request #44840 from nicknovitski/mruby-init

mruby: init at 1.4.1

authored by Samuel Dionne-Riel and committed by GitHub cfb7ccb0 f51dc2a9

+76
+36
pkgs/development/compilers/mruby/0001-Disables-IO-isatty-test-for-sandboxed-builds.patch
··· 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 +
+38
pkgs/development/compilers/mruby/default.nix
··· 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 + }
+2
pkgs/top-level/all-packages.nix
··· 7632 7632 7633 7633 ruby = ruby_2_4; 7634 7634 7635 + mruby = callPackage ../development/compilers/mruby { }; 7636 + 7635 7637 scsh = callPackage ../development/interpreters/scsh { }; 7636 7638 7637 7639 scheme48 = callPackage ../development/interpreters/scheme48 { };