1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-17 13:10:29 +03:00
mobile-nixos/examples/hello/app/default.nix

43 lines
692 B
Nix
Raw Normal View History

{ stdenv
, lib
, mruby
}:
2021-01-02 02:45:45 +03:00
let
inherit (lib) concatMapStringsSep;
# Select libs we need from the libs folder.
libs = concatMapStringsSep " " (name: "${../../../boot/lib}/${name}") [
"lvgui/args.rb"
"lvgui/fiddlier.rb"
"lvgui/lvgl/*.rb"
"lvgui/lvgui/*.rb"
"lvgui/vtconsole.rb"
];
in
stdenv.mkDerivation {
name = "hello-gui.mrb";
src = lib.cleanSource ./.;
nativeBuildInputs = [
mruby
];
buildPhase = ''
mrbc \
-o app.mrb \
2021-01-02 02:45:45 +03:00
${libs} \
$(find ./windows -type f -name '*.rb' | sort) \
main.rb
'';
installPhase = ''
mkdir -p $out/libexec/
mv -v app.mrb $out/libexec/
mkdir -p $out/share/hello-gui
'';
}