From f3b51bfafd2a7d7f07ab5023f4022c165e0eca8b Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Thu, 31 Dec 2020 20:47:42 -0500 Subject: [PATCH] mruby-builder: Manage `-g` flag for mrbc --- overlay/mruby-builder/mruby/default.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/overlay/mruby-builder/mruby/default.nix b/overlay/mruby-builder/mruby/default.nix index e61219b8..62c2cf40 100644 --- a/overlay/mruby-builder/mruby/default.nix +++ b/overlay/mruby-builder/mruby/default.nix @@ -17,6 +17,7 @@ in , fetchFromGitHub , file , mruby +, runtimeShell , writeText , writeShellScriptBin @@ -31,6 +32,8 @@ in , additionalBuildConfig ? "" # Adds `enable_debug`. , debug ? false +# Adds `-g` to mrbc wrapper. +, mrbWithDebug ? true # Prepends defaults to `gems` and `gemBoxes`. , useDefaults ? true }: @@ -210,6 +213,20 @@ stdenv.mkDerivation rec { cp mruby_linker_flags.sh $out/nix-support/ ''; + # Wrap `mrbc` with -g conditional to the debug flag. + postInstall = '' + mkdir -p $out/libexec/ + mv $out/bin/mrbc $out/libexec/mrbc + cat > $out/bin/mrbc <