2022-08-21 13:32:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-01-09 10:05:03 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, bison
|
2022-08-21 13:32:41 +00:00
|
|
|
, pkg-config
|
2021-01-09 10:05:03 +00:00
|
|
|
, rake
|
|
|
|
, ruby
|
|
|
|
, libGL
|
|
|
|
, libuv
|
|
|
|
, libX11
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mruby-zest";
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "3.0.6";
|
2021-01-09 10:05:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = "${pname}-build";
|
2022-08-21 13:32:41 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2021-01-09 10:05:03 +00:00
|
|
|
fetchSubmodules = true;
|
2022-08-21 13:32:41 +00:00
|
|
|
sha256 = "sha256-rIb6tQimwrUj+623IU5zDyKNWsNYYBElLQClOsP+5Dc=";
|
2021-01-09 10:05:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2022-08-21 13:32:41 +00:00
|
|
|
./force-cxx-as-linker.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
bison
|
|
|
|
pkg-config
|
|
|
|
rake
|
|
|
|
ruby
|
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
buildInputs = [
|
|
|
|
libGL
|
|
|
|
libuv
|
|
|
|
libX11
|
2021-01-09 10:05:03 +00:00
|
|
|
];
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
# Force optimization to fix:
|
|
|
|
# warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O)
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-O3";
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
# Remove pre-built y.tab.c to generate with nixpkgs bison
|
|
|
|
preBuild = ''
|
|
|
|
rm mruby/mrbgems/mruby-compiler/core/y.tab.c
|
2021-01-09 10:05:03 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installTargets = [ "pack" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
ln -s "$out/zest" "$out/zyn-fusion"
|
|
|
|
cp -a package/{font,libzest.so,schema,zest} "$out"
|
|
|
|
|
|
|
|
# mruby-widget-lib/src/api.c requires MainWindow.qml as part of a
|
|
|
|
# sanity check, even though qml files are compiled into the binary
|
2022-08-21 13:32:41 +00:00
|
|
|
# https://github.com/mruby-zest/mruby-zest-build/blob/3.0.6/src/mruby-widget-lib/src/api.c#L107-L124
|
|
|
|
# https://github.com/mruby-zest/mruby-zest-build/blob/3.0.6/linux-pack.sh#L17-L18
|
2021-01-09 10:05:03 +00:00
|
|
|
mkdir -p "$out/qml"
|
|
|
|
touch "$out/qml/MainWindow.qml"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Zest Framework used in ZynAddSubFX's UI";
|
2021-01-09 10:05:03 +00:00
|
|
|
homepage = "https://github.com/mruby-zest";
|
2022-08-21 13:32:41 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2021-05-28 09:39:13 +00:00
|
|
|
maintainers = with maintainers; [ kira-bruneau ];
|
2021-01-09 10:05:03 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|