2022-04-01 21:31:40 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, jetbrains
|
|
|
|
, openjdk17
|
2022-10-18 22:17:38 +00:00
|
|
|
, openjdk17-bootstrap
|
|
|
|
, git
|
|
|
|
, autoconf
|
|
|
|
, unzip
|
|
|
|
, rsync
|
|
|
|
, debugBuild ? false
|
|
|
|
|
|
|
|
, libXdamage
|
|
|
|
, libXxf86vm
|
|
|
|
, libXrandr
|
|
|
|
, libXi
|
|
|
|
, libXcursor
|
|
|
|
, libXrender
|
|
|
|
, libX11
|
|
|
|
, libXext
|
|
|
|
, libxcb
|
|
|
|
, nss
|
|
|
|
, nspr
|
|
|
|
, libdrm
|
|
|
|
, mesa
|
|
|
|
, wayland
|
|
|
|
, udev
|
2022-04-01 21:31:40 +00:00
|
|
|
}:
|
2020-03-11 22:20:34 +00:00
|
|
|
|
2022-04-01 21:31:40 +00:00
|
|
|
openjdk17.overrideAttrs (oldAttrs: rec {
|
2022-10-18 22:17:38 +00:00
|
|
|
pname = "jetbrains-jdk-jcef";
|
2023-03-10 22:03:35 +00:00
|
|
|
javaVersion = "17.0.6";
|
|
|
|
build = "829.5";
|
2022-10-18 22:17:38 +00:00
|
|
|
# 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";
|
|
|
|
version = "${javaVersion}-b${build}";
|
2022-02-08 15:27:03 +00:00
|
|
|
|
2020-03-11 22:20:34 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "JetBrains";
|
|
|
|
repo = "JetBrainsRuntime";
|
2021-08-02 02:12:52 +00:00
|
|
|
rev = "jb${version}";
|
2023-03-10 22:03:35 +00:00
|
|
|
hash = "sha256-LTwmuoKKwkuel0a1qcYNnb0d3HBFoABvmqCcrsPyh2I=";
|
2020-03-11 22:20:34 +00:00
|
|
|
};
|
2022-04-01 21:31:40 +00:00
|
|
|
|
2022-10-18 22:17:38 +00:00
|
|
|
BOOT_JDK = openjdk17-bootstrap.home;
|
|
|
|
SOURCE_DATE_EPOCH = 1666098567;
|
|
|
|
|
|
|
|
patches = [];
|
|
|
|
|
|
|
|
# Configure is done in build phase
|
|
|
|
configurePhase = "true";
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
mkdir -p jcef_linux_x64/jmods
|
|
|
|
cp ${jetbrains.jcef}/* jcef_linux_x64/jmods
|
|
|
|
|
|
|
|
sed \
|
|
|
|
-e "s/OPENJDK_TAG=.*/OPENJDK_TAG=${openjdkTag}/" \
|
|
|
|
-e "s/SOURCE_DATE_EPOCH=.*//" \
|
|
|
|
-e "s/export SOURCE_DATE_EPOCH//" \
|
|
|
|
-i jb/project/tools/common/scripts/common.sh
|
|
|
|
sed -i "s/STATIC_CONF_ARGS/STATIC_CONF_ARGS \$configureFlags/" jb/project/tools/linux/scripts/mkimages_x64.sh
|
|
|
|
sed \
|
|
|
|
-e "s/create_image_bundle \"jb/#/" \
|
|
|
|
-e "s/echo Creating /exit 0 #/" \
|
|
|
|
-i jb/project/tools/linux/scripts/mkimages_x64.sh
|
|
|
|
|
|
|
|
patchShebangs .
|
|
|
|
./jb/project/tools/linux/scripts/mkimages_x64.sh ${build} ${if debugBuild then "fd" else "jcef"}
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = let
|
|
|
|
buildType = if debugBuild then "fastdebug" else "release";
|
2023-02-06 20:49:02 +00:00
|
|
|
debugSuffix = lib.optionalString debugBuild "-fastdebug";
|
|
|
|
jcefSuffix = lib.optionalString (!debugBuild) "_jcef";
|
2022-10-18 22:17:38 +00:00
|
|
|
in ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2023-01-15 18:01:20 +00:00
|
|
|
mv build/linux-x86_64-server-${buildType}/images/jdk/man build/linux-x86_64-server-${buildType}/images/jbrsdk${jcefSuffix}-${javaVersion}-linux-x64${debugSuffix}-b${build}
|
2022-10-18 22:17:38 +00:00
|
|
|
rm -rf build/linux-x86_64-server-${buildType}/images/jdk
|
|
|
|
mv build/linux-x86_64-server-${buildType}/images/jbrsdk${jcefSuffix}-${javaVersion}-linux-x64${debugSuffix}-b${build} build/linux-x86_64-server-${buildType}/images/jdk
|
|
|
|
'' + oldAttrs.installPhase + "runHook postInstall";
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
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"
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ git autoconf unzip rsync ] ++ oldAttrs.nativeBuildInputs;
|
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2017-09-21 08:48:02 +00:00
|
|
|
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.
|
|
|
|
'';
|
2021-08-02 02:12:52 +00:00
|
|
|
homepage = "https://confluence.jetbrains.com/display/JBR/JetBrains+Runtime";
|
2022-04-01 21:31:40 +00:00
|
|
|
inherit (openjdk17.meta) license platforms mainProgram;
|
2022-06-22 22:51:46 +00:00
|
|
|
maintainers = with maintainers; [ edwtjo ];
|
2022-09-20 00:56:33 +00:00
|
|
|
|
|
|
|
broken = stdenv.isDarwin;
|
2020-03-11 22:20:34 +00:00
|
|
|
};
|
2022-04-01 21:31:40 +00:00
|
|
|
|
2020-03-11 22:20:34 +00:00
|
|
|
passthru = oldAttrs.passthru // {
|
|
|
|
home = "${jetbrains.jdk}/lib/openjdk";
|
2017-09-21 08:48:02 +00:00
|
|
|
};
|
2020-03-11 22:20:34 +00:00
|
|
|
})
|