2017-09-21 10:48:02 +02:00
|
|
|
{ stdenv, lib, fetchurl, file, glib, libxml2, libav_0_8, ffmpeg, libxslt
|
2018-02-24 13:06:44 +01:00
|
|
|
, libGL , xorg, alsaLib, fontconfig, freetype, pango, gtk2, cairo
|
2017-09-21 10:48:02 +02:00
|
|
|
, gdk_pixbuf, atk }:
|
2017-09-04 20:02:02 +02:00
|
|
|
|
2017-09-21 10:48:02 +02: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";
|
2018-06-08 15:56:12 +02:00
|
|
|
version = "152b1248.6";
|
2017-09-21 10:48:02 +02:00
|
|
|
name = pname + "-" + version;
|
|
|
|
|
2018-08-20 21:11:29 +02:00
|
|
|
src = if stdenv.hostPlatform.system == "x86_64-linux" then
|
2017-09-21 10:48:02 +02:00
|
|
|
fetchurl {
|
|
|
|
url = "https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbsdk8u${version}_linux_x64.tar.gz";
|
2018-06-08 15:56:12 +02:00
|
|
|
sha256 = "12l81g8zhaymh4rzyfl9nyzmpkgzc7wrphm3j4plxx129yn9i7d7";
|
2017-09-21 10:48:02 +02:00
|
|
|
}
|
|
|
|
else
|
2018-08-20 21:11:29 +02:00
|
|
|
throw "unsupported system: ${stdenv.hostPlatform.system}";
|
2017-09-21 10:48:02 +02:00
|
|
|
|
2017-09-04 20:02:02 +02:00
|
|
|
nativeBuildInputs = [ file ];
|
|
|
|
|
|
|
|
unpackCmd = "mkdir jdk; pushd jdk; tar -xzf $src; popd";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
mv $sourceRoot $out
|
|
|
|
jrePath=$out/jre
|
|
|
|
'';
|
|
|
|
|
2017-09-21 10:48:02 +02:00
|
|
|
postFixup = let
|
|
|
|
arch = "amd64";
|
|
|
|
rSubPaths = [
|
|
|
|
"lib/${arch}/jli"
|
|
|
|
"lib/${arch}/server"
|
|
|
|
"lib/${arch}/xawt"
|
|
|
|
"lib/${arch}"
|
|
|
|
];
|
|
|
|
in ''
|
2017-09-04 20:02:02 +02:00
|
|
|
rpath+="''${rpath:+:}${stdenv.lib.concatStringsSep ":" (map (a: "$jrePath/${a}") rSubPaths)}"
|
|
|
|
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" {} \;
|
|
|
|
'';
|
|
|
|
|
2017-09-21 10:48:02 +02:00
|
|
|
rpath = lib.makeLibraryPath ([
|
2018-02-24 13:06:44 +01:00
|
|
|
stdenv.cc.cc stdenv.cc.libc glib libxml2 libav_0_8 ffmpeg libxslt libGL
|
2017-09-21 10:48:02 +02:00
|
|
|
alsaLib fontconfig freetype pango gtk2 cairo gdk_pixbuf atk
|
|
|
|
] ++ (with xorg; [
|
|
|
|
libX11 libXext libXtst libXi libXp libXt libXrender libXxf86vm
|
|
|
|
]));
|
|
|
|
|
|
|
|
passthru.home = drv;
|
2017-09-04 20:02:02 +02:00
|
|
|
|
2017-09-21 10:48:02 +02: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 20:02:02 +02:00
|
|
|
|
2017-09-21 10:48:02 +02: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 23:20:11 +01:00
|
|
|
license = licenses.gpl2;
|
2017-09-21 10:48:02 +02:00
|
|
|
maintainers = with maintainers; [ edwtjo ];
|
|
|
|
platforms = with platforms; [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}; in drv
|