2018-08-09 21:24:56 +01:00
|
|
|
{ stdenv, ruby, bison, fetchFromGitHub }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "mruby-${version}";
|
2018-12-15 12:30:35 +00:00
|
|
|
version = "2.0.0";
|
2018-08-09 21:24:56 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mruby";
|
|
|
|
repo = "mruby";
|
|
|
|
rev = version;
|
2018-12-15 12:30:35 +00:00
|
|
|
sha256 = "1r6w1asjshff43ymdwa6xmrkggza99mi2kw88k7ic6ag2j81hcj5";
|
2018-08-09 21:24:56 +01:00
|
|
|
};
|
|
|
|
|
2018-08-10 00:12:34 +01:00
|
|
|
patches = [
|
|
|
|
./0001-Disables-IO-isatty-test-for-sandboxed-builds.patch
|
|
|
|
];
|
|
|
|
|
2018-08-09 21:24:56 +01:00
|
|
|
nativeBuildInputs = [ ruby bison ];
|
|
|
|
|
2018-08-10 00:10:24 +01:00
|
|
|
# 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;
|
|
|
|
|
2018-08-09 21:24:56 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
cp -R build/host/{bin,lib} $out
|
|
|
|
'';
|
|
|
|
|
2018-08-10 00:12:34 +01:00
|
|
|
doCheck = true;
|
|
|
|
|
2018-08-09 21:24:56 +01:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|