From 4a89ffc4e398ba16bf48d77f96c412c36a97797f Mon Sep 17 00:00:00 2001 From: Guanpeng Xu Date: Fri, 7 Jun 2024 08:14:36 -0700 Subject: [PATCH 1/4] jcef: 767 -> 867 --- .../compilers/jetbrains-jdk/jcef.nix | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) 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 From ed2c6b5327a7f8910d177dce7f6a1057b5a12eac Mon Sep 17 00:00:00 2001 From: Guanpeng Xu Date: Fri, 7 Jun 2024 08:15:13 -0700 Subject: [PATCH 2/4] jetbrains-jdk: 17.0.11b1207.24 -> 21.0.3b465.3 --- .../compilers/jetbrains-jdk/default.nix | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/development/compilers/jetbrains-jdk/default.nix b/pkgs/development/compilers/jetbrains-jdk/default.nix index 76d4079baafb..d9b6a555935d 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; From abbd01ae5c1641c7ccc735344b1c6f2cad534bff Mon Sep 17 00:00:00 2001 From: Guanpeng Xu Date: Fri, 7 Jun 2024 08:27:29 -0700 Subject: [PATCH 3/4] jetbrains: feed jdk21 as jdk --- pkgs/top-level/all-packages.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 67c3c0e2bf76..06af2d5a5767 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31203,8 +31203,13 @@ 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 { }; + 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 { }; }); From 807913cea738695729f0bcdd5809acf23267fdf1 Mon Sep 17 00:00:00 2001 From: Guanpeng Xu Date: Wed, 12 Jun 2024 14:03:53 -0700 Subject: [PATCH 4/4] jcef: fix jdk at jdk21 --- pkgs/top-level/all-packages.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 06af2d5a5767..ba2e1431b620 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31210,7 +31210,9 @@ with pkgs; jdk = callPackage ../development/compilers/jetbrains-jdk { jdk = jdk21; }; - jcef = callPackage ../development/compilers/jetbrains-jdk/jcef.nix { }; + jcef = callPackage ../development/compilers/jetbrains-jdk/jcef.nix { + jdk = jdk21; + }; }); jmusicbot = callPackage ../applications/audio/jmusicbot { };