2018-08-09 20:24:56 +00:00
|
|
|
{ stdenv, ruby, bison, fetchFromGitHub }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-05-13 02:27:38 +00:00
|
|
|
pname = "mruby";
|
2019-11-28 11:35:52 +00:00
|
|
|
version = "2.1.0";
|
2018-08-09 20:24:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mruby";
|
|
|
|
repo = "mruby";
|
|
|
|
rev = version;
|
2019-11-28 11:35:52 +00:00
|
|
|
sha256 = "1y072c7dh9jf8xwy7kia6cb4dkpspq4zf24ssn7zm5f46p4waxni";
|
2018-08-09 20:24:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ ruby bison ];
|
|
|
|
|
2018-08-09 23:10:24 +00: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 20:24:56 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
cp -R build/host/{bin,lib} $out
|
|
|
|
'';
|
|
|
|
|
2018-08-09 23:12:34 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2018-08-09 20:24:56 +00: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;
|
|
|
|
};
|
|
|
|
}
|