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