diff --git a/pkgs/applications/editors/jetbrains/common.nix b/pkgs/applications/editors/jetbrains/common.nix index dcbaa136795a..2e244364dc7e 100644 --- a/pkgs/applications/editors/jetbrains/common.nix +++ b/pkgs/applications/editors/jetbrains/common.nix @@ -38,7 +38,7 @@ with stdenv; lib.makeOverridable mkDerivation rec { nativeBuildInputs = [ makeWrapper patchelf unzip ]; - patchPhase = lib.optionalString (!stdenv.isDarwin) '' + postPatch = lib.optionalString (!stdenv.isDarwin) '' get_file_size() { local fname="$1" echo $(ls -l $fname | cut -d ' ' -f5) @@ -64,6 +64,8 @@ with stdenv; lib.makeOverridable mkDerivation rec { ''; installPhase = '' + runHook preInstall + mkdir -p $out/{bin,$name,share/pixmaps,libexec/${name}} cp -a . $out/$name ln -s $out/$name/bin/${loName}.png $out/share/pixmaps/${mainProgram}.png @@ -86,6 +88,8 @@ with stdenv; lib.makeOverridable mkDerivation rec { --set ${hiName}_VM_OPTIONS ${vmoptsFile} ln -s "$item/share/applications" $out/share + + runHook postInstall ''; } // lib.optionalAttrs (!(meta.license.free or true)) { diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix index b962ab6e22be..4370e9af3eba 100644 --- a/pkgs/applications/editors/jetbrains/default.nix +++ b/pkgs/applications/editors/jetbrains/default.nix @@ -193,7 +193,7 @@ let platforms = platforms.linux; }; }).overrideAttrs (attrs: { - patchPhase = lib.optionalString (!stdenv.isDarwin) (attrs.patchPhase + '' + postPatch = lib.optionalString (!stdenv.isDarwin) (attrs.postPatch + '' rm -rf lib/ReSharperHost/linux-x64/dotnet mkdir -p lib/ReSharperHost/linux-x64/dotnet/ ln -s ${dotnet-sdk_5}/bin/dotnet lib/ReSharperHost/linux-x64/dotnet/dotnet @@ -229,7 +229,7 @@ let platforms = platforms.linux; }; }).overrideAttrs (attrs: { - patchPhase = (attrs.patchPhase or "") + optionalString (stdenv.isLinux) '' + postPatch = (attrs.postPatch or "") + optionalString (stdenv.isLinux) '' # Webstorm tries to use bundled jre if available. # Lets prevent this for the moment rm -r jbr diff --git a/pkgs/applications/editors/jetbrains/update.pl b/pkgs/applications/editors/jetbrains/update.pl index abb4e5f72236..7656581a8b4f 100755 --- a/pkgs/applications/editors/jetbrains/update.pl +++ b/pkgs/applications/editors/jetbrains/update.pl @@ -6,6 +6,8 @@ use List::Util qw(reduce); use File::Slurp; use LWP::Simple; +my $only_free = grep { $_ eq "--only-free" } @ARGV; + sub semantic_less { my ($a, $b) = @_; $a =~ s/\b(\d+)\b/sprintf("%010s", $1)/eg; @@ -55,13 +57,15 @@ sub update_nix_block { die "no version in $block" unless $version; if ($version eq $latest_versions{$channel}) { print("$channel is up to date at $version\n"); + } elsif ($only_free && $block =~ /licenses\.unfree/) { + print("$channel is unfree, skipping\n"); } else { print("updating $channel: $version -> $latest_versions{$channel}\n"); my ($url) = $block =~ /url\s*=\s*"([^"]+)"/; # try to interpret some nix my ($name) = $block =~ /name\s*=\s*"([^"]+)"/; $name =~ s/\$\{version\}/$latest_versions{$channel}/; - # Some url paattern contain variables more than once + # Some url pattern contain variables more than once $url =~ s/\$\{name\}/$name/g; $url =~ s/\$\{version\}/$latest_versions{$channel}/g; die "$url still has some interpolation" if $url =~ /\$/;