uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
36
pkgs/applications/editors/jetbrains/darwin.nix
Normal file
36
pkgs/applications/editors/jetbrains/darwin.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ lib
|
||||
, stdenvNoCC
|
||||
, undmg
|
||||
, ...
|
||||
}:
|
||||
|
||||
{ meta
|
||||
, pname
|
||||
, product
|
||||
, productShort ? product
|
||||
, src
|
||||
, version
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
loname = lib.toLower productShort;
|
||||
in
|
||||
stdenvNoCC.mkDerivation {
|
||||
inherit pname meta src version;
|
||||
desktopName = product;
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
APP_DIR="$out/Applications/${product}.app"
|
||||
mkdir -p "$APP_DIR"
|
||||
cp -Tr "${product}.app" "$APP_DIR"
|
||||
mkdir -p "$out/bin"
|
||||
cat << EOF > "$out/bin/${loname}"
|
||||
open -na '$APP_DIR' --args "\$@"
|
||||
EOF
|
||||
chmod +x "$out/bin/${loname}"
|
||||
runHook postInstall
|
||||
'';
|
||||
nativeBuildInputs = [ undmg ];
|
||||
sourceRoot = ".";
|
||||
}
|
||||
419
pkgs/applications/editors/jetbrains/default.nix
Normal file
419
pkgs/applications/editors/jetbrains/default.nix
Normal file
|
|
@ -0,0 +1,419 @@
|
|||
{ lib, stdenv, callPackage, fetchurl
|
||||
, jdk, cmake, gdb, zlib, python3
|
||||
, dotnet-sdk_6
|
||||
, maven
|
||||
, autoPatchelfHook
|
||||
, libdbusmenu
|
||||
, vmopts ? null
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
platforms = lib.platforms.linux ++ [ "x86_64-darwin" "aarch64-darwin" ];
|
||||
ideaPlatforms = [ "x86_64-darwin" "i686-darwin" "i686-linux" "x86_64-linux" "aarch64-darwin" ];
|
||||
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
|
||||
versions = builtins.fromJSON (readFile (./versions.json));
|
||||
versionKey = if stdenv.isLinux then "linux" else system;
|
||||
products = versions.${versionKey} or (throw "Unsupported system: ${system}");
|
||||
|
||||
package = if stdenv.isDarwin then ./darwin.nix else ./linux.nix;
|
||||
mkJetBrainsProduct = callPackage package { inherit vmopts; };
|
||||
|
||||
# Sorted alphabetically
|
||||
|
||||
buildClion = { pname, version, src, license, description, wmClass, ... }:
|
||||
(mkJetBrainsProduct {
|
||||
inherit pname version src wmClass jdk;
|
||||
product = "CLion";
|
||||
meta = with lib; {
|
||||
homepage = "https://www.jetbrains.com/clion/";
|
||||
inherit description license platforms;
|
||||
longDescription = ''
|
||||
Enhancing productivity for every C and C++
|
||||
developer on Linux, macOS and Windows.
|
||||
'';
|
||||
maintainers = with maintainers; [ edwtjo mic92 ];
|
||||
};
|
||||
}).overrideAttrs (attrs: {
|
||||
nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ optionals (stdenv.isLinux) [
|
||||
autoPatchelfHook
|
||||
];
|
||||
buildInputs = (attrs.buildInputs or []) ++ optionals (stdenv.isLinux) [
|
||||
python3
|
||||
stdenv.cc.cc
|
||||
libdbusmenu
|
||||
];
|
||||
dontAutoPatchelf = true;
|
||||
postFixup = (attrs.postFixup or "") + optionalString (stdenv.isLinux) ''
|
||||
(
|
||||
cd $out/clion
|
||||
# bundled cmake does not find libc
|
||||
rm -rf bin/cmake/linux
|
||||
ln -s ${cmake} bin/cmake/linux
|
||||
# bundled gdb does not find libcrypto 10
|
||||
rm -rf bin/gdb/linux
|
||||
ln -s ${gdb} bin/gdb/linux
|
||||
|
||||
autoPatchelf $PWD/bin
|
||||
|
||||
wrapProgram $out/bin/clion \
|
||||
--set CL_JDK "${jdk}"
|
||||
)
|
||||
'';
|
||||
});
|
||||
|
||||
buildDataGrip = { pname, version, src, license, description, wmClass, ... }:
|
||||
(mkJetBrainsProduct {
|
||||
inherit pname version src wmClass jdk;
|
||||
product = "DataGrip";
|
||||
meta = with lib; {
|
||||
homepage = "https://www.jetbrains.com/datagrip/";
|
||||
inherit description license platforms;
|
||||
longDescription = ''
|
||||
DataGrip is a new IDE from JetBrains built for database admins.
|
||||
It allows you to quickly migrate and refactor relational databases,
|
||||
construct efficient, statically checked SQL queries and much more.
|
||||
'';
|
||||
maintainers = with maintainers; [ ];
|
||||
};
|
||||
});
|
||||
|
||||
buildGoland = { pname, version, src, license, description, wmClass, ... }:
|
||||
(mkJetBrainsProduct {
|
||||
inherit pname version src wmClass jdk;
|
||||
product = "Goland";
|
||||
meta = with lib; {
|
||||
homepage = "https://www.jetbrains.com/go/";
|
||||
inherit description license platforms;
|
||||
longDescription = ''
|
||||
Goland is the codename for a new commercial IDE by JetBrains
|
||||
aimed at providing an ergonomic environment for Go development.
|
||||
The new IDE extends the IntelliJ platform with the coding assistance
|
||||
and tool integrations specific for the Go language
|
||||
'';
|
||||
maintainers = [ maintainers.miltador ];
|
||||
};
|
||||
}).overrideAttrs (attrs: {
|
||||
postFixup = (attrs.postFixup or "") + lib.optionalString stdenv.isLinux ''
|
||||
interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
|
||||
patchelf --set-interpreter $interp $out/goland*/plugins/go/lib/dlv/linux/dlv
|
||||
|
||||
chmod +x $out/goland*/plugins/go/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"
|
||||
'';
|
||||
});
|
||||
|
||||
buildIdea = { pname, version, src, license, description, wmClass, product, ... }:
|
||||
(mkJetBrainsProduct {
|
||||
inherit pname version src wmClass jdk product;
|
||||
productShort = "IDEA";
|
||||
extraLdPath = [ zlib ];
|
||||
extraWrapperArgs = [
|
||||
''--set M2_HOME "${maven}/maven"''
|
||||
''--set M2 "${maven}/maven/bin"''
|
||||
];
|
||||
meta = with lib; {
|
||||
homepage = "https://www.jetbrains.com/idea/";
|
||||
inherit description license;
|
||||
longDescription = ''
|
||||
IDE for Java SE, Groovy & Scala development Powerful
|
||||
environment for building Google Android apps Integration
|
||||
with JUnit, TestNG, popular SCMs, Ant & Maven. Also known
|
||||
as IntelliJ.
|
||||
'';
|
||||
maintainers = with maintainers; [ edwtjo gytis-ivaskevicius steinybot AnatolyPopov ];
|
||||
platforms = ideaPlatforms;
|
||||
};
|
||||
});
|
||||
|
||||
buildMps = { pname, version, src, license, description, wmClass, product, ... }:
|
||||
(mkJetBrainsProduct rec {
|
||||
inherit pname version src wmClass jdk product;
|
||||
productShort = "MPS";
|
||||
meta = with lib; {
|
||||
broken = (stdenv.isLinux && stdenv.isAarch64);
|
||||
homepage = "https://www.jetbrains.com/mps/";
|
||||
inherit license description platforms;
|
||||
longDescription = ''
|
||||
A metaprogramming system which uses projectional editing
|
||||
which allows users to overcome the limits of language
|
||||
parsers, and build DSL editors, such as ones with tables and
|
||||
diagrams.
|
||||
'';
|
||||
maintainers = with maintainers; [ rasendubi ];
|
||||
};
|
||||
});
|
||||
|
||||
buildPhpStorm = { pname, version, src, license, description, wmClass, ... }:
|
||||
(mkJetBrainsProduct {
|
||||
inherit pname version src wmClass jdk;
|
||||
product = "PhpStorm";
|
||||
meta = with lib; {
|
||||
homepage = "https://www.jetbrains.com/phpstorm/";
|
||||
inherit description license platforms;
|
||||
longDescription = ''
|
||||
PhpStorm provides an editor for PHP, HTML and JavaScript
|
||||
with on-the-fly code analysis, error prevention and
|
||||
automated refactorings for PHP and JavaScript code.
|
||||
'';
|
||||
maintainers = with maintainers; [ schristo ma27 ];
|
||||
};
|
||||
});
|
||||
|
||||
buildPycharm = { pname, version, src, license, description, wmClass, product, ... }:
|
||||
(mkJetBrainsProduct {
|
||||
inherit pname version src wmClass jdk product;
|
||||
productShort = "PyCharm";
|
||||
meta = with lib; {
|
||||
broken = (stdenv.isLinux && stdenv.isAarch64);
|
||||
homepage = "https://www.jetbrains.com/pycharm/";
|
||||
inherit description license platforms;
|
||||
longDescription = ''
|
||||
Python IDE with complete set of tools for productive
|
||||
development with Python programming language. In addition, the
|
||||
IDE provides high-class capabilities for professional Web
|
||||
development with Django framework and Google App Engine. It
|
||||
has powerful coding assistance, navigation, a lot of
|
||||
refactoring features, tight integration with various Version
|
||||
Control Systems, Unit testing, powerful all-singing
|
||||
all-dancing Debugger and entire customization. PyCharm is
|
||||
developer driven IDE. It was developed with the aim of
|
||||
providing you almost everything you need for your comfortable
|
||||
and productive development!
|
||||
'';
|
||||
maintainers = with maintainers; [ ];
|
||||
};
|
||||
});
|
||||
|
||||
buildRider = { pname, version, src, license, description, wmClass, ... }:
|
||||
(mkJetBrainsProduct {
|
||||
inherit pname version src wmClass jdk;
|
||||
product = "Rider";
|
||||
meta = with lib; {
|
||||
homepage = "https://www.jetbrains.com/rider/";
|
||||
inherit description license platforms;
|
||||
longDescription = ''
|
||||
JetBrains Rider is a new .NET IDE based on the IntelliJ
|
||||
platform and ReSharper. Rider supports .NET Core,
|
||||
.NET Framework and Mono based projects. This lets you
|
||||
develop a wide array of applications including .NET desktop
|
||||
apps, services and libraries, Unity games, ASP.NET and
|
||||
ASP.NET Core web applications.
|
||||
'';
|
||||
maintainers = [ maintainers.miltador ];
|
||||
};
|
||||
}).overrideAttrs (attrs: {
|
||||
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_6}/bin/dotnet lib/ReSharperHost/linux-x64/dotnet/dotnet
|
||||
'');
|
||||
});
|
||||
|
||||
buildRubyMine = { pname, version, src, license, description, wmClass, ... }:
|
||||
(mkJetBrainsProduct {
|
||||
inherit pname version src wmClass jdk;
|
||||
product = "RubyMine";
|
||||
meta = with lib; {
|
||||
homepage = "https://www.jetbrains.com/ruby/";
|
||||
inherit description license platforms;
|
||||
longDescription = description;
|
||||
maintainers = with maintainers; [ edwtjo ];
|
||||
};
|
||||
});
|
||||
|
||||
buildWebStorm = { pname, version, src, license, description, wmClass, ... }:
|
||||
(mkJetBrainsProduct {
|
||||
inherit pname version src wmClass jdk;
|
||||
product = "WebStorm";
|
||||
meta = with lib; {
|
||||
homepage = "https://www.jetbrains.com/webstorm/";
|
||||
inherit description license platforms;
|
||||
longDescription = ''
|
||||
WebStorm provides an editor for HTML, JavaScript (incl. Node.js),
|
||||
and CSS with on-the-fly code analysis, error prevention and
|
||||
automated refactorings for JavaScript code.
|
||||
'';
|
||||
maintainers = with maintainers; [ abaldeau ];
|
||||
};
|
||||
}).overrideAttrs (attrs: {
|
||||
postPatch = (attrs.postPatch or "") + optionalString (stdenv.isLinux) ''
|
||||
# Webstorm tries to use bundled jre if available.
|
||||
# Lets prevent this for the moment
|
||||
rm -r jbr
|
||||
'';
|
||||
});
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
# Sorted alphabetically
|
||||
|
||||
clion = buildClion rec {
|
||||
pname = "clion";
|
||||
version = products.clion.version;
|
||||
description = "C/C++ IDE. New. Intelligent. Cross-platform";
|
||||
license = lib.licenses.unfree;
|
||||
src = fetchurl {
|
||||
url = products.clion.url;
|
||||
sha256 = products.clion.sha256;
|
||||
};
|
||||
wmClass = "jetbrains-clion";
|
||||
update-channel = products.clion.update-channel;
|
||||
};
|
||||
|
||||
datagrip = buildDataGrip rec {
|
||||
pname = "datagrip";
|
||||
version = products.datagrip.version;
|
||||
description = "Your Swiss Army Knife for Databases and SQL";
|
||||
license = lib.licenses.unfree;
|
||||
src = fetchurl {
|
||||
url = products.datagrip.url;
|
||||
sha256 = products.datagrip.sha256;
|
||||
};
|
||||
wmClass = "jetbrains-datagrip";
|
||||
update-channel = products.datagrip.update-channel;
|
||||
};
|
||||
|
||||
goland = buildGoland rec {
|
||||
pname = "goland";
|
||||
version = products.goland.version;
|
||||
description = "Up and Coming Go IDE";
|
||||
license = lib.licenses.unfree;
|
||||
src = fetchurl {
|
||||
url = products.goland.url;
|
||||
sha256 = products.goland.sha256;
|
||||
};
|
||||
wmClass = "jetbrains-goland";
|
||||
update-channel = products.goland.update-channel;
|
||||
};
|
||||
|
||||
idea-community = buildIdea rec {
|
||||
pname = "idea-community";
|
||||
product = "IntelliJ IDEA CE";
|
||||
version = products.idea-community.version;
|
||||
description = "Integrated Development Environment (IDE) by Jetbrains, community edition";
|
||||
license = lib.licenses.asl20;
|
||||
src = fetchurl {
|
||||
url = products.idea-community.url;
|
||||
sha256 = products.idea-community.sha256;
|
||||
};
|
||||
wmClass = "jetbrains-idea-ce";
|
||||
update-channel = products.idea-community.update-channel;
|
||||
};
|
||||
|
||||
idea-ultimate = buildIdea rec {
|
||||
pname = "idea-ultimate";
|
||||
product = "IntelliJ IDEA";
|
||||
version = products.idea-ultimate.version;
|
||||
description = "Integrated Development Environment (IDE) by Jetbrains, requires paid license";
|
||||
license = lib.licenses.unfree;
|
||||
src = fetchurl {
|
||||
url = products.idea-ultimate.url;
|
||||
sha256 = products.idea-ultimate.sha256;
|
||||
};
|
||||
wmClass = "jetbrains-idea";
|
||||
update-channel = products.idea-ultimate.update-channel;
|
||||
};
|
||||
|
||||
mps = buildMps rec {
|
||||
pname = "mps";
|
||||
product = "MPS ${products.mps.version}";
|
||||
version = products.mps.version;
|
||||
description = "Create your own domain-specific language";
|
||||
license = lib.licenses.asl20;
|
||||
src = fetchurl {
|
||||
url = products.mps.url;
|
||||
sha256 = products.mps.sha256;
|
||||
};
|
||||
wmClass = "jetbrains-mps";
|
||||
update-channel = products.mps.update-channel;
|
||||
};
|
||||
|
||||
phpstorm = buildPhpStorm rec {
|
||||
pname = "phpstorm";
|
||||
version = products.phpstorm.version;
|
||||
description = "Professional IDE for Web and PHP developers";
|
||||
license = lib.licenses.unfree;
|
||||
src = fetchurl {
|
||||
url = products.phpstorm.url;
|
||||
sha256 = products.phpstorm.sha256;
|
||||
};
|
||||
wmClass = "jetbrains-phpstorm";
|
||||
update-channel = products.phpstorm.update-channel;
|
||||
};
|
||||
|
||||
pycharm-community = buildPycharm rec {
|
||||
pname = "pycharm-community";
|
||||
product = "PyCharm CE";
|
||||
version = products.pycharm-community.version;
|
||||
description = "PyCharm Community Edition";
|
||||
license = lib.licenses.asl20;
|
||||
src = fetchurl {
|
||||
url = products.pycharm-community.url;
|
||||
sha256 = products.pycharm-community.sha256;
|
||||
};
|
||||
wmClass = "jetbrains-pycharm-ce";
|
||||
update-channel = products.pycharm-community.update-channel;
|
||||
};
|
||||
|
||||
pycharm-professional = buildPycharm rec {
|
||||
pname = "pycharm-professional";
|
||||
product = "PyCharm";
|
||||
version = products.pycharm-professional.version;
|
||||
description = "PyCharm Professional Edition";
|
||||
license = lib.licenses.unfree;
|
||||
src = fetchurl {
|
||||
url = products.pycharm-professional.url;
|
||||
sha256 = products.pycharm-professional.sha256;
|
||||
};
|
||||
wmClass = "jetbrains-pycharm";
|
||||
update-channel = products.pycharm-professional.update-channel;
|
||||
};
|
||||
|
||||
rider = buildRider rec {
|
||||
pname = "rider";
|
||||
version = products.rider.version;
|
||||
description = "A cross-platform .NET IDE based on the IntelliJ platform and ReSharper";
|
||||
license = lib.licenses.unfree;
|
||||
src = fetchurl {
|
||||
url = products.rider.url;
|
||||
sha256 = products.rider.sha256;
|
||||
};
|
||||
wmClass = "jetbrains-rider";
|
||||
update-channel = products.rider.update-channel;
|
||||
};
|
||||
|
||||
ruby-mine = buildRubyMine rec {
|
||||
pname = "ruby-mine";
|
||||
version = products.ruby-mine.version;
|
||||
description = "The Most Intelligent Ruby and Rails IDE";
|
||||
license = lib.licenses.unfree;
|
||||
src = fetchurl {
|
||||
url = products.ruby-mine.url;
|
||||
sha256 = products.ruby-mine.sha256;
|
||||
};
|
||||
wmClass = "jetbrains-rubymine";
|
||||
update-channel = products.ruby-mine.update-channel;
|
||||
};
|
||||
|
||||
webstorm = buildWebStorm rec {
|
||||
pname = "webstorm";
|
||||
version = products.webstorm.version;
|
||||
description = "Professional IDE for Web and JavaScript development";
|
||||
license = lib.licenses.unfree;
|
||||
src = fetchurl {
|
||||
url = products.webstorm.url;
|
||||
sha256 = products.webstorm.sha256;
|
||||
};
|
||||
wmClass = "jetbrains-webstorm";
|
||||
update-channel = products.webstorm.update-channel;
|
||||
};
|
||||
|
||||
}
|
||||
93
pkgs/applications/editors/jetbrains/linux.nix
Normal file
93
pkgs/applications/editors/jetbrains/linux.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
{ stdenv, lib, makeDesktopItem, makeWrapper, patchelf, writeText
|
||||
, coreutils, gnugrep, which, git, unzip, libsecret, libnotify, e2fsprogs
|
||||
, vmopts ? null
|
||||
}:
|
||||
|
||||
{ pname, product, productShort ? product, version, src, wmClass, jdk, meta, extraLdPath ? [], extraWrapperArgs ? [] }@args:
|
||||
|
||||
with lib;
|
||||
|
||||
let loName = toLower productShort;
|
||||
hiName = toUpper productShort;
|
||||
vmoptsName = loName
|
||||
+ lib.optionalString stdenv.hostPlatform.is64bit "64"
|
||||
+ ".vmoptions";
|
||||
in
|
||||
|
||||
with stdenv; lib.makeOverridable mkDerivation (rec {
|
||||
inherit pname version src;
|
||||
meta = args.meta // { mainProgram = pname; };
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
name = pname;
|
||||
exec = pname;
|
||||
comment = lib.replaceChars ["\n"] [" "] meta.longDescription;
|
||||
desktopName = product;
|
||||
genericName = meta.description;
|
||||
categories = [ "Development" ];
|
||||
icon = pname;
|
||||
startupWMClass = wmClass;
|
||||
};
|
||||
|
||||
vmoptsFile = optionalString (vmopts != null) (writeText vmoptsName vmopts);
|
||||
|
||||
nativeBuildInputs = [ makeWrapper patchelf unzip ];
|
||||
|
||||
postPatch = ''
|
||||
get_file_size() {
|
||||
local fname="$1"
|
||||
echo $(ls -l $fname | cut -d ' ' -f5)
|
||||
}
|
||||
|
||||
munge_size_hack() {
|
||||
local fname="$1"
|
||||
local size="$2"
|
||||
strip $fname
|
||||
truncate --size=$size $fname
|
||||
}
|
||||
|
||||
interpreter=$(echo ${stdenv.cc.libc}/lib/ld-linux*.so.2)
|
||||
if [[ "${stdenv.hostPlatform.system}" == "x86_64-linux" && -e bin/fsnotifier64 ]]; then
|
||||
target_size=$(get_file_size bin/fsnotifier64)
|
||||
patchelf --set-interpreter "$interpreter" bin/fsnotifier64
|
||||
munge_size_hack bin/fsnotifier64 $target_size
|
||||
else
|
||||
target_size=$(get_file_size bin/fsnotifier)
|
||||
patchelf --set-interpreter "$interpreter" bin/fsnotifier
|
||||
munge_size_hack bin/fsnotifier $target_size
|
||||
fi
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{bin,$pname,share/pixmaps,libexec/${pname}}
|
||||
cp -a . $out/$pname
|
||||
ln -s $out/$pname/bin/${loName}.png $out/share/pixmaps/${pname}.png
|
||||
mv bin/fsnotifier* $out/libexec/${pname}/.
|
||||
|
||||
jdk=${jdk.home}
|
||||
item=${desktopItem}
|
||||
|
||||
makeWrapper "$out/$pname/bin/${loName}.sh" "$out/bin/${pname}" \
|
||||
--prefix PATH : "$out/libexec/${pname}:${lib.makeBinPath [ jdk coreutils gnugrep which git ]}" \
|
||||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath ([
|
||||
# Some internals want libstdc++.so.6
|
||||
stdenv.cc.cc.lib libsecret e2fsprogs
|
||||
libnotify
|
||||
] ++ extraLdPath)}" \
|
||||
${lib.concatStringsSep " " extraWrapperArgs} \
|
||||
--set-default JDK_HOME "$jdk" \
|
||||
--set-default ANDROID_JAVA_HOME "$jdk" \
|
||||
--set-default JAVA_HOME "$jdk" \
|
||||
--set ${hiName}_JDK "$jdk" \
|
||||
--set ${hiName}_VM_OPTIONS ${vmoptsFile}
|
||||
|
||||
ln -s "$item/share/applications" $out/share
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
} // lib.optionalAttrs (!(meta.license.free or true)) {
|
||||
preferLocalBuild = true;
|
||||
})
|
||||
100
pkgs/applications/editors/jetbrains/update.py
Executable file
100
pkgs/applications/editors/jetbrains/update.py
Executable file
|
|
@ -0,0 +1,100 @@
|
|||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i python3 -p python3 python3.pkgs.packaging python3.pkgs.requests python3.pkgs.xmltodict
|
||||
import json
|
||||
import pathlib
|
||||
import logging
|
||||
import requests
|
||||
import sys
|
||||
import xmltodict
|
||||
from packaging import version
|
||||
|
||||
updates_url = "https://www.jetbrains.com/updates/updates.xml"
|
||||
versions_file_path = pathlib.Path(__file__).parent.joinpath("versions.json").resolve()
|
||||
|
||||
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
|
||||
|
||||
|
||||
def one_or_more(x):
|
||||
return x if isinstance(x, list) else [x]
|
||||
|
||||
|
||||
def download_channels():
|
||||
logging.info("Checking for updates from %s", updates_url)
|
||||
updates_response = requests.get(updates_url)
|
||||
updates_response.raise_for_status()
|
||||
root = xmltodict.parse(updates_response.text)
|
||||
products = root["products"]["product"]
|
||||
return {
|
||||
channel["@name"]: channel
|
||||
for product in products
|
||||
for channel in one_or_more(product["channel"])
|
||||
}
|
||||
|
||||
|
||||
def build_version(build):
|
||||
build_number = build["@fullNumber"] if "@fullNumber" in build else build["@number"]
|
||||
return version.parse(build_number)
|
||||
|
||||
|
||||
def latest_build(channel):
|
||||
builds = one_or_more(channel["build"])
|
||||
latest = max(builds, key=build_version)
|
||||
return latest
|
||||
|
||||
|
||||
def download_sha256(url):
|
||||
url = f"{url}.sha256"
|
||||
download_response = requests.get(url)
|
||||
download_response.raise_for_status()
|
||||
return download_response.content.decode('UTF-8').split(' ')[0]
|
||||
|
||||
|
||||
channels = download_channels()
|
||||
|
||||
|
||||
def update_product(name, product):
|
||||
update_channel = product["update-channel"]
|
||||
logging.info("Updating %s", name)
|
||||
channel = channels.get(update_channel)
|
||||
if channel is None:
|
||||
logging.error("Failed to find channel %s.", update_channel)
|
||||
logging.error("Check that the update-channel in %s matches the name in %s", versions_file_path, updates_url)
|
||||
else:
|
||||
try:
|
||||
build = latest_build(channel)
|
||||
new_version = build["@version"]
|
||||
new_build_number = build["@fullNumber"]
|
||||
if "EAP" not in channel["@name"]:
|
||||
version_or_build_number = new_version
|
||||
else:
|
||||
version_or_build_number = new_build_number
|
||||
version_number = new_version.split(' ')[0]
|
||||
download_url = product["url-template"].format(version=version_or_build_number, versionMajorMinor=version_number)
|
||||
product["url"] = download_url
|
||||
if "sha256" not in product or product.get("build_number") != new_build_number:
|
||||
logging.info("Found a newer version %s with build number %s.", new_version, new_build_number)
|
||||
product["version"] = new_version
|
||||
product["build_number"] = new_build_number
|
||||
product["sha256"] = download_sha256(download_url)
|
||||
else:
|
||||
logging.info("Already at the latest version %s with build number %s.", new_version, new_build_number)
|
||||
except Exception as e:
|
||||
logging.exception("Update failed:", exc_info=e)
|
||||
logging.warning("Skipping %s due to the above error.", name)
|
||||
logging.warning("It may be out-of-date. Fix the error and rerun.")
|
||||
|
||||
|
||||
def update_products(products):
|
||||
for name, product in products.items():
|
||||
update_product(name, product)
|
||||
|
||||
|
||||
with open(versions_file_path, "r") as versions_file:
|
||||
versions = json.load(versions_file)
|
||||
|
||||
for products in versions.values():
|
||||
update_products(products)
|
||||
|
||||
with open(versions_file_path, "w") as versions_file:
|
||||
json.dump(versions, versions_file, indent=2)
|
||||
versions_file.write("\n")
|
||||
296
pkgs/applications/editors/jetbrains/versions.json
Normal file
296
pkgs/applications/editors/jetbrains/versions.json
Normal file
|
|
@ -0,0 +1,296 @@
|
|||
{
|
||||
"linux": {
|
||||
"clion": {
|
||||
"update-channel": "CLion RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/cpp/CLion-{version}.tar.gz",
|
||||
"version": "2022.1",
|
||||
"sha256": "a8ad8db6362d60a5ce60a7552110887dbd12e8420c839c368b55808b68dea38b",
|
||||
"url": "https://download.jetbrains.com/cpp/CLion-2022.1.tar.gz",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"datagrip": {
|
||||
"update-channel": "DataGrip RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/datagrip/datagrip-{version}.tar.gz",
|
||||
"version": "2022.1.1",
|
||||
"sha256": "d4ffcb4371ee6e9f03704fa6282630349fd4ff4759846c02d43bb37e3caeae67",
|
||||
"url": "https://download.jetbrains.com/datagrip/datagrip-2022.1.1.tar.gz",
|
||||
"version-major-minor": "2022.1.1"
|
||||
},
|
||||
"goland": {
|
||||
"update-channel": "GoLand RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/go/goland-{version}.tar.gz",
|
||||
"version": "2022.1",
|
||||
"sha256": "7803f432b62b7b9a9f340fd48375f50d60b0e5412b052b70e175de8edf82a947",
|
||||
"url": "https://download.jetbrains.com/go/goland-2022.1.tar.gz",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"idea-community": {
|
||||
"update-channel": "IntelliJ IDEA RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/idea/ideaIC-{version}.tar.gz",
|
||||
"version": "2022.1",
|
||||
"sha256": "0400e6152fa0173e4e9a514c6398eef8f19150893298658c0b3eb1427e5bcbe5",
|
||||
"url": "https://download.jetbrains.com/idea/ideaIC-2022.1.tar.gz",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"idea-ultimate": {
|
||||
"update-channel": "IntelliJ IDEA RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/idea/ideaIU-{version}-no-jbr.tar.gz",
|
||||
"version": "2022.1",
|
||||
"sha256": "f786bbd4a7c82273f6871996584fb7b37aa2b32fb07c7f554076f203284c77b6",
|
||||
"url": "https://download.jetbrains.com/idea/ideaIU-2022.1-no-jbr.tar.gz",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"mps": {
|
||||
"update-channel": "MPS RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/mps/{versionMajorMinor}/MPS-{version}.tar.gz",
|
||||
"version": "2021.3",
|
||||
"sha256": "e9aeb62f0d667dd285f808e3ba308f572797dbf11d51e9aa06cf49481bee857f",
|
||||
"url": "https://download.jetbrains.com/mps/2021.3/MPS-2021.3.tar.gz",
|
||||
"version-major-minor": "2021.3"
|
||||
},
|
||||
"phpstorm": {
|
||||
"update-channel": "PhpStorm RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/webide/PhpStorm-{version}.tar.gz",
|
||||
"version": "2022.1",
|
||||
"sha256": "e30d6991c98addcc02ab05c623d0c42797d605db73c01b7c153bf2246c877395",
|
||||
"url": "https://download.jetbrains.com/webide/PhpStorm-2022.1.tar.gz",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"pycharm-community": {
|
||||
"update-channel": "PyCharm RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/python/pycharm-community-{version}.tar.gz",
|
||||
"version": "2022.1",
|
||||
"sha256": "35d857df0ac4bd76caba60ac329c9183594be142094d0592f2afa40534be85eb",
|
||||
"url": "https://download.jetbrains.com/python/pycharm-community-2022.1.tar.gz",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"pycharm-professional": {
|
||||
"update-channel": "PyCharm RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/python/pycharm-professional-{version}.tar.gz",
|
||||
"version": "2022.1",
|
||||
"sha256": "9b160ed74f384be31ff376af73f91924a212e6440ce142a581b22f261e6cf605",
|
||||
"url": "https://download.jetbrains.com/python/pycharm-professional-2022.1.tar.gz",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"rider": {
|
||||
"update-channel": "Rider RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/rider/JetBrains.Rider-{version}.tar.gz",
|
||||
"version": "2022.1",
|
||||
"sha256": "e5d2018bf352f4ff17299d2ee4f286d654946fe4dac2ff47d3dc853820364673",
|
||||
"url": "https://download.jetbrains.com/rider/JetBrains.Rider-2022.1.tar.gz",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"ruby-mine": {
|
||||
"update-channel": "RubyMine RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/ruby/RubyMine-{version}.tar.gz",
|
||||
"version": "2022.1",
|
||||
"sha256": "495c0d86eb7f3bed0ed692a7ae37e8b3b333c58ae891ca3891a311db6b951401",
|
||||
"url": "https://download.jetbrains.com/ruby/RubyMine-2022.1.tar.gz",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"webstorm": {
|
||||
"update-channel": "WebStorm RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/webstorm/WebStorm-{version}.tar.gz",
|
||||
"version": "2022.1",
|
||||
"sha256": "d9dd5815cc456d74f7dc47533ade3990d0f2f9ce0c4dab3d5ae9b04e01d1746c",
|
||||
"url": "https://download.jetbrains.com/webstorm/WebStorm-2022.1.tar.gz",
|
||||
"version-major-minor": "2022.1"
|
||||
}
|
||||
},
|
||||
"x86_64-darwin": {
|
||||
"clion": {
|
||||
"update-channel": "CLion RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/cpp/CLion-{version}.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "4972403e5ed7587ad76dcfb08b975879a2a955e9be9f88344e369cd4006b2d52",
|
||||
"url": "https://download.jetbrains.com/cpp/CLion-2022.1.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"datagrip": {
|
||||
"update-channel": "DataGrip RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/datagrip/datagrip-{version}.dmg",
|
||||
"version": "2022.1.1",
|
||||
"sha256": "6ea0c0c972bad06fd0378a2c1e9a1cb1b3ec50d52cc98d0f9c98327cc7af2a1e",
|
||||
"url": "https://download.jetbrains.com/datagrip/datagrip-2022.1.1.dmg",
|
||||
"version-major-minor": "2022.1.1"
|
||||
},
|
||||
"goland": {
|
||||
"update-channel": "GoLand RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/go/goland-{version}.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "ec44455e83b8c8d85614b63815245a0dff984796a432e05801787c7f8474900b",
|
||||
"url": "https://download.jetbrains.com/go/goland-2022.1.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"idea-community": {
|
||||
"update-channel": "IntelliJ IDEA RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/idea/ideaIC-{version}.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "6f9dddab5c280bb2ad6bb8d46bcc85c1b167974ce4b412a68faf31f7f7d1c194",
|
||||
"url": "https://download.jetbrains.com/idea/ideaIC-2022.1.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"idea-ultimate": {
|
||||
"update-channel": "IntelliJ IDEA RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/idea/ideaIU-{version}.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "2f1e51db514b39b54cb4029815b7f92764b378f2cf2eb16e69e2ee3c0b35f416",
|
||||
"url": "https://download.jetbrains.com/idea/ideaIU-2022.1.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"mps": {
|
||||
"update-channel": "MPS RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/mps/{versionMajorMinor}/MPS-{version}-macos.dmg",
|
||||
"version": "2021.3",
|
||||
"sha256": "2c5517518fec31ac960e4309fa848ad831f9048ef15df1b362e12aa8f41d9dbd",
|
||||
"url": "https://download.jetbrains.com/mps/2021.3/MPS-2021.3-macos.dmg",
|
||||
"version-major-minor": "2021.3"
|
||||
},
|
||||
"phpstorm": {
|
||||
"update-channel": "PhpStorm RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/webide/PhpStorm-{version}.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "daa3c749b3a41e106384ac8e003957a46f38dfc844cebfce8c802c4a223535b8",
|
||||
"url": "https://download.jetbrains.com/webide/PhpStorm-2022.1.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"pycharm-community": {
|
||||
"update-channel": "PyCharm RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/python/pycharm-community-{version}.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "99ba20a8b0752ca58e1fc814fb19766fd19c376b42e3cbfa4102c67bc21942ec",
|
||||
"url": "https://download.jetbrains.com/python/pycharm-community-2022.1.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"pycharm-professional": {
|
||||
"update-channel": "PyCharm RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/python/pycharm-professional-{version}.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "ab5496370a6145073dbd423e47d6112d9c726a4a286d2528e66711f865d92d56",
|
||||
"url": "https://download.jetbrains.com/python/pycharm-professional-2022.1.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"rider": {
|
||||
"update-channel": "Rider RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/rider/JetBrains.Rider-{version}.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "38867fb7ca4b5af013f33b4db3b15994b6e732b121176f98480b5ff1b49ef17e",
|
||||
"url": "https://download.jetbrains.com/rider/JetBrains.Rider-2022.1.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"ruby-mine": {
|
||||
"update-channel": "RubyMine RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/ruby/RubyMine-{version}.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "b33f34b889fde6ebe6348499e2ad15bb85937aba1e2a8a9543c411b2476ec4ff",
|
||||
"url": "https://download.jetbrains.com/ruby/RubyMine-2022.1.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"webstorm": {
|
||||
"update-channel": "WebStorm RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/webstorm/WebStorm-{version}.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "0bd2be5ea0ccabfb7a806ca4c46d33f1e9106c2256243c48091ff61d5ac29a08",
|
||||
"url": "https://download.jetbrains.com/webstorm/WebStorm-2022.1.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
}
|
||||
},
|
||||
"aarch64-darwin": {
|
||||
"clion": {
|
||||
"update-channel": "CLion RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/cpp/CLion-{version}-aarch64.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "333d4ac5757f537ad67863dd6fb03644722ab8fce1596976fa99e5ae9de7991c",
|
||||
"url": "https://download.jetbrains.com/cpp/CLion-2022.1-aarch64.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"datagrip": {
|
||||
"update-channel": "DataGrip RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/datagrip/datagrip-{version}-aarch64.dmg",
|
||||
"version": "2022.1.1",
|
||||
"sha256": "2ba92ed34366b111a39ba0632d91dbaf232633f5f5557a208dd8ab7696179b6f",
|
||||
"url": "https://download.jetbrains.com/datagrip/datagrip-2022.1.1-aarch64.dmg",
|
||||
"version-major-minor": "2022.1.1"
|
||||
},
|
||||
"goland": {
|
||||
"update-channel": "GoLand RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/go/goland-{version}-aarch64.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "0506a817e35a80d3d776484a88bf4136628b589a8f5754833387a8dec99798d3",
|
||||
"url": "https://download.jetbrains.com/go/goland-2022.1-aarch64.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"idea-community": {
|
||||
"update-channel": "IntelliJ IDEA RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/idea/ideaIC-{version}-aarch64.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "f61bdf70e373a948a71331e68a7303bf90cf47ea4e2f97338aaf96d19e8862c4",
|
||||
"url": "https://download.jetbrains.com/idea/ideaIC-2022.1-aarch64.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"idea-ultimate": {
|
||||
"update-channel": "IntelliJ IDEA RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/idea/ideaIU-{version}-aarch64.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "af9c0e8d47fcded5f567293b7991fd0ac8df838b83884149109fd91ec2dec769",
|
||||
"url": "https://download.jetbrains.com/idea/ideaIU-2022.1-aarch64.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"mps": {
|
||||
"update-channel": "MPS RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/mps/{versionMajorMinor}/MPS-{version}-macos-aarch64.dmg",
|
||||
"version": "2021.3",
|
||||
"url": "https://download.jetbrains.com/mps/2021.3/MPS-2021.3-macos-aarch64.dmg",
|
||||
"sha256": "3ace6d45db718dffd80bf126a76735fb65099de292112a01cc078aa61c475a70",
|
||||
"version-major-minor": "2021.3"
|
||||
},
|
||||
"phpstorm": {
|
||||
"update-channel": "PhpStorm RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/webide/PhpStorm-{version}-aarch64.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "d13744e7a70a9716f1b99cb9b77c77e17cb4710466a29db490ef6e707a54ae21",
|
||||
"url": "https://download.jetbrains.com/webide/PhpStorm-2022.1-aarch64.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"pycharm-community": {
|
||||
"update-channel": "PyCharm RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/python/pycharm-community-{version}-aarch64.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "1873565756716cb0eee23c60068dd5d394413b2b2e54b4b75cbe8b882540a0b7",
|
||||
"url": "https://download.jetbrains.com/python/pycharm-community-2022.1-aarch64.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"pycharm-professional": {
|
||||
"update-channel": "PyCharm RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/python/pycharm-professional-{version}-aarch64.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "ba0ea4ff52703a53a9c7e14d42c9ae12688b94364ced77a28d4ed0c417c9642f",
|
||||
"url": "https://download.jetbrains.com/python/pycharm-professional-2022.1-aarch64.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"rider": {
|
||||
"update-channel": "Rider RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/rider/JetBrains.Rider-{version}-aarch64.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "273f40eda119a034ada821db2257e3b5c2bfb835c287365398237f5d9a9daad3",
|
||||
"url": "https://download.jetbrains.com/rider/JetBrains.Rider-2022.1-aarch64.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"ruby-mine": {
|
||||
"update-channel": "RubyMine RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/ruby/RubyMine-{version}-aarch64.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "06d932a587adcd25b4e70d0b27c2c229381144deaef90cbcdc345edd822e04ed",
|
||||
"url": "https://download.jetbrains.com/ruby/RubyMine-2022.1-aarch64.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
},
|
||||
"webstorm": {
|
||||
"update-channel": "WebStorm RELEASE",
|
||||
"url-template": "https://download.jetbrains.com/webstorm/WebStorm-{version}-aarch64.dmg",
|
||||
"version": "2022.1",
|
||||
"sha256": "96ec148af1b20ea9d2cb6f8b1f268f96607269e8dd3caf521b48464fe21a7177",
|
||||
"url": "https://download.jetbrains.com/webstorm/WebStorm-2022.1-aarch64.dmg",
|
||||
"version-major-minor": "2022.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue