2017-09-21 08:48:02 +00:00
|
|
|
{ stdenv, lib, fetchurl, file, glib, libxml2, libav_0_8, ffmpeg, libxslt
|
2018-02-24 12:06:44 +00:00
|
|
|
, libGL , xorg, alsaLib, fontconfig, freetype, pango, gtk2, cairo
|
2019-05-22 11:03:39 +00:00
|
|
|
, gdk-pixbuf, atk, zlib }:
|
2017-09-04 18:02:02 +00:00
|
|
|
|
2017-09-21 08:48:02 +00:00
|
|
|
# TODO: Investigate building from source instead of patching binaries.
|
|
|
|
# TODO: Binary patching for not just x86_64-linux but also x86_64-darwin i686-linux
|
|
|
|
|
|
|
|
let drv = stdenv.mkDerivation rec {
|
|
|
|
pname = "jetbrainsjdk";
|
2020-02-14 16:54:40 +00:00
|
|
|
version = "520.38";
|
2017-09-21 08:48:02 +00:00
|
|
|
|
2018-08-20 19:11:29 +00:00
|
|
|
src = if stdenv.hostPlatform.system == "x86_64-linux" then
|
2017-09-21 08:48:02 +00:00
|
|
|
fetchurl {
|
2020-01-23 11:57:44 +00:00
|
|
|
url = "https://bintray.com/jetbrains/intellij-jbr/download_file?file_path=jbrsdk-11_0_5-linux-x64-b${version}.tar.gz";
|
2020-02-14 16:54:40 +00:00
|
|
|
sha256 = "13hqp9ww9afkl70yrslyyx0z7fqcc8nrcqax69d6jaj587qfjqvz";
|
2017-09-21 08:48:02 +00:00
|
|
|
}
|
2019-07-09 06:48:26 +00:00
|
|
|
else if stdenv.hostPlatform.system == "x86_64-darwin" then
|
|
|
|
fetchurl {
|
2020-01-23 11:57:44 +00:00
|
|
|
url = "https://bintray.com/jetbrains/intellij-jbr/download_file?file_path=jbrsdk-11_0_5-osx-x64-b${version}.tar.gz";
|
2020-02-14 16:54:40 +00:00
|
|
|
sha256 = "1qrw4rpyznx7pkcjlfhi889l3a7gydz9yrqp6phz1rszmklpyk07";
|
2019-07-09 06:48:26 +00:00
|
|
|
}
|
2017-09-21 08:48:02 +00:00
|
|
|
else
|
2018-08-20 19:11:29 +00:00
|
|
|
throw "unsupported system: ${stdenv.hostPlatform.system}";
|
2017-09-21 08:48:02 +00:00
|
|
|
|
2017-09-04 18:02:02 +00:00
|
|
|
nativeBuildInputs = [ file ];
|
|
|
|
|
|
|
|
unpackCmd = "mkdir jdk; pushd jdk; tar -xzf $src; popd";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
cd ..
|
|
|
|
|
2019-08-29 19:13:44 +00:00
|
|
|
mv $sourceRoot/jbrsdk $out
|
2017-09-04 18:02:02 +00:00
|
|
|
'';
|
|
|
|
|
2019-07-09 06:48:26 +00:00
|
|
|
postFixup = lib.optionalString (!stdenv.isDarwin) ''
|
2017-09-04 18:02:02 +00:00
|
|
|
find $out -type f -perm -0100 \
|
|
|
|
-exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "$rpath" {} \;
|
|
|
|
find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
|
|
|
|
'';
|
|
|
|
|
2019-07-09 06:48:26 +00:00
|
|
|
rpath = lib.optionalString (!stdenv.isDarwin) (lib.makeLibraryPath ([
|
2018-02-24 12:06:44 +00:00
|
|
|
stdenv.cc.cc stdenv.cc.libc glib libxml2 libav_0_8 ffmpeg libxslt libGL
|
2019-05-22 11:03:39 +00:00
|
|
|
alsaLib fontconfig freetype pango gtk2 cairo gdk-pixbuf atk zlib
|
2019-04-25 11:55:05 +00:00
|
|
|
(placeholder "out")
|
2017-09-21 08:48:02 +00:00
|
|
|
] ++ (with xorg; [
|
|
|
|
libX11 libXext libXtst libXi libXp libXt libXrender libXxf86vm
|
2019-07-09 06:48:26 +00:00
|
|
|
])) + ":${placeholder "out"}/lib/jli");
|
2017-09-21 08:48:02 +00:00
|
|
|
|
|
|
|
passthru.home = drv;
|
2017-09-04 18:02:02 +00:00
|
|
|
|
2017-09-21 08:48:02 +00:00
|
|
|
meta = with stdenv.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.
|
2017-09-04 18:02:02 +00:00
|
|
|
|
2017-09-21 08:48:02 +00:00
|
|
|
JetBrains Runtime is not a certified build of OpenJDK. Please, use at
|
|
|
|
your own risk.
|
|
|
|
'';
|
|
|
|
homepage = "https://bintray.com/jetbrains/intellij-jdk/";
|
2017-12-05 22:20:11 +00:00
|
|
|
license = licenses.gpl2;
|
2017-09-21 08:48:02 +00:00
|
|
|
maintainers = with maintainers; [ edwtjo ];
|
2019-07-09 06:48:26 +00:00
|
|
|
platforms = with platforms; [ "x86_64-linux" "x86_64-darwin" ];
|
2017-09-21 08:48:02 +00:00
|
|
|
};
|
|
|
|
}; in drv
|