2022-04-27 09:35:20 +00:00
|
|
|
{ lib, stdenv, ruby, bison, rake, fetchFromGitHub, fetchpatch }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mruby";
|
2021-03-12 07:09:13 +00:00
|
|
|
version = "3.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mruby";
|
|
|
|
repo = "mruby";
|
|
|
|
rev = version;
|
2021-03-12 07:09:13 +00:00
|
|
|
sha256 = "sha256-C3K7ZooaOMa+V2HjxwiKxrrMb7ffl4QAgPsftRtb60c=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2022-1212.patch";
|
|
|
|
url = "https://github.com/mruby/mruby/commit/3cf291f72224715942beaf8553e42ba8891ab3c6.patch";
|
|
|
|
sha256 = "1bl8wm6v7v18zgxqvm4kbn8g97a75phzrdah279xqw1qvplbd2w7";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
nativeBuildInputs = [ ruby bison rake ];
|
|
|
|
|
2020-04-24 23:36:52 +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;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
2020-09-25 04:45:31 +00:00
|
|
|
cp -R include build/host/{bin,lib} $out
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An embeddable implementation of the Ruby language";
|
|
|
|
homepage = "https://mruby.org";
|
|
|
|
maintainers = [ maintainers.nicknovitski ];
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|