2020-06-26 11:48:35 +02:00
|
|
|
{ stdenv, ruby, bison, rake, fetchFromGitHub }:
|
2018-08-09 22:24:56 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-05-13 04:27:38 +02:00
|
|
|
pname = "mruby";
|
2020-09-21 06:20:00 +02:00
|
|
|
version = "2.1.2";
|
2018-08-09 22:24:56 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mruby";
|
|
|
|
repo = "mruby";
|
|
|
|
rev = version;
|
2020-09-21 06:20:00 +02:00
|
|
|
sha256 = "0fhfv8pi7i8jn2vgk2n2rjnbnfa12nhj514v8i4k353n7q4pmkh3";
|
2018-08-09 22:24:56 +02:00
|
|
|
};
|
|
|
|
|
2020-06-26 11:48:35 +02:00
|
|
|
nativeBuildInputs = [ ruby bison rake ];
|
2018-08-09 22:24:56 +02:00
|
|
|
|
2018-08-10 01:10:24 +02: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 22:24:56 +02:00
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
2020-09-21 06:20:00 +02:00
|
|
|
cp -R include build/host/{bin,lib} $out
|
2018-08-09 22:24:56 +02:00
|
|
|
'';
|
|
|
|
|
2018-08-10 01:12:34 +02:00
|
|
|
doCheck = true;
|
|
|
|
|
2018-08-09 22:24:56 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "An embeddable implementation of the Ruby language";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://mruby.org";
|
2018-08-09 22:24:56 +02:00
|
|
|
maintainers = [ maintainers.nicknovitski ];
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|