summary refs log tree commit diff
path: root/pkgs/development/compilers/mruby/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/mruby/default.nix')
-rw-r--r--pkgs/development/compilers/mruby/default.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/pkgs/development/compilers/mruby/default.nix b/pkgs/development/compilers/mruby/default.nix
new file mode 100644
index 00000000000..3ab553678b6
--- /dev/null
+++ b/pkgs/development/compilers/mruby/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, ruby, bison, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "mruby-${version}";
+  version = "1.4.1";
+
+  src = fetchFromGitHub {
+    owner   = "mruby";
+    repo    = "mruby";
+    rev     = version;
+    sha256  = "0pw72acbqgs4n1qa297nnja23v9hxz9g7190yfx9kwm7mgbllmww";
+  };
+
+  patches = [
+    ./0001-Disables-IO-isatty-test-for-sandboxed-builds.patch
+  ];
+
+  nativeBuildInputs = [ ruby bison ];
+
+  # Necessary so it uses `gcc` instead of `ld` for linking.
+  # https://github.com/mruby/mruby/blob/35be8b252495d92ca811d76996f03c470ee33380/tasks/toolchains/gcc.rake#L25
+  preBuild = if stdenv.isLinux then "unset LD" else null;
+
+  installPhase = ''
+    mkdir $out
+    cp -R build/host/{bin,lib} $out
+  '';
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    description = "An embeddable implementation of the Ruby language";
+    homepage = https://mruby.org;
+    maintainers = [ maintainers.nicknovitski ];
+    license = licenses.mit;
+    platforms = platforms.unix;
+  };
+}