forked from mirrors/nixpkgs
jetbrains: update script improvements
Fix some warnings and allow updating only the free modules.
This commit is contained in:
parent
d8079260a3
commit
afef449235
|
@ -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)) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 =~ /\$/;
|
||||
|
|
Loading…
Reference in a new issue