diff options
author | Robert Helgesson <robert@rycee.net> | 2016-01-06 22:00:53 +0100 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2016-01-22 09:36:08 +0100 |
commit | 40890b2b95b4bce62e1296855046d6cacbd440a2 (patch) | |
tree | 6eb09151a1b26d852b8a503c967fc395e6bfd785 /pkgs/applications/editors/eclipse | |
parent | bf605c16bf0e96df9e75f23963ae1a15f19cd40b (diff) | |
download | nixlib-40890b2b95b4bce62e1296855046d6cacbd440a2.tar nixlib-40890b2b95b4bce62e1296855046d6cacbd440a2.tar.gz nixlib-40890b2b95b4bce62e1296855046d6cacbd440a2.tar.bz2 nixlib-40890b2b95b4bce62e1296855046d6cacbd440a2.tar.lz nixlib-40890b2b95b4bce62e1296855046d6cacbd440a2.tar.xz nixlib-40890b2b95b4bce62e1296855046d6cacbd440a2.tar.zst nixlib-40890b2b95b4bce62e1296855046d6cacbd440a2.zip |
eclipseWithPlugins: lazier evaluation
Unfortunately the `readFile`/`writeText` functions forces realisation of the eclipse package at evaluation time. By creating the configuration file inside the build command we avoid realisation until installation.
Diffstat (limited to 'pkgs/applications/editors/eclipse')
-rw-r--r-- | pkgs/applications/editors/eclipse/default.nix | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix index 3fed254d6e92..42cb0fa8914a 100644 --- a/pkgs/applications/editors/eclipse/default.nix +++ b/pkgs/applications/editors/eclipse/default.nix @@ -327,21 +327,20 @@ rec { dropinProp = "-D${dropinPropName}=${pluginEnv}/eclipse/dropins"; jvmArgsText = stdenv.lib.concatStringsSep "\n" (jvmArgs ++ [dropinProp]); - # Prepare an eclipse.ini with the plugin directory. - origEclipseIni = builtins.readFile "${eclipse}/eclipse/eclipse.ini"; - eclipseIniFile = writeText "eclipse.ini" '' - ${origEclipseIni} - ${jvmArgsText} - ''; - # Base the derivation name on the name of the underlying # Eclipse. name = (stdenv.lib.meta.appendToName "with-plugins" eclipse).name; in runCommand name { buildInputs = [ makeWrapper ]; } '' - mkdir -p $out/bin + mkdir -p $out/bin $out/etc + + # Prepare an eclipse.ini with the plugin directory. + cat ${eclipse}/eclipse/eclipse.ini - > $out/etc/eclipse.ini <<EOF + ${jvmArgsText} + EOF + makeWrapper ${eclipse}/bin/eclipse $out/bin/eclipse \ - --add-flags "--launcher.ini ${eclipseIniFile}" + --add-flags "--launcher.ini $out/etc/eclipse.ini" ln -s ${eclipse}/share $out/ ''; |