Merge pull request #259373 from GenericNerdyUsername/intellij-overhaul

Intellij overhaul
This commit is contained in:
Nick Cao 2023-12-05 07:08:11 -05:00 committed by GitHub
commit c3abd820f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 8295 additions and 679 deletions

View File

@ -0,0 +1,172 @@
{
"clion": {
"product": "CLion",
"wmClass": "jetbrains-clion",
"meta": {
"isOpenSource": false,
"description": "C/C++ IDE from JetBrains",
"maintainers": [ "edwtjo", "mic92", "tymscar" ],
"longDescription": "Enhancing productivity for every C and C++ developer on Linux, macOS and Windows.",
"homepage": "https://www.jetbrains.com/clion/"
}
},
"datagrip": {
"product": "DataGrip",
"wmClass": "jetbrains-datagrip",
"meta": {
"isOpenSource": false,
"description": "Database IDE from JetBrains",
"maintainers": [ ],
"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.",
"homepage": "https://www.jetbrains.com/datagrip/"
}
},
"dataspell": {
"product": "DataSpell",
"wmClass": "jetbrains-dataspell",
"meta": {
"isOpenSource": false,
"description": "Data science IDE from JetBrains",
"maintainers": [ "leona" ],
"longDescription": "DataSpell is a new IDE from JetBrains built for Data Scientists. Mainly it integrates Jupyter notebooks in the IntelliJ platform.",
"homepage": "https://www.jetbrains.com/dataspell/"
}
},
"gateway": {
"product": "JetBrains Gateway",
"productShort": "Gateway",
"wmClass": "jetbrains-gateway",
"meta": {
"isOpenSource": false,
"description": "Remote development for JetBrains products",
"maintainers": [ ],
"longDescription": "JetBrains Gateway is a lightweight launcher that connects a remote server with your local machine, downloads necessary components on the backend, and opens your project in JetBrains Client.",
"homepage": "https://www.jetbrains.com/remote-development/gateway/"
}
},
"goland": {
"product": "Goland",
"wmClass": "jetbrains-goland",
"meta": {
"isOpenSource": false,
"description": "Go IDE from JetBrains",
"maintainers": [ "tymscar" ],
"longDescription": "Goland is the codename for a new commercial IDE by JetBrains aimed at providing an ergonomic environment for Go development.\n The new IDE extends the IntelliJ platform with the coding assistance and tool integrations specific for the Go language",
"homepage": "https://www.jetbrains.com/go/"
}
},
"idea-community": {
"product": "IntelliJ IDEA CE",
"productShort": "IDEA",
"wmClass": "jetbrains-idea-ce",
"meta": {
"isOpenSource": true,
"description": "Free Java, Kotlin, Groovy and Scala IDE from jetbrains",
"maintainers": [ "edwtjo", "gytis-ivaskevicius", "steinybot", "AnatolyPopov", "tymscar" ],
"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.",
"homepage": "https://www.jetbrains.com/idea/"
}
},
"idea-ultimate": {
"product": "IntelliJ IDEA",
"productShort": "IDEA",
"wmClass": "jetbrains-idea",
"meta": {
"isOpenSource": false,
"description": "Paid-for Java, Kotlin, Groovy and Scala IDE from jetbrains",
"maintainers": [ "edwtjo", "gytis-ivaskevicius", "steinybot", "AnatolyPopov", "tymscar" ],
"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.",
"homepage": "https://www.jetbrains.com/idea/"
}
},
"mps": {
"product": "MPS",
"wmClass": "jetbrains-MPS",
"meta": {
"isOpenSource": false,
"description": "IDE for building domain-specific languages from JetBrains",
"maintainers": [ "rasendubi" ],
"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.",
"homepage": "https://www.jetbrains.com/mps/"
}
},
"phpstorm": {
"product": "PhpStorm",
"wmClass": "jetbrains-phpstorm",
"meta": {
"isOpenSource": false,
"description": "PHP IDE from JetBrains",
"maintainers": [ "dritter", "tymscar" ],
"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. ",
"homepage": "https://www.jetbrains.com/phpstorm/"
}
},
"pycharm-community": {
"product": "PyCharm CE",
"productShort": "PyCharm",
"wmClass": "jetbrains-pycharm-ce",
"meta": {
"isOpenSource": true,
"description": "Free Python IDE from JetBrains",
"maintainers": [ "genericnerdyusername", "tymscar" ],
"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!",
"homepage": "https://www.jetbrains.com/pycharm/"
}
},
"pycharm-professional": {
"product": "PyCharm",
"productShort": "PyCharm",
"wmClass": "jetbrains-pycharm",
"meta": {
"isOpenSource": false,
"description": "Paid-for Python IDE from JetBrains",
"maintainers": [ "genericnerdyusername", "tymscar" ],
"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!",
"homepage": "https://www.jetbrains.com/pycharm/"
}
},
"rider": {
"product": "Rider",
"wmClass": "jetbrains-rider",
"meta": {
"isOpenSource": false,
"description": ".NET IDE from JetBrains",
"maintainers": [ "raphaelr" ],
"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.",
"homepage": "https://www.jetbrains.com/rider/"
}
},
"ruby-mine": {
"product": "RubyMine",
"wmClass": "jetbrains-rubymine",
"meta": {
"isOpenSource": false,
"description": "Ruby IDE from JetBrains",
"maintainers": [ "edwtjo", "tymscar"],
"longDescription": "Ruby IDE from JetBrains",
"homepage": "https://www.jetbrains.com/ruby/"
}
},
"rust-rover": {
"product": "RustRover",
"wmClass": "jetbrains-rustrover",
"meta": {
"isOpenSource": false,
"description": "Rust IDE from JetBrains",
"maintainers": [ "genericnerdyusername"],
"longDescription": "Rust IDE from JetBrains",
"homepage": "https://www.jetbrains.com/rust/"
}
},
"webstorm": {
"product": "WebStorm",
"wmClass": "jetbrains-webstorm",
"meta": {
"isOpenSource": false,
"description": "Web IDE from JetBrains",
"maintainers": [ "abaldeau", "tymscar"],
"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.",
"homepage": "https://www.jetbrains.com/webstorm/"
}
}
}

View File

@ -14,6 +14,7 @@
, udev
, e2fsprogs
, python3
, autoPatchelfHook
, vmopts ? null
}:
@ -26,8 +27,11 @@
, buildNumber
, jdk
, meta
, libdbm
, fsnotifier
, extraLdPath ? [ ]
, extraWrapperArgs ? [ ]
, extraBuildInputs ? [ ]
}@args:
let
@ -56,38 +60,16 @@ with stdenv; lib.makeOverridable mkDerivation (rec {
vmoptsFile = lib.optionalString (vmopts != null) (writeText vmoptsName vmopts);
nativeBuildInputs = [ makeWrapper patchelf unzip ];
nativeBuildInputs = [ makeWrapper patchelf unzip autoPatchelfHook ];
buildInputs = extraBuildInputs;
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
}
rm -rf jbr
# When using the IDE as a remote backend using gateway, it expects the jbr directory to contain the jdk
ln -s ${jdk.home} jbr
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
if [ -d "plugins/remote-dev-server" ]; then
patch -p1 < ${./JetbrainsRemoteDev.patch}
patch -p1 < ${../patches/jetbrains-remote-dev.patch}
fi
vmopts_file=bin/linux/${vmoptsName}
@ -109,18 +91,19 @@ with stdenv; lib.makeOverridable mkDerivation (rec {
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,$pname,share/pixmaps,libexec/${pname},share/icons/hicolor/scalable/apps}
mkdir -p $out/{bin,$pname,share/pixmaps,share/icons/hicolor/scalable/apps}
cp -a . $out/$pname
[[ -f $out/$pname/bin/${loName}.png ]] && ln -s $out/$pname/bin/${loName}.png $out/share/pixmaps/${pname}.png
[[ -f $out/$pname/bin/${loName}.svg ]] && ln -s $out/$pname/bin/${loName}.svg $out/share/pixmaps/${pname}.svg \
&& ln -s $out/$pname/bin/${loName}.svg $out/share/icons/hicolor/scalable/apps/${pname}.svg
mv bin/fsnotifier* $out/libexec/${pname}/.
cp ${libdbm}/lib/libdbm.so $out/$pname/bin/libdbm.so
cp ${fsnotifier}/bin/fsnotifier $out/$pname/bin/fsnotifier
jdk=${jdk.home}
item=${desktopItem}
wrapProgram "$out/$pname/bin/${loName}.sh" \
--prefix PATH : "$out/libexec/${pname}:${lib.makeBinPath [ jdk coreutils gnugrep which git ]}" \
--prefix PATH : "${lib.makeBinPath [ jdk coreutils gnugrep which git ]}" \
--suffix PATH : "${lib.makeBinPath [ python3 ]}" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath extraLdPath}" \
${lib.concatStringsSep " " extraWrapperArgs} \
@ -132,6 +115,7 @@ with stdenv; lib.makeOverridable mkDerivation (rec {
--set-default ${hiName}_VM_OPTIONS ${vmoptsFile}
ln -s "$out/$pname/bin/${loName}.sh" $out/bin/$pname
rm -rf $out/$pname/plugins/remote-dev-server/selfcontained/
echo -e '#!/usr/bin/env bash\n'"$out/$pname/bin/remote-dev-server.sh"' "$@"' > $out/$pname/bin/remote-dev-server-wrapped.sh
chmod +x $out/$pname/bin/remote-dev-server-wrapped.sh
ln -s "$out/$pname/bin/remote-dev-server-wrapped.sh" $out/bin/$pname-remote-dev-server

View File

@ -126,6 +126,6 @@ logging.info("#### Committing changes... ####")
subprocess.run(['git', 'commit', f'-m{commitMessage}', '--', f'{versions_file_path}'], check=True)
logging.info("#### Updating plugins ####")
plugin_script = current_path.joinpath("plugins/update_plugins.py").resolve()
plugin_script = current_path.joinpath("../plugins/update_plugins.py").resolve()
subprocess.call(plugin_script)

View File

@ -2,245 +2,86 @@
, stdenv
, callPackage
, fetchurl
, jdk
, cmake
, gdb
, zlib
, python3
, lldb
, dotnet-sdk_7
, maven
, autoPatchelfHook
, libdbusmenu
, patchelf
, openssl
, expat
, libxcrypt
, libxcrypt-legacy
, fontconfig
, libxml2
, runCommand
, musl
, R
, libgcc
, lttng-ust_2_12
, xz
, vmopts ? null
}:
let
platforms = lib.platforms.linux ++ [ "x86_64-darwin" "aarch64-darwin" ];
ideaPlatforms = [ "x86_64-darwin" "i686-darwin" "i686-linux" "x86_64-linux" "aarch64-darwin" "aarch64-linux" ];
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
inherit (stdenv.hostPlatform) system;
versions = builtins.fromJSON (lib.readFile (./versions.json));
# `ides.json` is handwritten and contains information that doesn't change across updates, like maintainers and other metadata
# `versions.json` contains everything generated/needed by the update script version numbers, build numbers and tarball hashes
ideInfo = lib.importJSON ./bin/ides.json;
versions = lib.importJSON ./bin/versions.json;
products = versions.${system} or (throw "Unsupported system: ${system}");
package = if stdenv.isDarwin then ./darwin.nix else ./linux.nix;
mkJetBrainsProduct = callPackage package { inherit vmopts; };
package = if stdenv.isDarwin then ./bin/darwin.nix else ./bin/linux.nix;
mkJetBrainsProductCore = callPackage package { inherit vmopts; };
mkMeta = meta: fromSource: {
inherit (meta) homepage longDescription;
description = meta.description + lib.optionalString meta.isOpenSource (if fromSource then " (built from source)" else " (patched binaries from jetbrains)");
maintainers = map (x: lib.maintainers."${x}") meta.maintainers;
license = if meta.isOpenSource then lib.licenses.asl20 else lib.licenses.unfree;
};
# Sorted alphabetically
buildClion = { pname, version, src, license, description, wmClass, buildNumber, ... }:
(mkJetBrainsProduct {
inherit pname version src wmClass jdk buildNumber;
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 tymscar ];
mkJetBrainsProduct =
{ pname
, fromSource ? false
, extraWrapperArgs ? [ ]
, extraLdPath ? [ ]
, extraBuildInputs ? [ ]
}:
mkJetBrainsProductCore {
inherit pname jdk extraWrapperArgs extraLdPath extraBuildInputs;
src = if fromSource then communitySources."${pname}" else
fetchurl {
url = products."${pname}".url;
sha256 = products."${pname}".sha256;
};
}).overrideAttrs (attrs: {
nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ lib.optionals (stdenv.isLinux) [
autoPatchelfHook
];
buildInputs = (attrs.buildInputs or [ ]) ++ lib.optionals (stdenv.isLinux) [
python3
stdenv.cc.cc
libdbusmenu
openssl.out
expat
libxcrypt-legacy
] ++ lib.optionals (stdenv.isLinux && stdenv.isAarch64) [
libxml2
xz
];
dontAutoPatchelf = true;
postFixup = (attrs.postFixup or "") + lib.optionalString (stdenv.isLinux) ''
(
cd $out/clion
inherit (products."${pname}") version;
buildNumber = products."${pname}".build_number;
inherit (ideInfo."${pname}") wmClass product;
productShort = ideInfo."${pname}".productShort or ideInfo."${pname}".product;
meta = mkMeta ideInfo."${pname}".meta fromSource;
libdbm = if ideInfo."${pname}".meta.isOpenSource then communitySources."${pname}".libdbm else communitySources.idea-community.libdbm;
fsnotifier = if ideInfo."${pname}".meta.isOpenSource then communitySources."${pname}".fsnotifier else communitySources.idea-community.fsnotifier;
};
# I think the included gdb has a couple of patches, so we patch it instead of replacing
ls -d $PWD/bin/gdb/linux/*/lib/python3.8/lib-dynload/* |
xargs patchelf \
--replace-needed libssl.so.10 libssl.so \
--replace-needed libcrypto.so.10 libcrypto.so
communitySources = callPackage ./source { };
ls -d $PWD/bin/lldb/linux/*/lib/python3.8/lib-dynload/* |
xargs patchelf \
--replace-needed libssl.so.10 libssl.so \
--replace-needed libcrypto.so.10 libcrypto.so
autoPatchelf $PWD/bin
)
'';
});
buildDataGrip = { pname, version, src, license, description, wmClass, buildNumber, ... }:
(mkJetBrainsProduct {
inherit pname version src wmClass jdk buildNumber;
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; [ ];
};
});
buildDataSpell = { pname, version, src, license, description, wmClass, buildNumber, ... }:
(mkJetBrainsProduct {
inherit pname version src wmClass jdk buildNumber;
product = "DataSpell";
meta = with lib; {
homepage = "https://www.jetbrains.com/dataspell/";
inherit description license platforms;
longDescription = ''
DataSpell is a new IDE from JetBrains built for Data Scientists.
Mainly it integrates Jupyter notebooks in the IntelliJ platform.
'';
maintainers = with maintainers; [ leona ];
};
});
buildGateway = { pname, version, src, license, description, wmClass, buildNumber, product, ... }:
(mkJetBrainsProduct {
inherit pname version src wmClass jdk buildNumber product;
productShort = "Gateway";
meta = with lib; {
homepage = "https://www.jetbrains.com/remote-development/gateway/";
inherit description license platforms;
longDescription = ''
JetBrains Gateway is a lightweight launcher that connects a remote
server with your local machine, downloads necessary components on the
backend, and opens your project in JetBrains Client.
'';
maintainers = with maintainers; [ ];
};
});
buildGoland = { pname, version, src, license, description, wmClass, buildNumber, ... }:
(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;
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 = with maintainers; [ tymscar ];
};
}).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-plugin/lib/dlv/linux/dlv
chmod +x $out/goland/plugins/go-plugin/lib/dlv/linux/dlv
'';
});
buildIdea = { pname, version, src, license, description, wmClass, buildNumber, product, ... }:
(mkJetBrainsProduct {
inherit pname version src wmClass jdk buildNumber product;
productShort = "IDEA";
buildIdea = args:
mkJetBrainsProduct (args // {
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 tymscar ];
platforms = ideaPlatforms;
};
});
buildMps = { pname, version, src, license, description, wmClass, product, buildNumber, ... }:
(mkJetBrainsProduct rec {
inherit pname version src wmClass jdk buildNumber 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, buildNumber, ... }:
(mkJetBrainsProduct {
inherit pname version src wmClass jdk buildNumber;
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; [ dritter tymscar ];
};
});
buildPycharm = { pname, version, src, license, description, wmClass, buildNumber, product, cythonSpeedup ? stdenv.isLinux, ... }:
(mkJetBrainsProduct {
inherit pname version src wmClass jdk buildNumber 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; [ genericnerdyusername tymscar ];
};
}).overrideAttrs (finalAttrs: previousAttrs: lib.optionalAttrs cythonSpeedup {
buildInputs = with python3.pkgs; [ python3 setuptools ];
buildPycharm = args:
(mkJetBrainsProduct args).overrideAttrs (finalAttrs: previousAttrs: lib.optionalAttrs stdenv.isLinux {
buildInputs = with python3.pkgs; (previousAttrs.buildInputs or []) ++ [ python3 setuptools ];
preInstall = ''
echo "compiling cython debug speedups"
if [[ -d plugins/python-ce ]]; then
@ -252,43 +93,112 @@ let
# See https://www.jetbrains.com/help/pycharm/2022.1/cython-speedups.html
});
buildRider = { pname, version, src, license, description, wmClass, buildNumber, ... }:
(mkJetBrainsProduct {
inherit pname version src wmClass jdk buildNumber;
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 = with maintainers; [ raphaelr ];
};
}).overrideAttrs (attrs: {
nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ lib.optionals (stdenv.isLinux) [
autoPatchelfHook
];
buildInputs = (attrs.buildInputs or [ ]) ++ lib.optionals (stdenv.isLinux) [
in
rec {
# Sorted alphabetically
clion = (mkJetBrainsProduct {
pname = "clion";
extraBuildInputs = lib.optionals (stdenv.isLinux) [
python3
stdenv.cc.cc
openssl
libxcrypt-legacy
musl
] ++ lib.optionals (stdenv.isLinux && stdenv.isAarch64) [
expat
libxml2
xz
];
}).overrideAttrs (attrs: {
postFixup = (attrs.postFixup or "") + lib.optionalString (stdenv.isLinux) ''
(
cd $out/clion
# I think the included gdb has a couple of patches, so we patch it instead of replacing
ls -d $PWD/bin/gdb/linux/*/lib/python3.8/lib-dynload/* |
xargs patchelf \
--replace-needed libssl.so.10 libssl.so \
--replace-needed libcrypto.so.10 libcrypto.so
ls -d $PWD/bin/lldb/linux/*/lib/python3.8/lib-dynload/* |
xargs patchelf \
--replace-needed libssl.so.10 libssl.so \
--replace-needed libcrypto.so.10 libcrypto.so
)
'';
});
datagrip = mkJetBrainsProduct { pname = "datagrip"; };
dataspell = let
libr = runCommand "libR" {} ''
mkdir -p $out/lib
ln -s ${R}/lib/R/lib/libR.so $out/lib/libR.so
'';
in mkJetBrainsProduct {
pname = "dataspell";
extraBuildInputs = [ libgcc libr stdenv.cc.cc ];
};
gateway = mkJetBrainsProduct { pname = "gateway"; };
goland = (mkJetBrainsProduct {
pname = "goland";
extraWrapperArgs = [
# fortify source breaks build since delve compiles with -O0
''--prefix CGO_CPPFLAGS " " "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0"''
];
extraBuildInputs = [ libgcc ];
}).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-plugin/lib/dlv/linux/dlv
chmod +x $out/goland/plugins/go-plugin/lib/dlv/linux/dlv
'';
});
idea-community-bin = buildIdea { pname = "idea-community"; extraBuildInputs = [ stdenv.cc.cc ]; };
idea-community-src = buildIdea { pname = "idea-community"; extraBuildInputs = [ stdenv.cc.cc ]; fromSource = true; };
idea-community = if stdenv.isDarwin || stdenv.isAarch64 then idea-community-bin else idea-community-src;
idea-ultimate = buildIdea { pname = "idea-ultimate"; extraBuildInputs = [ stdenv.cc.cc lldb musl ]; };
mps = mkJetBrainsProduct { pname = "mps"; };
phpstorm = mkJetBrainsProduct { pname = "phpstorm"; extraBuildInputs = [ stdenv.cc.cc musl ]; };
pycharm-community-bin = buildPycharm { pname = "pycharm-community"; };
pycharm-community-src = buildPycharm { pname = "pycharm-community"; fromSource = true; };
pycharm-community = if stdenv.isDarwin then pycharm-community-bin else pycharm-community-src;
pycharm-professional = buildPycharm { pname = "pycharm-professional"; extraBuildInputs = [ musl ]; };
rider = (mkJetBrainsProduct {
pname = "rider";
extraBuildInputs = [
fontconfig
stdenv.cc.cc
zlib
fontconfig # plugins/dotTrace/DotFiles/linux-*/libSkiaSharp.so
openssl
libxcrypt
lttng-ust_2_12
musl
];
dontAutoPatchelf = true;
postFixup = (attrs.postFixup or "") + lib.optionalString (stdenv.isLinux) ''
}).overrideAttrs (attrs: {
postInstall = (attrs.postInstall or "") + lib.optionalString (stdenv.isLinux) ''
(
cd $out/rider
# Remove dotnet copy first so it's not considered by autoPatchElf
rm -rf lib/ReSharperHost/linux-*/dotnet
autoPatchelf \
lib/ReSharperHost/linux-*/ \
plugins/dotCommon/DotFiles/linux-*/ \
plugins/dotTrace/DotFiles/linux-*/
ls -d $PWD/plugins/cidr-debugger-plugin/bin/lldb/linux/*/lib/python3.8/lib-dynload/* |
xargs patchelf \
--replace-needed libssl.so.10 libssl.so \
--replace-needed libcrypto.so.10 libcrypto.so \
--replace-needed libcrypt.so.1 libcrypt.so
for dir in lib/ReSharperHost/linux-*; do
ln -s ${dotnet-sdk_7} $dir/dotnet
@ -297,303 +207,43 @@ let
'';
});
buildRubyMine = { pname, version, src, license, description, wmClass, buildNumber, ... }:
(mkJetBrainsProduct {
inherit pname version src wmClass jdk buildNumber;
product = "RubyMine";
meta = with lib; {
homepage = "https://www.jetbrains.com/ruby/";
inherit description license platforms;
longDescription = description;
maintainers = with maintainers; [ edwtjo tymscar ];
};
});
ruby-mine = mkJetBrainsProduct { pname = "ruby-mine"; extraBuildInputs = [ stdenv.cc.cc musl ]; };
buildRustRover = { pname, version, src, license, description, wmClass, buildNumber, ... }:
(mkJetBrainsProduct {
inherit pname version src wmClass jdk buildNumber;
product = "RustRover";
meta = with lib; {
homepage = "https://www.jetbrains.com/rust/";
inherit description license platforms;
longDescription = description;
};
}).overrideAttrs (attrs: {
nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ lib.optionals (stdenv.isLinux) [
autoPatchelfHook
];
buildInputs = (attrs.buildInputs or [ ]) ++ lib.optionals (stdenv.isLinux) [
python3
stdenv.cc.cc
libdbusmenu
openssl.out
libxcrypt-legacy
] ++ lib.optionals (stdenv.isLinux && stdenv.isAarch64) [
expat
libxml2
xz
];
dontAutoPatchelf = true;
postFixup = (attrs.postFixup or "") + lib.optionalString (stdenv.isLinux) ''
(
cd $out/rust-rover
# Copied over from clion (gdb seems to have a couple of patches)
ls -d $PWD/bin/gdb/linux/*/lib/python3.8/lib-dynload/* |
xargs patchelf \
--replace-needed libssl.so.10 libssl.so \
--replace-needed libcrypto.so.10 libcrypto.so
ls -d $PWD/bin/lldb/linux/*/lib/python3.8/lib-dynload/* |
xargs patchelf \
--replace-needed libssl.so.10 libssl.so \
--replace-needed libcrypto.so.10 libcrypto.so
autoPatchelf $PWD/bin
interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
patchelf --set-interpreter $interp $PWD/plugins/intellij-rust/bin/linux/*/intellij-rust-native-helper
chmod +x $PWD/plugins/intellij-rust/bin/linux/*/intellij-rust-native-helper
)
'';
});
buildWebStorm = { pname, version, src, license, description, wmClass, buildNumber, ... }:
(mkJetBrainsProduct {
inherit pname version src wmClass jdk buildNumber;
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 tymscar ];
};
});
in
{
# Sorted alphabetically
clion = buildClion rec {
pname = "clion";
version = products.clion.version;
buildNumber = products.clion.build_number;
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;
buildNumber = products.datagrip.build_number;
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;
};
dataspell = buildDataSpell rec {
pname = "dataspell";
version = products.dataspell.version;
buildNumber = products.dataspell.build_number;
description = "The IDE for Professional Data Scientists";
license = lib.licenses.unfree;
src = fetchurl {
url = products.dataspell.url;
sha256 = products.dataspell.sha256;
};
wmClass = "jetbrains-dataspell";
update-channel = products.dataspell.update-channel;
};
gateway = buildGateway rec {
pname = "gateway";
product = "JetBrains Gateway";
version = products.gateway.version;
buildNumber = products.gateway.build_number;
description = "Your single entry point to all remote development environments";
license = lib.licenses.unfree;
src = fetchurl {
url = products.gateway.url;
sha256 = products.gateway.sha256;
};
wmClass = "jetbrains-gateway";
update-channel = products.gateway.update-channel;
};
goland = buildGoland rec {
pname = "goland";
version = products.goland.version;
buildNumber = products.goland.build_number;
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;
buildNumber = products.idea-community.build_number;
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;
buildNumber = products.idea-ultimate.build_number;
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;
buildNumber = products.mps.build_number;
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;
buildNumber = products.phpstorm.build_number;
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;
buildNumber = products.pycharm-community.build_number;
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;
buildNumber = products.pycharm-community.build_number;
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;
buildNumber = products.rider.build_number;
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;
buildNumber = products.ruby-mine.build_number;
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;
};
rust-rover = buildRustRover rec {
rust-rover = (mkJetBrainsProduct {
pname = "rust-rover";
version = products.rust-rover.version;
buildNumber = products.rust-rover.build_number;
description = "Rust IDE";
license = lib.licenses.unfree;
src = fetchurl {
url = products.rust-rover.url;
sha256 = products.rust-rover.sha256;
};
wmClass = "jetbrains-rustrover";
update-channel = products.rust-rover.update-channel;
};
extraBuildInputs = lib.optionals (stdenv.isLinux) [
python3
openssl
libxcrypt-legacy
] ++ lib.optionals (stdenv.isLinux && stdenv.isAarch64) [
expat
libxml2
xz
];
}).overrideAttrs (attrs: {
postFixup = (attrs.postFixup or "") + lib.optionalString (stdenv.isLinux) ''
(
cd $out/rust-rover
webstorm = buildWebStorm rec {
pname = "webstorm";
version = products.webstorm.version;
buildNumber = products.webstorm.build_number;
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;
};
# Copied over from clion (gdb seems to have a couple of patches)
ls -d $PWD/bin/gdb/linux/*/lib/python3.8/lib-dynload/* |
xargs patchelf \
--replace-needed libssl.so.10 libssl.so \
--replace-needed libcrypto.so.10 libcrypto.so
ls -d $PWD/bin/lldb/linux/*/lib/python3.8/lib-dynload/* |
xargs patchelf \
--replace-needed libssl.so.10 libssl.so \
--replace-needed libcrypto.so.10 libcrypto.so
interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
patchelf --set-interpreter $interp $PWD/plugins/intellij-rust/bin/linux/*/intellij-rust-native-helper
chmod +x $PWD/plugins/intellij-rust/bin/linux/*/intellij-rust-native-helper
)
'';
});
webstorm = mkJetBrainsProduct { pname = "webstorm"; extraBuildInputs = [ stdenv.cc.cc musl ]; };
plugins = callPackage ./plugins { };

View File

@ -0,0 +1,23 @@
--- a/src/main/java/org/jetbrains/jpsBootstrap/KotlinCompiler.kt
+++ b/src/main/java/org/jetbrains/jpsBootstrap/KotlinCompiler.kt
@@ -14,19 +14,7 @@
"https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide-plugin-dependencies"
fun downloadAndExtractKotlinCompiler(communityRoot: BuildDependenciesCommunityRoot): Path {
- // We already have kotlin JPS in the classpath, fetch version from it
- val kotlincVersion = javaClass.classLoader.getResourceAsStream("META-INF/compiler.version")
- .use { inputStream -> inputStream!!.readAllBytes().decodeToString() }
- info("Kotlin compiler version is $kotlincVersion")
-
- val kotlincUrl = getUriForMavenArtifact(
- KOTLIN_IDE_MAVEN_REPOSITORY_URL,
- "org.jetbrains.kotlin",
- "kotlin-dist-for-ide",
- kotlincVersion,
- "jar")
- val kotlincDist = downloadFileToCacheLocation(communityRoot, kotlincUrl)
- val kotlinc = extractFileToCacheLocation(communityRoot, kotlincDist)
+ val kotlinc = Path.of("KOTLIN_PATH_HERE")
verbose("Kotlin compiler is at $kotlinc")
return kotlinc
}

View File

@ -0,0 +1,52 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@
project(dbm)
include(CheckCXXSourceCompiles)
-include (CheckCXXCompilerFlag)
+include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-fvisibility=hidden __DBUSMENU_HAVE_GCC_VISIBILITY)
if (__DBUSMENU_HAVE_GCC_VISIBILITY AND NOT WIN32)
@@ -19,27 +19,13 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif (__DBUSMENU_HAVE_W_ALL)
-
-find_library(LIB_GLIB NAMES glib libglib libglib-2.0.so.0)
-MESSAGE("LIB_GLIB: " ${LIB_GLIB})
-
-find_library(LIB_GIO NAMES libgio-2.0.so.0)
-MESSAGE("LIB_GIO: " ${LIB_GIO})
-
-find_library(LIB_GOBJ NAMES libgobject-2.0.so.0)
-MESSAGE("LIB_GOBJ: " ${LIB_GOBJ})
+find_package(PkgConfig REQUIRED)
+pkg_search_module(GLIB REQUIRED glib-2.0)
+pkg_search_module(LIBDBUSMENU REQUIRED dbusmenu-glib-0.4)
# use patched library, you may build it from https://github.com/JetBrains/libdbusmenu
set(LIB_DBUSMENU "${PROJECT_SOURCE_DIR}/libdbusmenu-glib.a")
-set(GLIB_INCLUDE_DIRS /usr/include/glib-2.0 /usr/lib64/glib-2.0/include)
-set(DBUSMENU_GLIB_INCLUDE_DIRS /usr/include/libdbusmenu-glib-0.4)
-
-include_directories(
- ${GLIB_INCLUDE_DIRS}
- ${DBUSMENU_GLIB_INCLUDE_DIRS}
-)
-
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
@@ -47,7 +33,8 @@
set(SOURCE_FILES DbusMenuWrapper.c)
add_library(dbm SHARED ${SOURCE_FILES})
-target_link_libraries(dbm ${LIB_GLIB} ${LIB_GIO} ${LIB_DBUSMENU} ${LIB_GOBJ})
+target_link_libraries(dbm ${LIB_DBUSMENU} ${GLIB_LDFLAGS})
+include_directories(dbm ${GLIB_INCLUDE_DIRS} ${LIBDBUSMENU_INCLUDE_DIRS})
if (TESTS_ENABLED)
find_library(LIB_GTK NAMES libgtk-3.so)

View File

@ -0,0 +1,128 @@
--- a/build/deps/src/org/jetbrains/intellij/build/impl/BundledMavenDownloader.kt
+++ b/build/deps/src/org/jetbrains/intellij/build/impl/BundledMavenDownloader.kt
@@ -87,13 +87,13 @@
}
val targetFile = root.resolve("${split[1]}-${split[2]}.jar")
val uri = BuildDependenciesDownloader.getUriForMavenArtifact(
- mavenRepository = BuildDependenciesConstants.MAVEN_CENTRAL_URL,
+ mavenRepository = "MAVEN_REPO_HERE",
groupId = split[0],
artifactId = split[1],
version = split[2],
packaging = "jar"
)
- targetFile to downloadFileToCacheLocation(uri.toString(), communityRoot)
+ targetFile to Path.of(uri.toString())
}
}
}.asSequence().map { it.getCompleted() }.toMap()
@@ -133,21 +133,6 @@
}
suspend fun downloadMavenDistribution(communityRoot: BuildDependenciesCommunityRoot): Path {
- val extractDir = communityRoot.communityRoot.resolve("plugins/maven/maven36-server-impl/lib/maven3")
- val properties = BuildDependenciesDownloader.getDependenciesProperties(communityRoot)
- val bundledMavenVersion = properties.property("bundledMavenVersion")
- mutex.withLock {
- val uri = BuildDependenciesDownloader.getUriForMavenArtifact(
- mavenRepository = BuildDependenciesConstants.MAVEN_CENTRAL_URL,
- groupId = "org.apache.maven",
- artifactId = "apache-maven",
- version = bundledMavenVersion,
- classifier = "bin",
- packaging = "zip"
- )
- val zipPath = downloadFileToCacheLocation(uri.toString(), communityRoot)
- BuildDependenciesDownloader.extractFile(zipPath, extractDir, communityRoot, BuildDependenciesExtractOptions.STRIP_ROOT)
- }
- return extractDir
+ return Path.of("MAVEN_PATH_HERE")
}
}
--- a/platform/build-scripts/downloader/src/org/jetbrains/intellij/build/dependencies/JdkDownloader.kt
+++ b/platform/build-scripts/downloader/src/org/jetbrains/intellij/build/dependencies/JdkDownloader.kt
@@ -25,11 +25,7 @@
}
fun getJdkHome(communityRoot: BuildDependenciesCommunityRoot, os: OS, arch: Arch, infoLog: (String) -> Unit): Path {
- val jdkUrl = getUrl(communityRoot, os, arch)
- val jdkArchive = BuildDependenciesDownloader.downloadFileToCacheLocation(communityRoot, jdkUrl)
- val jdkExtracted = BuildDependenciesDownloader.extractFileToCacheLocation(
- communityRoot, jdkArchive, BuildDependenciesExtractOptions.STRIP_ROOT)
- infoLog("jps-bootstrap JDK is at $jdkExtracted")
+ val jdkExtracted = Path.of("JDK_PATH_HERE")
val jdkHome: Path = if (os == OS.MACOSX) {
jdkExtracted.resolve("Contents").resolve("Home")
--- a/platform/build-scripts/src/org/jetbrains/intellij/build/LinuxDistributionCustomizer.kt
+++ b/platform/build-scripts/src/org/jetbrains/intellij/build/LinuxDistributionCustomizer.kt
@@ -43,12 +43,12 @@
/**
* If `true` a separate *-no-jbr.tar.gz artifact without runtime will be produced.
*/
- var buildTarGzWithoutBundledRuntime = false
+ var buildTarGzWithoutBundledRuntime = true
/**
* If `true`, the only *-no-jbr.tar.gz will be produced, no other binaries for Linux will be built.
*/
- var buildOnlyBareTarGz = false
+ var buildOnlyBareTarGz = true
/**
* Set both properties if a .snap package should be produced.
--- a/platform/build-scripts/src/org/jetbrains/intellij/build/impl/brokenPlugins.kt
+++ b/platform/build-scripts/src/org/jetbrains/intellij/build/impl/brokenPlugins.kt
@@ -11,6 +11,7 @@
import java.nio.file.Files
import java.nio.file.Path
import java.util.*
+import kotlin.io.path.readText
private const val MARKETPLACE_BROKEN_PLUGINS_URL = "https://plugins.jetbrains.com/files/brokenPlugins.json"
@@ -22,7 +23,7 @@
val allBrokenPlugins = try {
val jsonFormat = Json { ignoreUnknownKeys = true }
- val content = downloadAsText(MARKETPLACE_BROKEN_PLUGINS_URL)
+ val content = Path.of("BROKEN_PLUGINS_HERE").readText()
jsonFormat.decodeFromString(ListSerializer(MarketplaceBrokenPlugin.serializer()), content)
}
catch (e: Exception) {
--- a/platform/build-scripts/src/org/jetbrains/intellij/build/kotlin/KotlinCompilerDependencyDownloader.kt
+++ b/platform/build-scripts/src/org/jetbrains/intellij/build/kotlin/KotlinCompilerDependencyDownloader.kt
@@ -23,31 +23,11 @@
object KotlinCompilerDependencyDownloader {
fun downloadAndExtractKotlinCompiler(communityRoot: BuildDependenciesCommunityRoot): Path {
- val kotlinJpsPluginVersion = getKotlinJpsPluginVersion(communityRoot)
- val kotlinDistUrl = getUriForMavenArtifact(MAVEN_REPOSITORY_URL, ARTIFACT_GROUP_ID, "kotlin-dist-for-ide", kotlinJpsPluginVersion, "jar")
- val kotlinDistJar = downloadFileToCacheLocation(communityRoot, kotlinDistUrl)
- return extractFileToCacheLocation(communityRoot, kotlinDistJar)
+ return Path.of("KOTLIN_PATH_HERE")
}
suspend fun downloadKotlinJpsPlugin(communityRoot: BuildDependenciesCommunityRoot): Path = withContext(Dispatchers.IO) {
- val kotlinJpsPluginVersion = getKotlinJpsPluginVersion(communityRoot)
- val kotlinJpsPluginUrl = getUriForMavenArtifact(MAVEN_REPOSITORY_URL, ARTIFACT_GROUP_ID, "kotlin-jps-plugin-classpath", kotlinJpsPluginVersion, "jar")
-
- val cacheLocation = getTargetFile(communityRoot, kotlinJpsPluginUrl.toString())
- if (cacheLocation.exists()) {
- return@withContext cacheLocation
- }
-
- // Download file by hand since calling entire ktor/cio/coroutines stuff *before* loading JPS plugin into classpath
- // leads to funny kotlin-reflect failures later in Kotlin JPS plugin
- // Ideal solution would be to move compilation to other process altogether and do not modify current process classpath
- println(" * Downloading $kotlinJpsPluginUrl")
- val tmpLocation = Files.createTempFile(cacheLocation.parent, cacheLocation.name, ".tmp")
- suspendingRetryWithExponentialBackOff {
- FileUtils.copyURLToFile(kotlinJpsPluginUrl.toURL(), tmpLocation.toFile())
- }
- Files.move(tmpLocation, cacheLocation, StandardCopyOption.ATOMIC_MOVE)
- return@withContext cacheLocation
+ return@withContext Path.of("JPS_PLUGIN_CLASSPATH_HERE")
}
fun getKotlinJpsPluginVersion(communityRoot: BuildDependenciesCommunityRoot): String {

View File

@ -0,0 +1,41 @@
--- a/python/build/src/PyCharmCommunityInstallersBuildTarget.kt
+++ b/python/build/src/PyCharmCommunityInstallersBuildTarget.kt
@@ -2,9 +2,11 @@
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
+import org.jetbrains.intellij.build.BuildOptions
import org.jetbrains.intellij.build.BuildTasks
import org.jetbrains.intellij.build.IdeaProjectLoaderUtil
import org.jetbrains.intellij.build.impl.BuildContextImpl
+import org.jetbrains.intellij.build.pycharm.PyCharmBuildUtils
import org.jetbrains.intellij.build.pycharm.PyCharmCommunityProperties
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@@ -12,13 +14,26 @@
@JvmStatic
fun main(args: Array<String>) {
runBlocking(Dispatchers.Default) {
+ val options = BuildOptions().apply {
+ // we cannot provide consistent build number for PyCharm Community if it's built separately so use *.SNAPSHOT number to avoid confusion
+ buildNumber = null
+
+ // do not bother external users about clean/incremental
+ // just remove out/ directory for clean build
+ incrementalCompilation = true
+ useCompiledClassesFromProjectOutput = false
+ buildStepsToSkip.addAll(listOf(
+ BuildOptions.MAC_SIGN_STEP,
+ ))
+ }
val communityHome = IdeaProjectLoaderUtil.guessCommunityHome(javaClass)
val context = BuildContextImpl.createContext(
communityHome = communityHome,
projectHome = communityHome.communityRoot,
productProperties = PyCharmCommunityProperties(communityHome.communityRoot),
+ options = options,
)
BuildTasks.create(context).buildDistributions()
}
}
}

View File

@ -112,7 +112,7 @@ rec {
sed "s|${ide.outPath}|$out|" \
-i $(realpath $out/bin/${meta.mainProgram}) \
-i $(realpath $out/bin/${meta.mainProgram}-remote-dev-server)
autoPatchelf $out/${meta.mainProgram}/bin
autoPatchelf $out
'';
};
}

View File

@ -24,4 +24,6 @@
paths = builtins.concatStringsSep " " ides;
in
writeText "jb-ides" paths;
clion-with-vim = jetbrains.plugins.addPlugins jetbrains.clion [ "ideavim" ];
}

View File

@ -21,7 +21,7 @@ TOKENS = {
}
SNAPSHOT_VALUE = 99999
PLUGINS_FILE = Path(__file__).parent.joinpath("plugins.json").resolve()
IDES_FILE = Path(__file__).parent.joinpath("../versions.json").resolve()
IDES_FILE = Path(__file__).parent.joinpath("../bin/versions.json").resolve()
# The plugin compatibility system uses a different naming scheme to the ide update system.
# These dicts convert between them
FRIENDLY_TO_PLUGIN = {

View File

@ -0,0 +1,65 @@
This directory contains the build expressions needed to build any of the jetbrains IDEs.
The jdk is in `pkgs/development/compilers/jetbrains-jdk`.
To test the build process of every IDE (as well as the process for adding plugins), build `jetbrains.plugins.tests.default`.
## How to use plugins:
- Get the ide you want and call `jetbrains.plugins.addPlugins` with a list of plugins you want to add.
- The list of plugins can be a list of ids or names (as in `plugins/plugins.json`)
- Example: `jetbrains.plugins.addPlugins jetbrains.pycharm-professional [ "nixidea" ]`
- The list can also contain a drv giving a `.jar` or `.zip` (this is how you use a plugin not added to nixpkgs)
### How to add a new plugin to nixpkgs
- Find the page for the plugin on https://plugins.jetbrains.com
- Find the id (it's the number after https://plugins.jetbrains.com/plugin/)
- Run `plugins/update_plugins.py` add (plugin id)
- If binaries need patch or some other special treatment, add an entry to `plugins/specialPlugins.nix`
## How to update stuff:
- Run ./bin/update_bin.py
- This will update binary IDEs and plugins, and automatically commit them
- Source builds need a bit more effort, as they aren't automated at the moment:
- Find the build of the stable release you want to target (usually different for pycharm and idea, should have three components)
- I find this at https://jetbrains.com/updates/updates.xml (search for `fullNumber`)
- Update the `buildVer` field in source/default.nix
- Empty the `ideaHash`, `androidHash` and `jpsHash` (only `ideaHash` changes on a regular basis) fields and try to build to get the new hashes
- Run `nix build .#jetbrains.(idea/pycharm)-community-source.src`, then `./source/build_maven.py source/idea_maven_artefacts.json result/`
- Update `source/brokenPlugins.json` (from https://plugins.jetbrains.com/files/brokenPlugins.json)
- Do a test build
- If it succeeds, make a PR/merge
- If it fails, ping/message GenericNerdyUsername
## How to add an IDE:
- Make dummy entries in `bin/versions.json` (make sure to set the version to something older than the real one)
- Run `bin/update_bin.py`
- Add an entry in `bin/ides.json`
- Add an entry in `default.nix`
### TODO:
- move/copy plugin docs to nixpkgs manual
- replace `libxcrypt-legacy` with `libxcrypt` when supported
- make `jetbrains-remote-dev.patch` cleaner
- is extraLdPath needed for IDEA?
- set meta.sourceProvenance for everything
- from source builds:
- remove timestamps in output `.jar` of `jps-bootstrap`
- automated update scripts
- fetch `.jar` s from stuff built in nixpkgs when available
- what stuff built in nixpkgs provides `.jar`s we care about?
- kotlin
- make `configurePhase` respect `$NIX_BUILD_CORES`
- make the subdir of the resulting tar.gz always have a release number (2023.2.2) instead of a build number (232.9921.89)
- jdk:
- build on darwin
- use chromium stuff built by nixpkgs for jcef?
- make `buildPhase` respect `$NIX_BUILD_CORES`
- automated update script?
- on `aarch64-linux`:
- test plugins
- from source build
- see if build (binary or source) works without expat
- on `x86_64-darwin`:
- test plugins
- from source build
- on `aarch64-darwin`:
- test plugins
- from source build

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,264 @@
{ fetchFromGitHub
, fetchurl
, lib
, linkFarm
, makeWrapper
, runCommand
, stdenv
, stdenvNoCC
, ant
, cmake
, glib
, jetbrains
, kotlin
, libdbusmenu
, maven
, p7zip
, pkg-config
, xorg
, buildVer
, buildType
, ideaHash
, androidHash
, jpsHash
, mvnDeps
}:
let
jbr = jetbrains.jdk-no-jcef;
ideaSrc = fetchFromGitHub {
owner = "jetbrains";
repo = "intellij-community";
rev = "${buildType}/${buildVer}";
hash = ideaHash;
};
androidSrc = fetchFromGitHub {
owner = "jetbrains";
repo = "android";
rev = "${buildType}/${buildVer}";
hash = androidHash;
};
src = runCommand "source" { } ''
cp -r ${ideaSrc} $out
chmod +w -R $out
cp -r ${androidSrc} $out/android
'';
libdbusmenu-jb = libdbusmenu.overrideAttrs (old: {
version = "jetbrains-fork";
src = fetchFromGitHub {
owner = "jetbrains";
repo = "libdbusmenu";
rev = "d8a49303f908a272e6670b7cee65a2ba7c447875";
hash = "sha256-u87ZgbfeCPJ0qG8gsom3gFaZxbS5NcHEodb0EVakk60=";
};
configureFlags = old.configureFlags ++ [
"--enable-static"
];
installPhase = ''
runHook preInstall
mkdir -p $out/lib
cp libdbusmenu-glib/.libs/libdbusmenu-glib.a $out/lib
runHook postInstall
'';
});
libdbm = stdenv.mkDerivation {
pname = "libdbm";
version = buildVer;
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ glib xorg.libX11 libdbusmenu ];
inherit src;
sourceRoot = "source/native/LinuxGlobalMenu";
patches = [ ../patches/libdbm-headers.patch ];
postPatch = "cp ${libdbusmenu-jb}/lib/libdbusmenu-glib.a libdbusmenu-glib.a";
passthru.patched-libdbusmenu = libdbusmenu-jb;
installPhase = ''
runHook preInstall
mkdir -p $out/lib
mv libdbm.so $out/lib/libdbm.so
runHook postInstall
'';
};
fsnotifier = stdenv.mkDerivation {
pname = "fsnotifier";
version = buildVer;
inherit src;
sourceRoot = "source/native/fsNotifier/linux";
buildPhase = ''
runHook preBuild
cc -O2 -Wall -Wextra -Wpedantic -D "VERSION=\"${buildVer}\"" -std=c11 main.c inotify.c util.c -o fsnotifier
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mv fsnotifier $out/bin
runHook postInstall
'';
};
jpsRepo = runCommand "jps-bootstrap-repository"
{
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = jpsHash;
nativeBuildInputs = [ ant jbr ];
} ''
ant -Duser.home=$out -Dbuild.dir=/build/tmp -f ${src}/platform/jps-bootstrap/jps-bootstrap-classpath.xml
find $out -type f \( \
-name \*.lastUpdated \
-o -name resolver-status.properties \
-o -name _remote.repositories \) \
-delete
'';
jps-bootstrap = stdenvNoCC.mkDerivation {
pname = "jps-bootstrap";
version = buildVer;
inherit src;
sourceRoot = "source/platform/jps-bootstrap";
nativeBuildInputs = [ ant makeWrapper jbr ];
patches = [ ../patches/kotlinc-path.patch ];
postPatch = "sed -i 's|KOTLIN_PATH_HERE|${kotlin}|' src/main/java/org/jetbrains/jpsBootstrap/KotlinCompiler.kt";
buildPhase = ''
runHook preInstall
ant -Duser.home=${jpsRepo} -Dbuild.dir=/build/out -f jps-bootstrap-classpath.xml
runHook postInstall
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/java/
cp /build/out/jps-bootstrap.classes.jar $out/share/java/jps-bootstrap.jar
cp -r /build/out/jps-bootstrap.out.lib $out/share/java/jps-bootstrap-classpath
makeWrapper ${jbr}/bin/java $out/bin/jps-bootstrap \
--add-flags "-cp $out/share/java/jps-bootstrap-classpath/'*' org.jetbrains.jpsBootstrap.JpsBootstrapMain"
runHook postInstall
'';
};
artefactsJson = lib.importJSON mvnDeps;
mkRepoEntry = entry: {
name = ".m2/repository/" + entry.path;
path = fetchurl {
urls = [
"https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/${entry.url}"
"https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/ij/intellij-dependencies/${entry.url}"
"https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide-plugin-dependencies/${entry.url}"
"https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/grazi/grazie-platform-public/${entry.url}"
"https://cache-redirector.jetbrains.com/dl.google.com/dl/android/maven2/${entry.url}"
"https://packages.jetbrains.team/maven/p/kpm/public/${entry.url}"
"https://packages.jetbrains.team/maven/p/dpgpv/maven/${entry.url}"
"https://cache-redirector.jetbrains.com/download.jetbrains.com/teamcity-repository/${entry.url}"
];
sha256 = entry.hash;
};
};
mvnRepo = linkFarm "intellij-deps" (map mkRepoEntry artefactsJson);
kotlin-jps-plugin-classpath =
let
repoUrl = "https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide-plugin-dependencies";
groupId = builtins.replaceStrings [ "." ] [ "/" ] "org.jetbrains.kotlin";
artefactId = "kotlin-jps-plugin-classpath";
version = "1.8.20";
in
fetchurl {
url = repoUrl + "/" + groupId + "/" + artefactId + "/" + version + "/" + artefactId + "-" + version + ".jar";
hash = "sha256-w+vmEBSXGcyvxHB3byIOFjTeCIC7tkWh9rvOoP0//9A=";
};
targetClass = if buildType == "pycharm" then "intellij.pycharm.community.build" else "intellij.idea.community.build";
targetName = if buildType == "pycharm" then "PyCharmCommunityInstallersBuildTarget" else "OpenSourceCommunityInstallersBuildTarget";
in
stdenvNoCC.mkDerivation rec {
pname = "${buildType}-community";
version = buildVer;
name = "${pname}-${version}.tar.gz";
inherit src;
nativeBuildInputs = [ p7zip jbr jps-bootstrap ];
repo = mvnRepo;
patches = [
../patches/no-download.patch
../patches/pycharm-build-fix.patch
];
postPatch = ''
cp ${fsnotifier}/bin/fsnotifier bin/linux/amd64/fsnotifier
cp ${libdbm}/lib/libdbm.so bin/linux/amd64/libdbm.so
sed \
-e 's|JPS_PLUGIN_CLASSPATH_HERE|${kotlin-jps-plugin-classpath}|' \
-e 's|KOTLIN_PATH_HERE|${kotlin}|' \
-i platform/build-scripts/src/org/jetbrains/intellij/build/kotlin/KotlinCompilerDependencyDownloader.kt
sed \
-e 's|JDK_PATH_HERE|${jbr}/lib/openjdk|' \
-i platform/build-scripts/downloader/src/org/jetbrains/intellij/build/dependencies/JdkDownloader.kt
sed \
-e 's|BROKEN_PLUGINS_HERE|${./brokenPlugins.json}|' \
-i platform/build-scripts/src/org/jetbrains/intellij/build/impl/brokenPlugins.kt
sed \
-e 's|MAVEN_REPO_HERE|${mvnRepo}/.m2/repository/|' \
-e 's|MAVEN_PATH_HERE|${maven}/maven|' \
-i build/deps/src/org/jetbrains/intellij/build/impl/BundledMavenDownloader.kt
echo '${buildVer}' > build.txt
'';
configurePhase = ''
runHook preConfigure
# Will need removing after update
cp plugins/devkit/devkit-core/src/run/OpenedPackages.txt platform/platform-impl/resources/META-INF/OpenedPackages.txt
ln -s "$repo"/.m2 /build/.m2
export JPS_BOOTSTRAP_COMMUNITY_HOME=/build/source
jps-bootstrap \
-Dbuild.number=${buildVer} \
-Djps.kotlin.home=${kotlin} \
-Dintellij.build.target.os=linux \
-Dintellij.build.target.arch=x64 \
-Dintellij.build.skip.build.steps=mac_artifacts,mac_dmg,mac_sit,windows_exe_installer,windows_sign,repair_utility_bundle_step \
-Dintellij.build.unix.snaps=false \
--java-argfile-target=java_argfile \
/build/source \
${targetClass} \
${targetName}
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
java \
-Djps.kotlin.home=${kotlin} \
"@java_argfile"
runHook postBuild
'';
installPhase = ''
runHook preInstall
mv out/*/artifacts/*-no-jbr.tar.gz $out
runHook postInstall
'';
passthru = {
inherit libdbm fsnotifier jps-bootstrap;
};
}

View File

@ -0,0 +1,94 @@
#!/usr/bin/env nix-shell
# ! nix-shell -i python3 -p python3 python3.pkgs.xmltodict
import os
from argparse import ArgumentParser
from xmltodict import parse
from json import dump
from sys import stdout
def get_args() -> (str, list[str]):
parser = ArgumentParser(
description="Given the path of a intellij source tree, make a list of urls and hashes of maven artefacts required to build"
)
parser.add_argument("out", help="File to output json to")
parser.add_argument("path", help="Path to the intellij-community source dir")
args = parser.parse_args()
return args.path, args.out
def ensure_is_list(x):
if type(x) != list:
return [x]
return x
def add_entries(sources, targets, hashes):
for num, artefact in enumerate(sources):
hashes.append({
"url": artefact["@url"][26:],
"hash": artefact["sha256sum"],
"path": targets[num]["@url"][25:-2]
})
def add_libraries(root_path: str, hashes: list[dict[str, str]], projects_to_process: list[str]):
library_paths = os.listdir(root_path + "/libraries/")
for path in library_paths:
file_contents = parse(open(root_path + "/libraries/" + path).read())
if "properties" not in file_contents["component"]["library"]:
continue
sources = ensure_is_list(file_contents["component"]["library"]["properties"]["verification"]["artifact"])
targets = ensure_is_list(file_contents["component"]["library"]["CLASSES"]["root"])
add_entries(sources, targets, hashes)
modules_xml = parse(open(root_path+"/modules.xml").read())
for entry in modules_xml["project"]["component"]:
if entry["@name"] != "ProjectModuleManager":
continue
for module in entry["modules"]["module"]:
projects_to_process.append(module["@filepath"])
def add_iml(path: str, hashes: list[dict[str, str]], projects_to_process: list[str]):
try:
contents = parse(open(path).read())
except FileNotFoundError:
print(f"Warning: path {path} does not exist (did you forget the android directory?)")
return
for manager in ensure_is_list(contents["module"]["component"]):
if manager["@name"] != "NewModuleRootManager":
continue
for entry in manager["orderEntry"]:
if type(entry) != dict or \
entry["@type"] != "module-library" or \
"properties" not in entry["library"]:
continue
sources = ensure_is_list(entry["library"]["properties"]["verification"]["artifact"])
targets = ensure_is_list(entry["library"]["CLASSES"]["root"])
add_entries(sources, targets, hashes)
def main():
root_path, out = get_args()
file_hashes = []
projects_to_process: list[str] = [root_path+"/.idea"]
while projects_to_process:
elem = projects_to_process.pop()
elem = elem.replace("$PROJECT_DIR$", root_path)
if elem.endswith(".iml"):
add_iml(elem, file_hashes, projects_to_process)
else:
add_libraries(elem, file_hashes, projects_to_process)
if out == "stdout":
dump(file_hashes, stdout, indent=4)
else:
file = open(out, "w")
dump(file_hashes, file, indent=4)
file.write("\n")
if __name__ == '__main__':
main()

View File

@ -0,0 +1,21 @@
{ callPackage
}:
{
idea-community = callPackage ./build.nix {
buildVer = "232.9921.47";
buildType = "idea";
ideaHash = "sha256-sibp2Pa+NNHEeHMDRol45XOK0JzEhIZeI7TY04SkIx4=";
androidHash = "sha256-bc/UlR0DJQiQ3mdscucHkvzkSQxD0KnDFIM9UIb7Inw=";
jpsHash = "sha256-dBz64oATg45BMwd6etncQm84eHQSfSE9kDbuU9IVpmo=";
mvnDeps = ./idea_maven_artefacts.json;
};
pycharm-community = callPackage ./build.nix {
buildVer = "232.10072.31";
buildType = "pycharm";
ideaHash = "sha256-NTQGz5HViQlJQaxcAnsliZS4NCKScVqx25FMILkBjpk=";
androidHash = "sha256-bc/UlR0DJQiQ3mdscucHkvzkSQxD0KnDFIM9UIb7Inw=";
jpsHash = "sha256-dBz64oATg45BMwd6etncQm84eHQSfSE9kDbuU9IVpmo=";
mvnDeps = ./idea_maven_artefacts.json;
};
}

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,7 @@
, unzip
, rsync
, debugBuild ? false
, withJcef ? true
, libXdamage
, libXxf86vm
@ -27,6 +28,8 @@
, udev
}:
assert debugBuild -> withJcef;
let
arch = {
"aarch64-linux" = "aarch64";
@ -35,37 +38,36 @@ let
cpu = stdenv.hostPlatform.parsed.cpu.name;
in
openjdk17.overrideAttrs (oldAttrs: rec {
pname = "jetbrains-jdk-jcef";
javaVersion = "17.0.7";
build = "829.16";
pname = "jetbrains-jdk" + lib.optionalString withJcef "-jcef";
javaVersion = "17.0.8";
build = "1000.8";
# To get the new tag:
# git clone https://github.com/jetbrains/jetbrainsruntime
# cd jetbrainsruntime
# git reset --hard [revision]
# git log --simplify-by-decoration --decorate=short --pretty=short | grep "jdk-" | cut -d "(" -f2 | cut -d ")" -f1 | awk '{print $2}' | sort -t "-" -k 2 -g | tail -n 1
openjdkTag = "jdk-18+0";
# git log --simplify-by-decoration --decorate=short --pretty=short | grep "jbr-" --color=never | cut -d "(" -f2 | cut -d ")" -f1 | awk '{print $2}' | sort -t "-" -k 2 -g | tail -n 1 | tr -d ","
openjdkTag = "jbr-17.0.7+7";
version = "${javaVersion}-b${build}";
src = fetchFromGitHub {
owner = "JetBrains";
repo = "JetBrainsRuntime";
rev = "jb${version}";
hash = "sha256-b3wW52knkYUeG8h4naTQLGUedhAMiPnUsn3zFAiJCwM=";
hash = "sha256-PXS8wRF37D9vzeC4CvmB3szFMbt+NRqhQqtPZcbeAO8=";
};
BOOT_JDK = openjdk17-bootstrap.home;
SOURCE_DATE_EPOCH = 1666098567;
# run `git log -1 --pretty=%ct` in jdk repo for new value on update
SOURCE_DATE_EPOCH = 1691119859;
patches = [];
patches = [ ];
# Configure is done in build phase
configurePhase = "true";
dontConfigure = true;
buildPhase = ''
runHook preBuild
mkdir -p jcef_linux_${arch}/jmods
cp ${jetbrains.jcef}/* jcef_linux_${arch}/jmods
${lib.optionalString withJcef "cp -r ${jetbrains.jcef} jcef_linux_${arch}"}
sed \
-e "s/OPENJDK_TAG=.*/OPENJDK_TAG=${openjdkTag}/" \
@ -79,64 +81,66 @@ openjdk17.overrideAttrs (oldAttrs: rec {
-i jb/project/tools/linux/scripts/mkimages_${arch}.sh
patchShebangs .
./jb/project/tools/linux/scripts/mkimages_${arch}.sh ${build} ${if debugBuild then "fd" else "jcef"}
./jb/project/tools/linux/scripts/mkimages_${arch}.sh ${build} ${if debugBuild then "fd" else (if withJcef then "jcef" else "nomod")}
runHook postBuild
'';
installPhase = let
buildType = if debugBuild then "fastdebug" else "release";
debugSuffix = lib.optionalString debugBuild "-fastdebug";
jcefSuffix = lib.optionalString (!debugBuild) "_jcef";
in ''
runHook preInstall
installPhase =
let
buildType = if debugBuild then "fastdebug" else "release";
debugSuffix = if debugBuild then "-fastdebug" else "";
jcefSuffix = if debugBuild || !withJcef then "" else "_jcef";
jbrsdkDir = "jbrsdk${jcefSuffix}-${javaVersion}-linux-${arch}${debugSuffix}-b${build}";
in
''
runHook preInstall
mv build/linux-${cpu}-server-${buildType}/images/jdk/man build/linux-${cpu}-server-${buildType}/images/jbrsdk${jcefSuffix}-${javaVersion}-linux-${arch}${debugSuffix}-b${build}
rm -rf build/linux-${cpu}-server-${buildType}/images/jdk
mv build/linux-${cpu}-server-${buildType}/images/jbrsdk${jcefSuffix}-${javaVersion}-linux-${arch}${debugSuffix}-b${build} build/linux-${cpu}-server-${buildType}/images/jdk
'' + oldAttrs.installPhase + "runHook postInstall";
rm -rf build/linux-${cpu}-server-${buildType}/images/jdk
mv build/linux-${cpu}-server-${buildType}/images/${jbrsdkDir} build/linux-${cpu}-server-${buildType}/images/jdk
'' + oldAttrs.installPhase + "runHook postInstall";
postInstall = ''
postInstall = lib.optionalString withJcef ''
chmod +x $out/lib/openjdk/lib/chrome-sandbox
'';
dontStrip = debugBuild;
postFixup = ''
# Build the set of output library directories to rpath against
LIBDIRS="${lib.makeLibraryPath [
libXdamage libXxf86vm libXrandr libXi libXcursor libXrender libX11 libXext libxcb
nss nspr libdrm mesa wayland udev
]}"
for output in $outputs; do
if [ "$output" = debug ]; then continue; fi
LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort -u | tr '\n' ':'):$LIBDIRS"
# Build the set of output library directories to rpath against
LIBDIRS="${lib.makeLibraryPath [
libXdamage libXxf86vm libXrandr libXi libXcursor libXrender libX11 libXext libxcb
nss nspr libdrm mesa wayland udev
]}"
for output in $outputs; do
if [ "$output" = debug ]; then continue; fi
LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort -u | tr '\n' ':'):$LIBDIRS"
done
# Add the local library paths to remove dependencies on the bootstrap
for output in $outputs; do
if [ "$output" = debug ]; then continue; fi
OUTPUTDIR=$(eval echo \$$output)
BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*)
echo "$BINLIBS" | while read i; do
patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true
patchelf --shrink-rpath "$i" || true
done
# Add the local library paths to remove dependencies on the bootstrap
for output in $outputs; do
if [ "$output" = debug ]; then continue; fi
OUTPUTDIR=$(eval echo \$$output)
BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*)
echo "$BINLIBS" | while read i; do
patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true
patchelf --shrink-rpath "$i" || true
done
done
'';
done
'';
nativeBuildInputs = [ git autoconf unzip rsync ] ++ oldAttrs.nativeBuildInputs;
meta = with lib; {
description = "An OpenJDK fork to better support Jetbrains's products.";
longDescription = ''
JetBrains Runtime is a runtime environment for running IntelliJ Platform
based products on Windows, Mac OS X, and Linux. JetBrains Runtime is
based on OpenJDK project with some modifications. These modifications
include: Subpixel Anti-Aliasing, enhanced font rendering on Linux, HiDPI
support, ligatures, some fixes for native crashes not presented in
official build, and other small enhancements.
JetBrains Runtime is not a certified build of OpenJDK. Please, use at
your own risk.
JetBrains Runtime is a runtime environment for running IntelliJ Platform
based products on Windows, Mac OS X, and Linux. JetBrains Runtime is
based on OpenJDK project with some modifications. These modifications
include: Subpixel Anti-Aliasing, enhanced font rendering on Linux, HiDPI
support, ligatures, some fixes for native crashes not presented in
official build, and other small enhancements.
JetBrains Runtime is not a certified build of OpenJDK. Please, use at
your own risk.
'';
homepage = "https://confluence.jetbrains.com/display/JBR/JetBrains+Runtime";
inherit (openjdk17.meta) license platforms mainProgram;

View File

@ -44,60 +44,62 @@
assert !stdenv.isDarwin;
# I can't test darwin
let rpath = lib.makeLibraryPath [
glib
nss
nspr
atk
at-spi2-atk
libdrm
expat
libxcb
libxkbcommon
libX11
libXcomposite
libXdamage
libXext
libXfixes
libXrandr
mesa
gtk3
pango
cairo
alsa-lib
dbus
at-spi2-core
cups
libxshmfence
udev
];
let
rpath = lib.makeLibraryPath [
glib
nss
nspr
atk
at-spi2-atk
libdrm
expat
libxcb
libxkbcommon
libX11
libXcomposite
libXdamage
libXext
libXfixes
libXrandr
mesa
gtk3
pango
cairo
alsa-lib
dbus
at-spi2-core
cups
libxshmfence
udev
];
buildType = if debugBuild then "Debug" else "Release";
platform = {
"aarch64-linux" = "linuxarm64";
"x86_64-linux" = "linux64";
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
arches = {
"linuxarm64" = {
depsArch = "arm64";
projectArch = "arm64";
targetArch = "arm64";
};
"linux64" = {
depsArch = "amd64";
projectArch = "x86_64";
targetArch = "x86_64";
};
}.${platform};
inherit (arches) depsArch projectArch targetArch;
buildType = if debugBuild then "Debug" else "Release";
platform = {
"aarch64-linux" = "linuxarm64";
"x86_64-linux" = "linux64";
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
arches = {
"linuxarm64" = {
depsArch = "arm64";
projectArch = "arm64";
targetArch = "arm64";
};
"linux64" = {
depsArch = "amd64";
projectArch = "x86_64";
targetArch = "x86_64";
};
}.${platform};
inherit (arches) depsArch projectArch targetArch;
in stdenv.mkDerivation rec {
in
stdenv.mkDerivation rec {
pname = "jcef-jetbrains";
rev = "1ac1c682c497f2b864f86050796461f22935ea64";
rev = "9f8d4fb20b4658db6b2b6bc08e5dd0d8c7340290";
# This is the commit number
# Currently from the branch: https://github.com/JetBrains/jcef/tree/232
# Run `git rev-list --count HEAD`
version = "672";
version = "675";
nativeBuildInputs = [ cmake python3 jdk17 git rsync ant ninja ];
buildInputs = [ libX11 libXdamage nss nspr ];
@ -106,19 +108,22 @@ in stdenv.mkDerivation rec {
owner = "jetbrains";
repo = "jcef";
inherit rev;
hash = "sha256-3HuW8upR/bZoK8euVti2KpCZh9xxfqgyHmgoG1NjxOI=";
};
cef-bin = let
name = "cef_binary_111.2.1+g870da30+chromium-111.0.5563.64_${platform}_minimal";
hash = {
"linuxarm64" = "sha256-gCDIfWsysXE8lHn7H+YM3Jag+mdbWwTQpJf0GKdXEVs=";
"linux64" = "sha256-r+zXTmDN5s/bYLvbCnHufYdXIqQmCDlbWgs5pdOpLTw=";
}.${platform};
urlName = builtins.replaceStrings ["+"] ["%2B"] name;
in fetchzip {
url = "https://cef-builds.spotifycdn.com/${urlName}.tar.bz2";
inherit name hash;
hash = "sha256-8zsgcWl0lZtC1oud5IlkUdeXxJUlHoRfw8t0FrZUQec=";
};
cef-bin =
let
# `cef_binary_${CEF_VERSION}_linux64_minimal`, where CEF_VERSION is from $src/CMakeLists.txt
name = "cef_binary_111.2.1+g870da30+chromium-111.0.5563.64_${platform}_minimal";
hash = {
"linuxarm64" = "sha256-gCDIfWsysXE8lHn7H+YM3Jag+mdbWwTQpJf0GKdXEVs=";
"linux64" = "sha256-r+zXTmDN5s/bYLvbCnHufYdXIqQmCDlbWgs5pdOpLTw=";
}.${platform};
urlName = builtins.replaceStrings [ "+" ] [ "%2B" ] name;
in
fetchzip {
url = "https://cef-builds.spotifycdn.com/${urlName}.tar.bz2";
inherit name hash;
};
clang-fmt = fetchurl {
url = "https://storage.googleapis.com/chromium-clang-format/dd736afb28430c9782750fc0fd5f0ed497399263";
hash = "sha256-4H6FVO9jdZtxH40CSfS+4VESAHgYgYxfCBFSMHdT0hE=";
@ -228,7 +233,9 @@ in stdenv.mkDerivation rec {
mkdir lib
cp -R "$OUT_NATIVE_DIR"/* lib
mkdir $out
mkdir -p $out/jmods
bash "$JB_TOOLS_DIR"/common/create_version_file.sh $out
runHook postInstall
'';
@ -237,11 +244,11 @@ in stdenv.mkDerivation rec {
postFixup = ''
cd $unpacked/gluegen
jmod create --class-path gluegen-rt.jar --libs lib $out/gluegen.rt.jmod
jmod create --class-path gluegen-rt.jar --libs lib $out/jmods/gluegen.rt.jmod
cd ../jogl
jmod create --module-path . --class-path jogl-all.jar --libs lib $out/jogl.all.jmod
jmod create --module-path . --class-path jogl-all.jar --libs lib $out/jmods/jogl.all.jmod
cd ../jcef
jmod create --module-path . --class-path jcef.jar --libs lib $out/jcef.jmod
jmod create --module-path . --class-path jcef.jar --libs lib $out/jmods/jcef.jmod
'';
meta = {

View File

@ -32127,6 +32127,7 @@ with pkgs;
vmopts = config.jetbrains.vmopts or null;
jdk = jetbrains.jdk;
}) // {
jdk-no-jcef = callPackage ../development/compilers/jetbrains-jdk { withJcef = false; };
jdk = callPackage ../development/compilers/jetbrains-jdk { };
jcef = callPackage ../development/compilers/jetbrains-jdk/jcef.nix { };
});