2024-02-29 20:09:43 +00:00
|
|
|
{ lib, stdenv, ruby, rake, fetchFromGitHub, testers }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "mruby";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "3.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mruby";
|
|
|
|
repo = "mruby";
|
2024-02-29 20:09:43 +00:00
|
|
|
rev = finalAttrs.version;
|
|
|
|
sha256 = "sha256-rCoEC1ioX6bOocPoPi+Lsn4PM8gY0DjKja1/MJvJ1n8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [ rake ];
|
|
|
|
|
|
|
|
nativeCheckInputs = [ ruby ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Necessary so it uses `gcc` instead of `ld` for linking.
|
2023-07-15 17:15:38 +00:00
|
|
|
# https://github.com/mruby/mruby/blob/e502fd88b988b0a8d9f31b928eb322eae269c45a/tasks/toolchains/gcc.rake#L30
|
2023-05-24 13:37:59 +00:00
|
|
|
preBuild = "unset LD";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
checkTarget = "test";
|
2023-03-04 12:14:45 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
passthru.tests = {
|
|
|
|
version = testers.testVersion {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Embeddable implementation of the Ruby language";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://mruby.org";
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ nicknovitski ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2023-07-15 17:15:38 +00:00
|
|
|
platforms = platforms.all;
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "mruby";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-02-29 20:09:43 +00:00
|
|
|
})
|