diff options
Diffstat (limited to 'pkgs/development/compilers/jetbrains-jdk')
-rw-r--r-- | pkgs/development/compilers/jetbrains-jdk/17.nix | 156 | ||||
-rw-r--r-- | pkgs/development/compilers/jetbrains-jdk/default.nix | 156 | ||||
-rw-r--r-- | pkgs/development/compilers/jetbrains-jdk/jcef.nix | 289 |
3 files changed, 0 insertions, 601 deletions
diff --git a/pkgs/development/compilers/jetbrains-jdk/17.nix b/pkgs/development/compilers/jetbrains-jdk/17.nix deleted file mode 100644 index 76d4079baafb..000000000000 --- a/pkgs/development/compilers/jetbrains-jdk/17.nix +++ /dev/null @@ -1,156 +0,0 @@ -{ lib -, stdenv -, fetchFromGitHub -, jetbrains -, openjdk17 -, openjdk17-bootstrap -, git -, autoconf -, unzip -, rsync -, debugBuild ? false -, withJcef ? true - -, libXdamage -, libXxf86vm -, libXrandr -, libXi -, libXcursor -, libXrender -, libX11 -, libXext -, libxcb -, nss -, nspr -, libdrm -, mesa -, wayland -, udev -}: - -assert debugBuild -> withJcef; - -let - arch = { - "aarch64-linux" = "aarch64"; - "x86_64-linux" = "x64"; - }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); - cpu = stdenv.hostPlatform.parsed.cpu.name; -in -openjdk17.overrideAttrs (oldAttrs: rec { - pname = "jetbrains-jdk" + lib.optionalString withJcef "-jcef"; - javaVersion = "17.0.11"; - build = "1207.24"; - # 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 "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"; - version = "${javaVersion}-b${build}"; - - src = fetchFromGitHub { - owner = "JetBrains"; - repo = "JetBrainsRuntime"; - rev = "jb${version}"; - hash = "sha256-a7cJF2iCW/1GK0/GmVbaY5pYcn3YtZy5ngFkyAGRhu0="; - }; - - BOOT_JDK = openjdk17-bootstrap.home; - # run `git log -1 --pretty=%ct` in jdk repo for new value on update - SOURCE_DATE_EPOCH = 1715809405; - - patches = [ ]; - - dontConfigure = true; - - buildPhase = '' - runHook preBuild - - ${lib.optionalString withJcef "cp -r ${jetbrains.jcef} jcef_linux_${arch}"} - - 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_${arch}.sh - sed \ - -e "s/create_image_bundle \"jb/#/" \ - -e "s/echo Creating /exit 0 #/" \ - -i jb/project/tools/linux/scripts/mkimages_${arch}.sh - - patchShebangs . - ./jb/project/tools/linux/scripts/mkimages_${arch}.sh ${build} ${if debugBuild then "fd" else (if withJcef then "jcef" else "nomod")} - - runHook postBuild - ''; - - installPhase = - let - buildType = if debugBuild then "fastdebug" else "release"; - debugSuffix = if debugBuild then "-fastdebug" else ""; - jcefSuffix = if debugBuild || !withJcef then "" else "_jcef"; - jbrsdkDir = "jbrsdk${jcefSuffix}-${javaVersion}-linux-${arch}${debugSuffix}-b${build}"; - in - '' - runHook preInstall - - mv build/linux-${cpu}-server-${buildType}/images/jdk/man build/linux-${cpu}-server-${buildType}/images/${jbrsdkDir} - rm -rf build/linux-${cpu}-server-${buildType}/images/jdk - mv build/linux-${cpu}-server-${buildType}/images/${jbrsdkDir} build/linux-${cpu}-server-${buildType}/images/jdk - '' + oldAttrs.installPhase + "runHook postInstall"; - - postInstall = lib.optionalString withJcef '' - 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; - - meta = with 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. - JetBrains Runtime is not a certified build of OpenJDK. Please, use at - your own risk. - ''; - homepage = "https://confluence.jetbrains.com/display/JBR/JetBrains+Runtime"; - inherit (openjdk17.meta) license platforms mainProgram; - maintainers = with maintainers; [ edwtjo ]; - - broken = stdenv.isDarwin; - }; - - passthru = oldAttrs.passthru // { - home = "${jetbrains.jdk}/lib/openjdk"; - }; -}) diff --git a/pkgs/development/compilers/jetbrains-jdk/default.nix b/pkgs/development/compilers/jetbrains-jdk/default.nix deleted file mode 100644 index 5a5b4c288655..000000000000 --- a/pkgs/development/compilers/jetbrains-jdk/default.nix +++ /dev/null @@ -1,156 +0,0 @@ -{ lib -, stdenv -, fetchFromGitHub -, jetbrains -, jdk -, git -, autoconf -, unzip -, rsync -, debugBuild ? false -, withJcef ? true - -, libXdamage -, libXxf86vm -, libXrandr -, libXi -, libXcursor -, libXrender -, libX11 -, libXext -, libxcb -, nss -, nspr -, libdrm -, mesa -, wayland -, udev -}: - -assert debugBuild -> withJcef; - -let - arch = { - "aarch64-linux" = "aarch64"; - "x86_64-linux" = "x64"; - }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); - cpu = stdenv.hostPlatform.parsed.cpu.name; -in -jdk.overrideAttrs (oldAttrs: rec { - pname = "jetbrains-jdk" + lib.optionalString withJcef "-jcef"; - javaVersion = "21.0.3"; - build = "465.3"; - # To get the new tag: - # git clone https://github.com/jetbrains/jetbrainsruntime - # cd jetbrainsruntime - # 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-21.0.2+3"; - version = "${javaVersion}-b${build}"; - - src = fetchFromGitHub { - owner = "JetBrains"; - repo = "JetBrainsRuntime"; - rev = "jb${version}"; - hash = "sha256-Pup/XeHExCE6yy2o74wF7VlYU6MI9cg8gb69V3bclIo="; - }; - - BOOT_JDK = jdk.home; - # run `git log -1 --pretty=%ct` in jdk repo for new value on update - SOURCE_DATE_EPOCH = 1717225235; - - patches = [ ]; - - dontConfigure = true; - - buildPhase = '' - runHook preBuild - - ${lib.optionalString withJcef "cp -r ${jetbrains.jcef} jcef_linux_${arch}"} - - 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 - 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 #/" \ - -i jb/project/tools/linux/scripts/mkimages_${arch}.sh - - patchShebangs . - ./jb/project/tools/linux/scripts/mkimages_${arch}.sh ${build} ${if debugBuild then "fd" else (if withJcef then "jcef" else "nomod")} - - runHook postBuild - ''; - - installPhase = - let - buildType = if debugBuild then "fastdebug" else "release"; - debugSuffix = if debugBuild then "-fastdebug" else ""; - jcefSuffix = if debugBuild || !withJcef then "" else "_jcef"; - jbrsdkDir = "jbrsdk${jcefSuffix}-${javaVersion}-linux-${arch}${debugSuffix}-b${build}"; - in - '' - runHook preInstall - - mv build/linux-${cpu}-server-${buildType}/images/jdk/man build/linux-${cpu}-server-${buildType}/images/${jbrsdkDir} - rm -rf build/linux-${cpu}-server-${buildType}/images/jdk - mv build/linux-${cpu}-server-${buildType}/images/${jbrsdkDir} build/linux-${cpu}-server-${buildType}/images/jdk - '' + oldAttrs.installPhase + "runHook postInstall"; - - postInstall = lib.optionalString withJcef '' - 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; - - meta = with lib; { - description = "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. - ''; - homepage = "https://confluence.jetbrains.com/display/JBR/JetBrains+Runtime"; - inherit (jdk.meta) license platforms mainProgram; - maintainers = with maintainers; [ edwtjo ]; - - broken = stdenv.isDarwin; - }; - - passthru = oldAttrs.passthru // { - home = "${jetbrains.jdk}/lib/openjdk"; - }; -}) diff --git a/pkgs/development/compilers/jetbrains-jdk/jcef.nix b/pkgs/development/compilers/jetbrains-jdk/jcef.nix deleted file mode 100644 index 0ed9c159b128..000000000000 --- a/pkgs/development/compilers/jetbrains-jdk/jcef.nix +++ /dev/null @@ -1,289 +0,0 @@ -{ fetchFromGitHub -, fetchurl -, fetchzip -, stdenv -, cmake -, python3 -, jdk -, git -, libcef -, rsync -, lib -, ant -, ninja -, strip-nondeterminism -, stripJavaArchivesHook - -, debugBuild ? false - -, glib -, nss -, nspr -, atk -, at-spi2-atk -, libdrm -, libGL -, expat -, libxcb -, libxkbcommon -, libX11 -, libXcomposite -, libXdamage -, libXext -, libXfixes -, libXrandr -, mesa -, gtk3 -, pango -, cairo -, alsa-lib -, dbus -, at-spi2-core -, cups -, libxshmfence -, udev -, boost -, thrift -}: - -assert !stdenv.isDarwin; -# I can't test darwin - -let - rpath = lib.makeLibraryPath [ - glib - nss - nspr - atk - at-spi2-atk - libdrm - libGL - expat - libxcb - libxkbcommon - libX11 - libXcomposite - libXdamage - libXext - libXfixes - libXrandr - mesa - gtk3 - pango - cairo - alsa-lib - dbus - at-spi2-core - cups - libxshmfence - udev - ]; - - buildType = if debugBuild then "Debug" else "Release"; - platform = { - "aarch64-linux" = "linuxarm64"; - "x86_64-linux" = "linux64"; - }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); - arches = { - "linuxarm64" = { - depsArch = "arm64"; - projectArch = "arm64"; - targetArch = "arm64"; - }; - "linux64" = { - depsArch = "amd64"; - projectArch = "x86_64"; - targetArch = "x86_64"; - }; - }.${platform}; - inherit (arches) depsArch projectArch targetArch; - -in -stdenv.mkDerivation rec { - pname = "jcef-jetbrains"; - rev = "34dfd656652c24da31b89c39d0885f284722eeaa"; - # This is the commit number - # Currently from the branch: https://github.com/JetBrains/jcef/tree/242 - # Run `git rev-list --count HEAD` - version = "867"; - - 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-JlTGKqvgdBpBs2xtFMTVJ/ZksT1uME/8a2g7niH2sq8="; - }; - cef-bin = - let - # `cef_binary_${CEF_VERSION}_linux64_minimal`, where CEF_VERSION is from $src/CMakeLists.txt - name = "cef_binary_122.1.9+gd14e051+chromium-122.0.6261.94_${platform}_minimal"; - hash = { - "linuxarm64" = "sha256-wABtvz0JHitlkkB748I7yr02Oxs5lXvqDfrBAQiKWHU="; - "linux64" = "sha256-qlutM0IsE1emcMe/3p7kwMIK7ou1rZGvpUkrSMVPnCc="; - }.${platform}; - urlName = builtins.replaceStrings [ "+" ] [ "%2B" ] name; - in - fetchzip { - 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="; - }; - - configurePhase = '' - runHook preConfigure - - patchShebangs . - - cp -r ${cef-bin} third_party/cef/${cef-bin.name} - chmod +w -R third_party/cef/${cef-bin.name} - patchelf third_party/cef/${cef-bin.name}/${buildType}/libcef.so --set-rpath "${rpath}" --add-needed libudev.so - patchelf third_party/cef/${cef-bin.name}/${buildType}/libGLESv2.so --set-rpath "${rpath}" --add-needed libGL.so.1 - patchelf third_party/cef/${cef-bin.name}/${buildType}/chrome-sandbox --set-interpreter $(cat $NIX_BINTOOLS/nix-support/dynamic-linker) - sed 's/-O0/-O2/' -i third_party/cef/${cef-bin.name}/cmake/cef_variables.cmake - - sed \ - -e 's|os.path.isdir(os.path.join(path, \x27.git\x27))|True|' \ - -e 's|"%s rev-parse %s" % (git_exe, branch)|"echo '${rev}'"|' \ - -e 's|"%s config --get remote.origin.url" % git_exe|"echo 'https://github.com/jetbrains/jcef'"|' \ - -e 's|"%s rev-list --count %s" % (git_exe, branch)|"echo '${version}'"|' \ - -i tools/git_util.py - - cp ${clang-fmt} tools/buildtools/linux64/clang-format - chmod +w tools/buildtools/linux64/clang-format - - sed \ - -e 's|include(cmake/vcpkg.cmake)||' \ - -e 's|bring_vcpkg()||' \ - -e 's|vcpkg_install_package(boost-filesystem boost-interprocess thrift)||' \ - -i CMakeLists.txt - - sed -e 's|vcpkg_bring_host_thrift()|set(THRIFT_COMPILER_HOST ${thrift}/bin/thrift)|' -i remote/CMakeLists.txt - - mkdir jcef_build - cd jcef_build - - cmake -G "Ninja" -DPROJECT_ARCH="${projectArch}" -DCMAKE_BUILD_TYPE=${buildType} .. - - runHook postConfigure - ''; - - outputs = [ "out" "unpacked" ]; - - postBuild = '' - export JCEF_ROOT_DIR=$(realpath ..) - ../tools/compile.sh ${platform} Release - ''; - - # 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 - export OUT_CLS_DIR=$(realpath ../out/${platform}) - export TARGET_ARCH=${targetArch} DEPS_ARCH=${depsArch} - export OS=linux - export JOGAMP_DIR="$JCEF_ROOT_DIR"/third_party/jogamp/jar - - mkdir -p $unpacked/{jogl,gluegen,jcef} - - function extract_jar { - __jar=$1 - __dst_dir=$2 - __content_dir="''${3:-.}" - __tmp=.tmp_extract_jar - rm -rf "$__tmp" && mkdir "$__tmp" - ( - cd "$__tmp" || exit 1 - jar -xf "$__jar" - ) - rm -rf "$__tmp/META-INF" - rm -rf "$__dst_dir" && mkdir "$__dst_dir" - if [ -z "$__content_dir" ] - then - cp -R "$__tmp"/* "$__dst_dir" - else - cp -R "$__tmp"/"$__content_dir"/* "$__dst_dir" - fi - rm -rf $__tmp - } - - cd $unpacked/gluegen - cp "$JOGAMP_DIR"/gluegen-rt.jar . - cp "$JB_TOOLS_DIR"/common/gluegen-module-info.java module-info.java - javac --patch-module gluegen.rt=gluegen-rt.jar module-info.java - jar uf gluegen-rt.jar module-info.class - rm module-info.class module-info.java - mkdir lib - '' - # see https://github.com/JetBrains/jcef/commit/f3b787e3326c1915d663abded7f055c0866f32ec - + lib.optionalString (platform != "linuxarm64") '' - extract_jar "$JOGAMP_DIR"/gluegen-rt-natives-"$OS"-"$DEPS_ARCH".jar lib natives/"$OS"-"$DEPS_ARCH" - '' + '' - - cd ../jogl - cp "$JOGAMP_DIR"/gluegen-rt.jar . - cp "$JOGAMP_DIR"/jogl-all.jar . - cp "$JB_TOOLS_OS_DIR"/jogl-module-info.java module-info.java - javac --module-path . --patch-module jogl.all=jogl-all.jar module-info.java - jar uf jogl-all.jar module-info.class - rm module-info.class module-info.java - mkdir lib - '' - # see https://github.com/JetBrains/jcef/commit/f3b787e3326c1915d663abded7f055c0866f32ec - + lib.optionalString (platform != "linuxarm64") '' - extract_jar "$JOGAMP_DIR"/jogl-all-natives-"$OS"-"$DEPS_ARCH".jar lib natives/"$OS"-"$DEPS_ARCH" - '' + '' - - 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 - - mkdir -p $out/jmods - - bash "$JB_TOOLS_DIR"/common/create_version_file.sh $out - - runHook postInstall - ''; - - dontStrip = debugBuild; - - postFixup = '' - cd $unpacked/gluegen - jmod create --class-path gluegen-rt.jar --libs lib $out/jmods/gluegen.rt.jmod - cd ../jogl - 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 - find $out -name "*.jmod" -exec strip-nondeterminism --type jmod {} + - ''; - - meta = { - description = "Jetbrains' fork of JCEF"; - license = lib.licenses.bsd3; - homepage = "https://github.com/JetBrains/JCEF"; - }; -} |