lol

Merge pull request #82361 from petabyteboy/feature/jbr-from-source

jetbrains.jdk: build from source

authored by

Frederik Rietdijk and committed by
GitHub
3a2c21dc f9e13566

+17 -53
+17 -53
pkgs/development/compilers/jetbrains-jdk/default.nix
··· 1 - { stdenv, lib, fetchurl, file, glib, libxml2, libav_0_8, ffmpeg, libxslt 2 - , libGL , xorg, alsaLib, fontconfig, freetype, pango, gtk2, cairo 3 - , gdk-pixbuf, atk, zlib }: 4 - 5 - # TODO: Investigate building from source instead of patching binaries. 6 - # TODO: Binary patching for not just x86_64-linux but also x86_64-darwin i686-linux 7 - 8 - let drv = stdenv.mkDerivation rec { 9 - pname = "jetbrainsjdk"; 10 - version = "520.38"; 11 - 12 - src = if stdenv.hostPlatform.system == "x86_64-linux" then 13 - fetchurl { 14 - url = "https://bintray.com/jetbrains/intellij-jbr/download_file?file_path=jbrsdk-11_0_5-linux-x64-b${version}.tar.gz"; 15 - sha256 = "13hqp9ww9afkl70yrslyyx0z7fqcc8nrcqax69d6jaj587qfjqvz"; 16 - } 17 - else if stdenv.hostPlatform.system == "x86_64-darwin" then 18 - fetchurl { 19 - url = "https://bintray.com/jetbrains/intellij-jbr/download_file?file_path=jbrsdk-11_0_5-osx-x64-b${version}.tar.gz"; 20 - sha256 = "1qrw4rpyznx7pkcjlfhi889l3a7gydz9yrqp6phz1rszmklpyk07"; 21 - } 22 - else 23 - throw "unsupported system: ${stdenv.hostPlatform.system}"; 24 - 25 - nativeBuildInputs = [ file ]; 26 - 27 - unpackCmd = "mkdir jdk; pushd jdk; tar -xzf $src; popd"; 28 - 29 - installPhase = '' 30 - cd .. 31 - 32 - mv $sourceRoot/jbrsdk $out 33 - ''; 34 - 35 - postFixup = lib.optionalString (!stdenv.isDarwin) '' 36 - find $out -type f -perm -0100 \ 37 - -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 38 - --set-rpath "$rpath" {} \; 39 - find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \; 40 - ''; 1 + { stdenv, openjdk12, fetchFromGitHub, jetbrains }: 41 2 42 - rpath = lib.optionalString (!stdenv.isDarwin) (lib.makeLibraryPath ([ 43 - stdenv.cc.cc stdenv.cc.libc glib libxml2 libav_0_8 ffmpeg libxslt libGL 44 - alsaLib fontconfig freetype pango gtk2 cairo gdk-pixbuf atk zlib 45 - (placeholder "out") 46 - ] ++ (with xorg; [ 47 - libX11 libXext libXtst libXi libXp libXt libXrender libXxf86vm 48 - ])) + ":${placeholder "out"}/lib/jli"); 49 - 50 - passthru.home = drv; 51 - 3 + openjdk12.overrideAttrs (oldAttrs: rec { 4 + pname = "jetbrains-jdk"; 5 + version = "11.0.6-b774"; 6 + src = fetchFromGitHub { 7 + owner = "JetBrains"; 8 + repo = "JetBrainsRuntime"; 9 + rev = "jb${stdenv.lib.replaceStrings ["."] ["_"] version}"; 10 + sha256 = "0lx3h74jwa14kr8ybwxbzc4jsjj6xnymvckdsrhqhvrciya7bxzw"; 11 + }; 12 + patches = []; 52 13 meta = with stdenv.lib; { 53 14 description = "An OpenJDK fork to better support Jetbrains's products."; 54 15 longDescription = '' ··· 64 25 ''; 65 26 homepage = "https://bintray.com/jetbrains/intellij-jdk/"; 66 27 license = licenses.gpl2; 67 - maintainers = with maintainers; [ edwtjo ]; 68 - platforms = with platforms; [ "x86_64-linux" "x86_64-darwin" ]; 28 + maintainers = with maintainers; [ edwtjo petabyteboy ]; 29 + platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "armv7l-linux" "armv6l-linux" ]; 30 + }; 31 + passthru = oldAttrs.passthru // { 32 + home = "${jetbrains.jdk}/lib/openjdk"; 69 33 }; 70 - }; in drv 34 + })