2023-06-17 04:20:00 +00:00
|
|
|
{ lib, stdenv, ruby, rake, fetchFromGitHub }:
|
2018-08-09 20:24:56 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-05-13 02:27:38 +00:00
|
|
|
pname = "mruby";
|
2023-02-25 10:33:48 +00:00
|
|
|
version = "3.2.0";
|
2018-08-09 20:24:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mruby";
|
|
|
|
repo = "mruby";
|
|
|
|
rev = version;
|
2023-02-25 10:33:48 +00:00
|
|
|
sha256 = "sha256-MmrbWeg/G29YBvVrOtceTOZChrQ2kx9+apl7u7BiGjA=";
|
2018-08-09 20:24:56 +00:00
|
|
|
};
|
|
|
|
|
2023-06-17 04:20:00 +00:00
|
|
|
nativeBuildInputs = [ rake ];
|
|
|
|
|
|
|
|
nativeCheckInputs = [ ruby ];
|
2018-08-09 20:24:56 +00:00
|
|
|
|
2018-08-09 23:10:24 +00:00
|
|
|
# Necessary so it uses `gcc` instead of `ld` for linking.
|
2023-06-17 04:20:00 +00:00
|
|
|
# https://github.com/mruby/mruby/blob/e502fd88b988b0a8d9f31b928eb322eae269c45a/tasks/toolchains/gcc.rake#L30
|
2023-05-12 21:10:25 +00:00
|
|
|
preBuild = "unset LD";
|
2018-08-09 23:10:24 +00:00
|
|
|
|
2018-08-09 20:24:56 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
2020-09-21 04:20:00 +00:00
|
|
|
cp -R include build/host/{bin,lib} $out
|
2018-08-09 20:24:56 +00:00
|
|
|
'';
|
|
|
|
|
2018-08-09 23:12:34 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2023-06-17 04:20:00 +00:00
|
|
|
checkTarget = "test";
|
2023-02-25 10:33:48 +00:00
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2018-08-09 20:24:56 +00:00
|
|
|
description = "An embeddable implementation of the Ruby language";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://mruby.org";
|
2023-06-17 04:20:00 +00:00
|
|
|
maintainers = with maintainers; [ nicknovitski marsam ];
|
2018-08-09 20:24:56 +00:00
|
|
|
license = licenses.mit;
|
2023-06-17 04:20:00 +00:00
|
|
|
platforms = platforms.all;
|
2018-08-09 20:24:56 +00:00
|
|
|
};
|
|
|
|
}
|