jetbrains.goland: fix build with plugins

This commit is contained in:
GenericNerdyUsername 2023-07-20 14:54:24 +01:00
parent abd6d82002
commit 151c175a85
No known key found for this signature in database
GPG key ID: 65BA194581245B15
2 changed files with 5 additions and 9 deletions

View file

@ -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"
'';
});

View file

@ -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 "");
'';
};
}