From 96797dd48d6ec85dd835f513d32a68c6cdd74f5f Mon Sep 17 00:00:00 2001 From: Anton Afanasyev Date: Sat, 30 Jul 2022 08:47:49 -0700 Subject: [PATCH 1/2] New package: jetbrains-jdk17-17.0.4.1b629.2. --- .../01-jdk_build_classlist_sort_to_file.diff | 64 ++++++++++ srcpkgs/jetbrains-jdk17/template | 117 ++++++++++++++++++ srcpkgs/jetbrains-jdk17/update | 2 + 3 files changed, 183 insertions(+) create mode 100644 srcpkgs/jetbrains-jdk17/patches/01-jdk_build_classlist_sort_to_file.diff create mode 100644 srcpkgs/jetbrains-jdk17/template create mode 100644 srcpkgs/jetbrains-jdk17/update diff --git a/srcpkgs/jetbrains-jdk17/patches/01-jdk_build_classlist_sort_to_file.diff b/srcpkgs/jetbrains-jdk17/patches/01-jdk_build_classlist_sort_to_file.diff new file mode 100644 index 000000000000..e94884daf217 --- /dev/null +++ b/srcpkgs/jetbrains-jdk17/patches/01-jdk_build_classlist_sort_to_file.diff @@ -0,0 +1,64 @@ +diff --git a/make/GenerateLinkOptData.gmk b/make/GenerateLinkOptData.gmk +index 5dd766c8c07..7b2480625f1 100644 +--- a/make/GenerateLinkOptData.gmk ++++ b/make/GenerateLinkOptData.gmk +@@ -89,9 +89,10 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST + exit $$exitcode \ + ) + $(GREP) -v HelloClasslist $@.raw.2 > $@.raw.3 ++ echo "" > $@ + $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java \ + -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \ +- build.tools.classlist.SortClasslist $@.raw.3 > $@ ++ build.tools.classlist.SortClasslist $@.raw.3 $@ + + # The jli trace is created by the same recipe as classlist. By declaring these + # dependencies, make will correctly rebuild both jli trace and classlist +diff --git a/make/jdk/src/classes/build/tools/classlist/SortClasslist.java b/make/jdk/src/classes/build/tools/classlist/SortClasslist.java +index 07987feb2da..7a5b84421fc 100644 +--- a/make/jdk/src/classes/build/tools/classlist/SortClasslist.java ++++ b/make/jdk/src/classes/build/tools/classlist/SortClasslist.java +@@ -33,6 +33,10 @@ package build.tools.classlist; + + import java.io.FileInputStream; + import java.io.FileNotFoundException; ++import java.io.FileOutputStream; ++import java.io.OutputStreamWriter; ++import java.io.PrintWriter; ++import java.nio.charset.StandardCharsets; + import java.util.ArrayList; + import java.util.Collections; + import java.util.regex.Pattern; +@@ -50,13 +54,15 @@ public class SortClasslist { + ArrayList lambdas = new ArrayList<>(); + + FileInputStream fis = new FileInputStream(args[0]); ++ FileOutputStream fos = new FileOutputStream(args[1], false); ++ PrintWriter outWriter = new PrintWriter(new OutputStreamWriter(fos, StandardCharsets.UTF_8)); + Scanner scanner = new Scanner(fis); + while (scanner.hasNextLine()) { + String line = scanner.nextLine(); + if (line.startsWith("#")) { + // Comments -- print them first without sorting. These appear only at the top + // of the file. +- System.out.println(line); ++ outWriter.println(line); + } else if (line.startsWith("@")) { + // @lambda-form-invoker, @lambda-proxy, etc. + lambdas.add(line); +@@ -73,10 +79,13 @@ public class SortClasslist { + Collections.sort(lambdas); + + for (String s : classes) { +- System.out.println(s); ++ outWriter.println(s); + } + for (String s : lambdas) { +- System.out.println(s); ++ outWriter.println(s); + } ++ ++ outWriter.flush(); ++ outWriter.close(); + } + } diff --git a/srcpkgs/jetbrains-jdk17/template b/srcpkgs/jetbrains-jdk17/template new file mode 100644 index 000000000000..a946fb1b98c3 --- /dev/null +++ b/srcpkgs/jetbrains-jdk17/template @@ -0,0 +1,117 @@ +# Template file for 'jetbrains-jdk17' +pkgname=jetbrains-jdk17 +version=17.0.4.1b629.2 +revision=1 +_gtest_ver=1.8.1 +archs="x86_64" +_tag_name="jbr-release-${version}" +_jdk_home="usr/lib/jvm/jbrsdk" +create_wrksrc=yes +build_wrksrc="JetBrainsRuntime-${_tag_name}" +build_style=gnu-configure +configure_args=" + --with-vendor-name=Void + --with-vendor-url=https://voidlinux.org/ + --with-vendor-bug-url=https://github.com/void-linux/void-packages/issues + --with-vendor-vm-bug-url=https://github.com/void-linux/void-packages/issues + --with-version-pre= + --with-version-opt=${version#*b}-void-r${revision} + --with-stdc++lib=dynamic + --with-libjpeg=system + --with-giflib=system + --with-libpng=system + --with-lcms=system + --with-zlib=system + --with-jtreg=no + --with-harfbuzz=system + --with-jvm-features=zgc + --enable-unlimited-crypto + --disable-warnings-as-errors + --with-native-debug-symbols=internal + --with-debug-level=release + --with-jobs=${XBPS_ORIG_MAKEJOBS} + --with-gtest=../googletest-release-${_gtest_ver} +" +make_build_args="images" +make_install_args="INSTALL_PREFIX=\"${DESTDIR}/usr/lib\"" +make_check_target="test-hotspot-gtest" +hostmakedepends="pkg-config zip unzip autoconf automake libtool which make-ca" +makedepends="alsa-lib-devel cups-devel libX11-devel libjpeg-turbo-devel harfbuzz-devel giflib-devel freetype-devel libXtst-devel libXt-devel libXrender-devel alsa-lib-devel fontconfig-devel libXrandr-devel libXi-devel zlib-devel lcms2-devel" +short_desc="JetBrains Java 17 JDK" +maintainer="Anton Afanasyev " +license="GPL-2.0-only, Classpath-exception-2.0" +homepage="https://github.com/JetBrains/JetBrainsRuntime" +distfiles="https://github.com/JetBrains/JetBrainsRuntime/archive/refs/tags/${_tag_name}.tar.gz + https://github.com/google/googletest/archive/refs/tags/release-${_gtest_ver}.tar.gz" +checksum="c850cc90c8980b00866bb47d2e9f13700f419dd8867892706342aba850127138 + 9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c" +patch_args="-Np1 -d ${build_wrksrc}" +conflicts="jetbrains-jdk-bin" + +# For whatever reason, XBPS finds libjava, libjli, etc as dependencies of this package, and decides to make it depend on openjdk8, which provides those. +# But that is not true, nor desired -- this is a full fledged JDK distribution, just not installed as such here in XBPS land. +noverifyrdeps=yes + +# Build and check are still parallel, but don't use -jN. +disable_parallel_build=yes +disable_parallel_check=yes + +# This does not currently accomplish anything, since only building on x86_64. Leaving this for future, taken from `openjdk17`. +if [ ! "$CROSS_BUILD" ]; then + makedepends+=" openjdk16-bootstrap" + configure_args+=" --with-boot-jdk=/usr/lib/jvm/openjdk16" +else + makedepends+=" openjdk17" + configure_args+=" --with-boot-jdk=/usr/lib/jvm/openjdk17" +fi +configure_args+=" --with-boot-jdk-jvmargs=-Xlog:disable" + +do_configure() { + CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/} + CXXFLAGS=${CXXFLAGS/-D_FORTIFY_SOURCE=2/} + + configure_args=${configure_args/--with-libtool-sysroot=$XBPS_CROSS_BASE} + if [ "$XBPS_CCACHE" ] && [ -z "$CROSS_BUILD" ]; then + configure_args+=" --enable-ccache" + CC="/usr/bin/cc" + CXX="/usr/bin/c++" + fi + + sh ./configure ${configure_args} \ + --with-extra-cflags="$CFLAGS" \ + --with-extra-cxxflags="$CXXFLAGS" \ + --with-extra-ldflags="$LDFLAGS" \ + READELF=$READELF AR=$AR STRIP=$STRIP NM=$NM \ + OBJDUMP=$OBJDUMP OBJCOPY=$OBJCOPY +} + +# TODO: openjdk17 had the following hook in it. Debug it for understanding. +#post_install() { +# vmkdir $_jdk_home/lib/security +# make-ca -g -f --destdir "${PWD}/ca" -k "${DESTDIR}/$_jdk_home/bin/keytool" +# mv ./ca/etc/pki/tls/java/cacerts ${DESTDIR}/$_jdk_home/lib/security/ +# chmod -R ugo+rw ./ca +# rm -rf ./ca +#} + +do_install() { + TARGET_PATH="${_jdk_home}" + + vmkdir ${TARGET_PATH} + + vlicense ASSEMBLY_EXCEPTION + vlicense LICENSE + + cd build/linux-*-server-release/images/jdk/ + vcopy bin ${TARGET_PATH} + vcopy conf ${TARGET_PATH} + vcopy include ${TARGET_PATH} + vcopy legal ${TARGET_PATH} + vcopy lib ${TARGET_PATH} + vcopy release ${TARGET_PATH} + + vmkdir etc/profile.d + cat > ${DESTDIR}/etc/profile.d/10_jbrsdk.sh < Date: Fri, 15 Apr 2022 12:50:13 -0700 Subject: [PATCH 2/2] CLion: update to 2022.2.3. --- srcpkgs/CLion-cmake | 1 + srcpkgs/CLion-gdb | 1 + srcpkgs/CLion-lldb | 1 + srcpkgs/CLion/template | 109 +++++++++++++++++++++-------------------- 4 files changed, 60 insertions(+), 52 deletions(-) create mode 120000 srcpkgs/CLion-cmake create mode 120000 srcpkgs/CLion-gdb create mode 120000 srcpkgs/CLion-lldb diff --git a/srcpkgs/CLion-cmake b/srcpkgs/CLion-cmake new file mode 120000 index 000000000000..0c38ab4f97d6 --- /dev/null +++ b/srcpkgs/CLion-cmake @@ -0,0 +1 @@ +CLion \ No newline at end of file diff --git a/srcpkgs/CLion-gdb b/srcpkgs/CLion-gdb new file mode 120000 index 000000000000..0c38ab4f97d6 --- /dev/null +++ b/srcpkgs/CLion-gdb @@ -0,0 +1 @@ +CLion \ No newline at end of file diff --git a/srcpkgs/CLion-lldb b/srcpkgs/CLion-lldb new file mode 120000 index 000000000000..0c38ab4f97d6 --- /dev/null +++ b/srcpkgs/CLion-lldb @@ -0,0 +1 @@ +CLion \ No newline at end of file diff --git a/srcpkgs/CLion/template b/srcpkgs/CLion/template index 65e76c206e6c..0ddaf67390f2 100644 --- a/srcpkgs/CLion/template +++ b/srcpkgs/CLion/template @@ -1,55 +1,31 @@ # Template file for 'CLion' pkgname=CLion -version=2021.3.4 +version=2022.2.3 revision=1 archs="x86_64 aarch64" wrksrc="clion-${version}" -depends="jetbrains-jdk-bin giflib libXtst" +depends="giflib libXtst jetbrains-jdk17" short_desc="Smart cross-platform IDE for C and C++" maintainer="Anton Afanasyev " license="custom:Commercial" homepage="https://www.jetbrains.com/clion" distfiles="https://download.jetbrains.com/cpp/CLion-${version}.tar.gz" -checksum=f3b0b9e0dd0cd4aebef5d424e7a22868c732daad47d6c94f73630cef449ccf78 +checksum=e0338107115231c4b354870dfcf537ba6ad1741a0d310e4e50c48dfc24ff9cce repository=nonfree restricted=yes nopie=yes # JetBrains' tools are self-sufficient and while they include code that appears to be linked to libs from other packages, these libs are either included in the tool package, or the code works by looking for one of several supported libs. noverifyrdeps=yes +nostrip=yes +noshlibprovides=yes python_version=3 -build_options="bundled_cmake bundled_gdb bundled_lldb" -build_options_default="bundled_cmake bundled_gdb bundled_lldb" -desc_option_bundled_cmake="Install bundled CMake" -desc_option_bundled_gdb="Install bundled GDB" -desc_option_bundled_lldb="Install bundled LLDB" - post_extract() { # Remove files for other OSes and/or CPU architectures - # Darwin (this is not packaged for macOS) - rm -rf plugins/cwm-plugin/quiche-native/darwin-aarch64 - rm -rf plugins/cwm-plugin/quiche-native/darwin-x86-64 - rm -rf plugins/performanceTesting/bin/libyjpagent.dylib - rm -rf plugins/python-ce/helpers/pydev/pydevd_attach_to_process/attach_x86.dylib - rm -rf plugins/python-ce/helpers/pydev/pydevd_attach_to_process/attach_x86_64.dylib - # Windows (this is not packaged for Windows) - rm -rf plugins/cwm-plugin/quiche-native/win32-x86-64 - rm -rf plugins/performanceTesting/bin/yjpagent.dll - rm -rf plugins/performanceTesting/bin/yjpagent64.dll - rm -rf plugins/python-ce/helpers/pydev/pydevd_attach_to_process/attach_amd64.dll - rm -rf plugins/python-ce/helpers/pydev/pydevd_attach_to_process/attach_x86.dll - # x86 (unsupported after v2021.1) - rm -rf bin/clion.vmoptions - rm -rf lib/pty4j-native/linux/x86 - rm -rf plugins/performanceTesting/bin/libyjpagent.so - rm -rf plugins/python-ce/helpers/pydev/pydevd_attach_to_process/attach_linux_x86.so - # MIPS - rm -rf lib/pty4j-native/linux/mips64el - # ARM - rm -rf lib/pty4j-native/linux/arm - # PPC - rm -rf lib/pty4j-native/linux/ppc64le - + rm -rf plugins/cwm-plugin/quiche-native/{darwin-aarch64,darwin-x86-64,win32-x86-64} + rm -rf plugins/performanceTesting/bin/{libyjpagent.dylib,yjpagent.dll,yjpagent64.dll,libyjpagent.so} + rm -rf plugins/python-ce/helpers/pydev/pydevd_attach_to_process/{attach_x86.dylib,attach_x86_64.dylib,attach_amd64.dll,attach_x86.dll,attach_linux_x86.so} + rm -rf lib/pty4j-native/linux/{x86,mips64el,arm,ppc64le} case "$XBPS_TARGET_MACHINE" in x86_64) @@ -62,22 +38,15 @@ post_extract() { ;; esac - if [ ! "$build_option_bundled_cmake" ]; then - rm -rf bin/cmake - fi - if [ ! "$build_option_bundled_gdb" ]; then - rm -rf bin/gdb - fi - if [ ! "$build_option_bundled_lldb" ]; then - rm -rf bin/lldb - fi + # Packaged in separate packages + mkdir -p _bin + mv bin/{cmake,gdb,lldb} _bin/ } +_TARGET_PATH="usr/lib/${pkgname}" do_install() { - TARGET_PATH="usr/lib/${pkgname}" - vmkdir usr/bin - vmkdir ${TARGET_PATH} + vmkdir ${_TARGET_PATH} local i for i in license/* ; do @@ -86,12 +55,48 @@ do_install() { local launcher_path="bin/clion.sh" sed -i '1 s/$/\nCLION_JDK=${CLION_JDK:-${IDEA_JDK}}/' "${launcher_path}" - vcopy bin ${TARGET_PATH} - vcopy help ${TARGET_PATH} - vcopy lib ${TARGET_PATH} - vcopy plugins ${TARGET_PATH} - vcopy product-info.json ${TARGET_PATH} - vcopy build.txt ${TARGET_PATH} + vcopy bin ${_TARGET_PATH} + vcopy help ${_TARGET_PATH} + vcopy lib ${_TARGET_PATH} + vcopy plugins ${_TARGET_PATH} + vcopy product-info.json ${_TARGET_PATH} + vcopy build.txt ${_TARGET_PATH} + + ln -sf "/${_TARGET_PATH}/${launcher_path}" "${DESTDIR}/usr/bin/${pkgname}" +} + +CLion-cmake_package() { + short_desc+=" - bundled CMake" + depends="${sourcepkg}>=${version}_${revision}" + noverifyrdeps=yes + nostrip=yes + noshlibprovides=yes + pkg_install() { + vmkdir ${_TARGET_PATH}/bin + vcopy _bin/cmake ${_TARGET_PATH}/bin + } +} + +CLion-gdb_package() { + short_desc+=" - bundled GDB" + depends="${sourcepkg}>=${version}_${revision}" + noverifyrdeps=yes + nostrip=yes + noshlibprovides=yes + pkg_install() { + vmkdir ${_TARGET_PATH}/bin + vcopy _bin/gdb ${_TARGET_PATH}/bin + } +} - ln -sf "/${TARGET_PATH}/${launcher_path}" "${DESTDIR}/usr/bin/${pkgname}" +CLion-lldb_package() { + short_desc+=" - bundled LLDB" + depends="${sourcepkg}>=${version}_${revision}" + noverifyrdeps=yes + nostrip=yes + noshlibprovides=yes + pkg_install() { + vmkdir ${_TARGET_PATH}/bin + vcopy _bin/lldb ${_TARGET_PATH}/bin + } }