From 151c175a8528864be449ba30df62ef4c2c93a25d Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Thu, 20 Jul 2023 14:54:24 +0100 Subject: [PATCH] jetbrains.goland: fix build with plugins --- pkgs/applications/editors/jetbrains/default.nix | 7 ++++--- pkgs/applications/editors/jetbrains/plugins/default.nix | 7 +------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix index 28346d4fbc5b..71bf0eaeb5a5 100644 --- a/pkgs/applications/editors/jetbrains/default.nix +++ b/pkgs/applications/editors/jetbrains/default.nix @@ -132,6 +132,10 @@ let (mkJetBrainsProduct { inherit pname version src wmClass jdk buildNumber; product = "Goland"; + extraWrapperArgs = [ + # fortify source breaks build since delve compiles with -O0 + ''--prefix CGO_CPPFLAGS " " "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0"'' + ]; meta = with lib; { homepage = "https://www.jetbrains.com/go/"; inherit description license platforms; @@ -148,9 +152,6 @@ let interp="$(cat $NIX_CC/nix-support/dynamic-linker)" patchelf --set-interpreter $interp $out/goland/plugins/go-plugin/lib/dlv/linux/dlv chmod +x $out/goland/plugins/go-plugin/lib/dlv/linux/dlv - # fortify source breaks build since delve compiles with -O0 - wrapProgram $out/bin/goland \ - --prefix CGO_CPPFLAGS " " "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" ''; }); diff --git a/pkgs/applications/editors/jetbrains/plugins/default.nix b/pkgs/applications/editors/jetbrains/plugins/default.nix index ac6992f801bb..bf160e2aa365 100644 --- a/pkgs/applications/editors/jetbrains/plugins/default.nix +++ b/pkgs/applications/editors/jetbrains/plugins/default.nix @@ -100,11 +100,6 @@ rec { let pluginCmdsLines = map (plugin: "ln -s ${plugin} \"$out\"/${meta.mainProgram}/plugins/${baseNameOf plugin}") plugins; pluginCmds = builtins.concatStringsSep "\n" pluginCmdsLines; - extraBuildPhase = rec { - goland = '' - sed "s|${ide}|$out|" -i $out/bin/.goland-wrapped - ''; - }; in '' cp -r ${ide} $out @@ -118,6 +113,6 @@ rec { -i $(realpath $out/bin/${meta.mainProgram}) \ -i $(realpath $out/bin/${meta.mainProgram}-remote-dev-server) autoPatchelf $out/${meta.mainProgram}/bin - '' + (extraBuildPhase."${ide.meta.mainProgram}" or ""); + ''; }; }