diff --git a/pkgs/development/compilers/jetbrains-jdk/default.nix b/pkgs/development/compilers/jetbrains-jdk/default.nix index a1e536909a0a..5a5b4c288655 100644 --- a/pkgs/development/compilers/jetbrains-jdk/default.nix +++ b/pkgs/development/compilers/jetbrains-jdk/default.nix @@ -2,8 +2,7 @@ , stdenv , fetchFromGitHub , jetbrains -, openjdk17 -, openjdk17-bootstrap +, jdk , git , autoconf , unzip @@ -37,28 +36,28 @@ let }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); cpu = stdenv.hostPlatform.parsed.cpu.name; in -openjdk17.overrideAttrs (oldAttrs: rec { +jdk.overrideAttrs (oldAttrs: rec { pname = "jetbrains-jdk" + lib.optionalString withJcef "-jcef"; - javaVersion = "17.0.11"; - build = "1207.24"; + javaVersion = "21.0.3"; + build = "465.3"; # To get the new tag: # git clone https://github.com/jetbrains/jetbrainsruntime # cd jetbrainsruntime - # git reset --hard [revision] + # git checkout jbr-release-${javaVersion}b${build} # 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.8+7"; + openjdkTag = "jbr-21.0.2+3"; version = "${javaVersion}-b${build}"; src = fetchFromGitHub { owner = "JetBrains"; repo = "JetBrainsRuntime"; rev = "jb${version}"; - hash = "sha256-a7cJF2iCW/1GK0/GmVbaY5pYcn3YtZy5ngFkyAGRhu0="; + hash = "sha256-Pup/XeHExCE6yy2o74wF7VlYU6MI9cg8gb69V3bclIo="; }; - BOOT_JDK = openjdk17-bootstrap.home; + BOOT_JDK = jdk.home; # run `git log -1 --pretty=%ct` in jdk repo for new value on update - SOURCE_DATE_EPOCH = 1715809405; + SOURCE_DATE_EPOCH = 1717225235; patches = [ ]; @@ -74,7 +73,8 @@ openjdk17.overrideAttrs (oldAttrs: rec { -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_${arch}.sh + configureFlags=$(echo $configureFlags | sed 's/--host=[^ ]*//') + sed -i "s|STATIC_CONF_ARGS|STATIC_CONF_ARGS \$configureFlags|" jb/project/tools/linux/scripts/mkimages_${arch}.sh sed \ -e "s/create_image_bundle \"jb/#/" \ -e "s/echo Creating /exit 0 #/" \ @@ -144,7 +144,7 @@ openjdk17.overrideAttrs (oldAttrs: rec { your own risk. ''; homepage = "https://confluence.jetbrains.com/display/JBR/JetBrains+Runtime"; - inherit (openjdk17.meta) license platforms mainProgram; + inherit (jdk.meta) license platforms mainProgram; maintainers = with maintainers; [ edwtjo ]; broken = stdenv.isDarwin; diff --git a/pkgs/development/compilers/jetbrains-jdk/jcef.nix b/pkgs/development/compilers/jetbrains-jdk/jcef.nix index 1c0348e4f44c..0ed9c159b128 100644 --- a/pkgs/development/compilers/jetbrains-jdk/jcef.nix +++ b/pkgs/development/compilers/jetbrains-jdk/jcef.nix @@ -4,7 +4,7 @@ , stdenv , cmake , python3 -, jdk17 +, jdk , git , libcef , rsync @@ -101,20 +101,20 @@ let in stdenv.mkDerivation rec { pname = "jcef-jetbrains"; - rev = "5e368cf6456d6319967e466e96ad5fa99f412c85"; + rev = "34dfd656652c24da31b89c39d0885f284722eeaa"; # This is the commit number - # Currently from the branch: https://github.com/JetBrains/jcef/tree/232 + # Currently from the branch: https://github.com/JetBrains/jcef/tree/242 # Run `git rev-list --count HEAD` - version = "767"; + version = "867"; - nativeBuildInputs = [ cmake python3 jdk17 git rsync ant ninja strip-nondeterminism stripJavaArchivesHook ]; + nativeBuildInputs = [ cmake python3 jdk git rsync ant ninja strip-nondeterminism stripJavaArchivesHook ]; buildInputs = [ boost libX11 libXdamage nss nspr thrift ]; src = fetchFromGitHub { owner = "jetbrains"; repo = "jcef"; inherit rev; - hash = "sha256-n+zwxHkyjkjaFhnYWcDNfsqRZIXzZplZiyeHNExfxKU="; + hash = "sha256-JlTGKqvgdBpBs2xtFMTVJ/ZksT1uME/8a2g7niH2sq8="; }; cef-bin = let @@ -130,6 +130,7 @@ stdenv.mkDerivation rec { url = "https://cef-builds.spotifycdn.com/${urlName}.tar.bz2"; inherit name hash; }; + # Find the hash in tools/buildtools/linux64/clang-format.sha1 clang-fmt = fetchurl { url = "https://storage.googleapis.com/chromium-clang-format/dd736afb28430c9782750fc0fd5f0ed497399263"; hash = "sha256-4H6FVO9jdZtxH40CSfS+4VESAHgYgYxfCBFSMHdT0hE="; @@ -180,11 +181,15 @@ stdenv.mkDerivation rec { ../tools/compile.sh ${platform} Release ''; - # Mostly taken from jb/tools/common/create_modules.sh + # N.B. For new versions, manually synchronize the following + # definitions with jb/tools/common/create_modules.sh to include + # newly added modules installPhase = '' runHook preInstall export JCEF_ROOT_DIR=$(realpath ..) + export THRIFT_DIR="$JCEF_ROOT_DIR"/third_party/thrift + export THRIFT_JAR=libthrift-0.19.0.jar export OUT_NATIVE_DIR=$JCEF_ROOT_DIR/jcef_build/native/${buildType} export JB_TOOLS_DIR=$(realpath ../jb/tools) export JB_TOOLS_OS_DIR=$JB_TOOLS_DIR/linux @@ -244,6 +249,11 @@ stdenv.mkDerivation rec { '' + '' cd ../jcef + cp "$THRIFT_DIR"/"$THRIFT_JAR" . + cp "$JB_TOOLS_DIR"/common/thrift-module-info.java module-info.java + javac --patch-module org.apache.thrift=$THRIFT_JAR module-info.java + jar uf $THRIFT_JAR module-info.class + rm module-info.class module-info.java cp "$OUT_CLS_DIR"/jcef.jar . mkdir lib cp -R "$OUT_NATIVE_DIR"/* lib @@ -264,6 +274,7 @@ stdenv.mkDerivation rec { 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/jmods/jcef.jmod + jmod create --module-path . --class-path $THRIFT_JAR $out/jmods/org.apache.thrift.jmod # stripJavaArchivesHook gets rid of jar file timestamps, but not of jmod file timestamps # We have to manually call strip-nondeterminism to do this for jmod files too diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f73c7a022905..036ca0e13c8d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31183,9 +31183,16 @@ 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 { }; + jdk-no-jcef = callPackage ../development/compilers/jetbrains-jdk { + jdk = jdk21; + withJcef = false; + }; + jdk = callPackage ../development/compilers/jetbrains-jdk { + jdk = jdk21; + }; + jcef = callPackage ../development/compilers/jetbrains-jdk/jcef.nix { + jdk = jdk21; + }; }); jmusicbot = callPackage ../applications/audio/jmusicbot { };