summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorYizheng Hu2020-11-20 16:49:54 +0800
committerYizheng Hu2020-11-20 16:49:54 +0800
commit1a3f5dca7853c4c226431cee69b4650789b1d2ae (patch)
treea8c75e3c054347f28627efa57f85a5bc2aaf4157
downloadaur-1a3f5dca7853c4c226431cee69b4650789b1d2ae.tar.gz
Upload
-rw-r--r--.SRCINFO96
-rw-r--r--PKGBUILD267
-rw-r--r--freedesktop-java.desktop12
-rw-r--r--freedesktop-jconsole.desktop11
-rw-r--r--freedesktop-jshell.desktop9
-rw-r--r--install_jdk-jetbrains.sh50
-rw-r--r--install_jre-jetbrains-headless.sh48
-rw-r--r--install_jre-jetbrains.sh35
8 files changed, 528 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..4716929dfe7
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,96 @@
+pkgbase = java11-jetbrains-imfix
+ pkgver = 11.0.9.b1183.9
+ pkgrel = 1
+ url = https://confluence.jetbrains.com/display/JBR/JetBrains+Runtime
+ arch = x86_64
+ license = custom
+ makedepends = java-environment>=10
+ makedepends = java-environment<12
+ makedepends = cpio
+ makedepends = unzip
+ makedepends = zip
+ makedepends = libelf
+ makedepends = libcups
+ makedepends = libx11
+ makedepends = libxrender
+ makedepends = libxtst
+ makedepends = libxt
+ makedepends = libxext
+ makedepends = libxrandr
+ makedepends = alsa-lib
+ makedepends = pandoc
+ makedepends = graphviz
+ makedepends = freetype2
+ makedepends = libjpeg-turbo
+ makedepends = giflib
+ makedepends = libpng
+ makedepends = lcms2
+ makedepends = libnet
+ makedepends = bash
+ source = https://github.com/JetBrains/JetBrainsRuntime/archive/jb11_0_9-b9.tar.gz
+ source = https://github.com/prehonor/myJetBrainsRuntime/raw/master/idea.patch
+ source = freedesktop-java.desktop
+ source = freedesktop-jconsole.desktop
+ source = freedesktop-jshell.desktop
+ sha256sums = f3649db719fea2447875de26886c4fdcc651abc5a946e2ad5b491f9033f63021
+ sha256sums = ceb149421aeceb286143a9c9979f3b9ce9fc9b161dfda1e20d41352c5e4741c4
+ sha256sums = 915bd0722e897fd811bb0d77829528017ecdfd703880454bc690018ee54e44b6
+ sha256sums = 3f072ef4d1f59e1188d4b36ff83378c67b9f77db532b4f5cbaeb57cd37620f07
+ sha256sums = c0c01fcc02dc18ed96ef697b3bedce0e8336b212cb1fcee90b2129987f4ae8ec
+
+pkgname = jre11-jetbrains-headless-imfix
+ pkgdesc = JetBrains Java 11 headless runtime environment
+ install = install_jre-jetbrains-headless.sh
+ depends = java-runtime-common>=3
+ depends = ca-certificates-utils
+ depends = nss
+ depends = libjpeg-turbo
+ depends = lcms2
+ depends = libnet
+ depends = freetype2
+ optdepends = java-rhino: for some JavaScript support
+ provides = java-runtime-headless=11
+ provides = java-runtime-headless-jetbrains=11
+ provides = jre11-jetbrains-headless=11.0.9.b1183.9-1
+ provides = jre11-jetbrains-headless=11.0.9.b1183.9
+ backup = etc/java11-jetbrains/logging.propertopenjdkies
+ backup = etc/java11-jetbrains/management/jmxremote.access
+ backup = etc/java11-jetbrains/management/jmxremote.password.template
+ backup = etc/java11-jetbrains/management/management.properties
+ backup = etc/java11-jetbrains/net.properties
+ backup = etc/java11-jetbrains/security/java.policy
+ backup = etc/java11-jetbrains/security/java.security
+ backup = etc/java11-jetbrains/security/policy/README.txt
+ backup = etc/java11-jetbrains/security/policy/limited/default_US_export.policy
+ backup = etc/java11-jetbrains/security/policy/limited/default_local.policy
+ backup = etc/java11-jetbrains/security/policy/limited/exempt_local.policy
+ backup = etc/java11-jetbrains/security/policy/unlimited/default_US_export.policy
+ backup = etc/java11-jetbrains/security/policy/unlimited/default_local.policy
+ backup = etc/java11-jetbrains/sound.properties
+
+pkgname = jre11-jetbrains-imfix
+ pkgdesc = JetBrains Java 11 full runtime environment
+ install = install_jre-jetbrains.sh
+ depends = jre11-jetbrains-headless=11.0.9.b1183.9-1
+ depends = giflib
+ optdepends = alsa-lib: for basic sound support
+ optdepends = gtk2: for the Gtk+ 2 look and feel - desktop usage
+ optdepends = gtk3: for the Gtk+ 3 look and feel - desktop usage
+ provides = java-runtime=11
+ provides = java-runtime-jetbrains=11
+ provides = jre11-jetbrains=11.0.9.b1183.9-1
+ provides = jre11-jetbrains=11.0.9.b1183.9
+ conflicts = jre11-jetbrains
+
+pkgname = jdk11-jetbrains-imfix
+ pkgdesc = JetBrains Java 11 development kit
+ install = install_jdk-jetbrains.sh
+ depends = jre11-jetbrains=11.0.9.b1183.9-1
+ depends = java-environment-common=3
+ depends = hicolor-icon-theme
+ depends = libelf
+ provides = java-environment=11
+ provides = java-environment-jetbrains=11
+ provides = jdk11-jetbrains=11.0.9.b1183.9-1
+ provides = jdk11-jetbrains=11.0.9.b1183.9
+ conflicts = jdk11-jetbrains
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..cb3b6cfe8ba
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,267 @@
+# Maintainer: Yizheng Hu <huyizheng@hotmail.com>
+# Contributer: Levente Polyak <anthraxx[at]archlinux[dot]org>
+# Contributer: Guillaume ALAUX <guillaume@archlinux.org>
+
+# This PKGBUILD is directly modified from community/java11-openjdk
+
+# TODO add test, see about packaging jtreg and using it here
+# TODO see about building with OpenJDK10
+# TODO add javazi
+# TODO when IcedTea provides it, package icedtea-web and add it as optdepends
+# TODO package OpenJFX for OpenJDK10 and add it as optdepends
+
+## EXPLORATIONS
+# TODO extract a jmods package from jdk10-openjdk?
+# TODO extract a jdk-headless package?
+
+pkgbase=java11-jetbrains-imfix
+_pkgbase=java11-jetbrains
+pkgname=('jre11-jetbrains-headless-imfix' 'jre11-jetbrains-imfix' 'jdk11-jetbrains-imfix')
+_majorver=11
+_minorver=0
+_securityver=9
+_updatever=11
+_jbver1=1183
+_jbver2=9
+pkgrel=1
+pkgver=${_majorver}.${_minorver}.${_securityver}.b${_jbver1}.${_jbver2}
+_hg_tag=jb${_majorver}_${_minorver}_${_securityver}-b${_jbver2}
+arch=('x86_64')
+url='https://confluence.jetbrains.com/display/JBR/JetBrains+Runtime'
+license=('custom')
+makedepends=('java-environment>=10' 'java-environment<12' 'cpio' 'unzip' 'zip' 'libelf' 'libcups' 'libx11'
+ 'libxrender' 'libxtst' 'libxt' 'libxext' 'libxrandr' 'alsa-lib' 'pandoc'
+ 'graphviz' 'freetype2' 'libjpeg-turbo' 'giflib' 'libpng' 'lcms2'
+ 'libnet' 'bash')
+source=(https://github.com/JetBrains/JetBrainsRuntime/archive/${_hg_tag}.tar.gz
+ https://github.com/prehonor/myJetBrainsRuntime/raw/master/idea.patch
+ freedesktop-java.desktop
+ freedesktop-jconsole.desktop
+ freedesktop-jshell.desktop)
+sha256sums=('f3649db719fea2447875de26886c4fdcc651abc5a946e2ad5b491f9033f63021'
+ 'ceb149421aeceb286143a9c9979f3b9ce9fc9b161dfda1e20d41352c5e4741c4'
+ '915bd0722e897fd811bb0d77829528017ecdfd703880454bc690018ee54e44b6'
+ '3f072ef4d1f59e1188d4b36ff83378c67b9f77db532b4f5cbaeb57cd37620f07'
+ 'c0c01fcc02dc18ed96ef697b3bedce0e8336b212cb1fcee90b2129987f4ae8ec')
+
+case "${CARCH}" in
+ x86_64) _JARCH='x86_64';;
+ i686) _JARCH='x86';;
+esac
+
+_jvmdir=/usr/lib/jvm/java-${_majorver}-jetbrains
+_jdkdir=JetBrainsRuntime-${_hg_tag}
+_imgdir=${_jdkdir}/build/linux-${_JARCH}-normal-server-release/images
+
+_nonheadless=(lib/libawt_xawt.{so,debuginfo}
+ lib/libjawt.{so,debuginfo}
+ lib/libjsound.{so,debuginfo}
+ lib/libsplashscreen.{so,debuginfo})
+
+build() {
+ cd ${_jdkdir}
+
+ # Fix im cursor follow
+ patch -Np1 -i ${srcdir}/idea.patch
+
+ NUM_PROC_OPT=''
+ MAKEFLAG_J=$(echo ${MAKEFLAGS} | sed -En 's/.*-j([0-9]+).*/\1/p')
+ if [ -n "${MAKEFLAG_J}" ]; then
+ # http://hg.openjdk.java.net/jdk10/jdk10/file/85e6cb013b98/make/InitSupport.gmk#l105
+ echo "Removing '-j${MAKEFLAG_J}' from MAKEFLAGS to prevent build fail. Passing it directly to ./configure."
+ export MAKEFLAGS=${MAKEFLAGS/-j${MAKEFLAG_J}/}
+ NUM_PROC_OPT="--with-num-cores=${MAKEFLAG_J}"
+ fi
+
+ # Avoid optimization of HotSpot being lowered from O3 to O2
+ local _CFLAGS="${CFLAGS//-O2/-O3} ${CPPFLAGS} -fcommon"
+ local _CXXFLAGS="${CXXFLAGS//-O2/-O3} ${CPPFLAGS} -fcommon"
+ local _LDFLAGS=${LDFLAGS}
+ if [[ ${CARCH} = i686 ]]; then
+ echo "Removing '-fno-plt' from CFLAGS and CXXFLAGS to prevent build fail with this architecture"
+ _CFLAGS=${CFLAGS/-fno-plt/}
+ _CXXFLAGS=${CXXFLAGS/-fno-plt/}
+ fi
+
+ # CFLAGS, CXXFLAGS and LDFLAGS are ignored as shown by a warning
+ # in the output of ./configure unless used like such:
+ # --with-extra-cflags="${CFLAGS}"
+ # --with-extra-cxxflags="${CXXFLAGS}"
+ # --with-extra-ldflags="${LDFLAGS}"
+ # See also paragraph "Configure Control Variables from "jdk${_majorver}-${_hg_tag}/common/doc/building.md
+ unset CFLAGS
+ unset CXXFLAGS
+ unset LDFLAGS
+
+ bash configure \
+ --with-version-build="${_updatever}" \
+ --with-version-pre="" \
+ --with-version-opt="b${_jbver1}.${_jbver2}" \
+ --with-stdc++lib=dynamic \
+ --with-extra-cflags="${_CFLAGS}" \
+ --with-extra-cxxflags="${_CXXFLAGS}" \
+ --with-extra-ldflags="${_LDFLAGS}" \
+ --with-libjpeg=system \
+ --with-giflib=system \
+ --with-libpng=system \
+ --with-lcms=system \
+ --with-zlib=system \
+ --with-jvm-features=zgc \
+ --enable-unlimited-crypto \
+ --disable-warnings-as-errors \
+ ${NUM_PROC_OPT}
+ #--disable-javac-server
+
+ make images legacy-jre-image
+
+ # https://bugs.openjdk.java.net/browse/JDK-8173610
+ find "../${_imgdir}" -iname '*.so' -exec chmod +x {} \;
+}
+
+check() {
+ cd ${_jdkdir}
+ # TODO package jtreg
+ # make -k check
+}
+
+package_jre11-jetbrains-headless-imfix() {
+ pkgdesc="JetBrains Java ${_majorver} headless runtime environment"
+ depends=('java-runtime-common>=3' 'ca-certificates-utils' 'nss' 'libjpeg-turbo' 'lcms2' 'libnet' 'freetype2')
+ optdepends=('java-rhino: for some JavaScript support')
+ provides=("java-runtime-headless=${_majorver}" "java-runtime-headless-jetbrains=${_majorver}" "jre${_majorver}-jetbrains-headless=${pkgver}-${pkgrel}")
+ _pkgname="jre11-jetbrains-headless"
+ backup=(etc/${_pkgbase}/logging.propertopenjdkies
+ etc/${_pkgbase}/management/jmxremote.access
+ etc/${_pkgbase}/management/jmxremote.password.template
+ etc/${_pkgbase}/management/management.properties
+ etc/${_pkgbase}/net.properties
+ etc/${_pkgbase}/security/java.policy
+ etc/${_pkgbase}/security/java.security
+ etc/${_pkgbase}/security/policy/README.txt
+ etc/${_pkgbase}/security/policy/limited/default_US_export.policy
+ etc/${_pkgbase}/security/policy/limited/default_local.policy
+ etc/${_pkgbase}/security/policy/limited/exempt_local.policy
+ etc/${_pkgbase}/security/policy/unlimited/default_US_export.policy
+ etc/${_pkgbase}/security/policy/unlimited/default_local.policy
+ etc/${_pkgbase}/sound.properties)
+ install=install_jre-jetbrains-headless.sh
+
+ cd ${_imgdir}/jre
+
+ install -dm 755 "${pkgdir}${_jvmdir}"
+
+ cp -a bin lib \
+ "${pkgdir}${_jvmdir}"
+
+ for f in "${_nonheadless[@]}"; do
+ rm "${pkgdir}${_jvmdir}/${f}"
+ done
+
+ cp ../jdk/release "${pkgdir}${_jvmdir}"
+ cp ../jdk/lib/modules "${pkgdir}${_jvmdir}/lib"
+
+ # Conf
+ install -dm 755 "${pkgdir}/etc"
+ cp -r conf "${pkgdir}/etc/${_pkgbase}"
+ ln -s /etc/${_pkgbase} "${pkgdir}/${_jvmdir}/conf"
+
+ # Legal
+ install -dm 755 "${pkgdir}/usr/share/licenses"
+ cp -r legal "${pkgdir}/usr/share/licenses/${_pkgbase}"
+ ln -s ${_pkgbase} "${pkgdir}/usr/share/licenses/${_pkgname}"
+ ln -s /usr/share/licenses/${_pkgbase} "${pkgdir}/${_jvmdir}/legal"
+
+ # Man pages
+ for f in man/man1/* man/ja/man1/*; do
+ install -Dm 644 "${f}" "${pkgdir}/usr/share/${f/\.1/-jetbrains${_majorver}.1}"
+ done
+ ln -s /usr/share/man "${pkgdir}/${_jvmdir}/man"
+
+ # Link JKS keystore from ca-certificates-utils
+ rm -f "${pkgdir}${_jvmdir}/lib/security/cacerts"
+ ln -sf /etc/ssl/certs/java/cacerts "${pkgdir}${_jvmdir}/lib/security/cacerts"
+}
+
+package_jre11-jetbrains-imfix() {
+ pkgdesc="JetBrains Java ${_majorver} full runtime environment"
+ depends=("jre${_majorver}-jetbrains-headless=${pkgver}-${pkgrel}" 'giflib')
+ optdepends=('alsa-lib: for basic sound support'
+ 'gtk2: for the Gtk+ 2 look and feel - desktop usage'
+ 'gtk3: for the Gtk+ 3 look and feel - desktop usage')
+ provides=("java-runtime=${_majorver}" "java-runtime-jetbrains=${_majorver}" "jre${_majorver}-jetbrains=${pkgver}-${pkgrel}")
+ conflicts=("jre11-jetbrains")
+ _pkgname="jre11-jetbrains"
+ install=install_jre-jetbrains.sh
+
+ cd ${_imgdir}/jre
+
+ install -dm 755 "${pkgdir}${_jvmdir}"
+
+ for f in "${_nonheadless[@]}"; do
+ install -Dm 644 ${f} "${pkgdir}${_jvmdir}/${f}"
+ done
+
+ # Licenses
+ install -dm 755 "${pkgdir}/usr/share/licenses"
+ ln -s ${_pkgbase} "${pkgdir}/usr/share/licenses/${_pkgname}"
+}
+
+package_jdk11-jetbrains-imfix() {
+ pkgdesc="JetBrains Java ${_majorver} development kit"
+ depends=("jre${_majorver}-jetbrains=${pkgver}-${pkgrel}" 'java-environment-common=3' 'hicolor-icon-theme' 'libelf')
+ provides=("java-environment=${_majorver}" "java-environment-jetbrains=${_majorver}" "jdk${_majorver}-jetbrains=${pkgver}-${pkgrel}")
+ conflicts=("jdk11-jetbrains")
+ _pkgname="jdk11-jetbrains"
+ install=install_jdk-jetbrains.sh
+
+ cd ${_imgdir}/jdk
+
+ install -dm 755 "${pkgdir}${_jvmdir}"
+
+ cp -a bin demo include jmods lib \
+ "${pkgdir}${_jvmdir}"
+
+ rm "${pkgdir}${_jvmdir}/lib/src.zip"
+
+ # Remove files held by JRE
+ pushd ../jre
+ for d in bin lib; do
+ find ${d} ! -type d -exec rm "${pkgdir}${_jvmdir}/{}" \;
+ done
+ popd
+ find "${pkgdir}${_jvmdir}/lib" -type d -empty -delete
+
+ # Conf files all belong to JRE
+
+ # Legal
+ install -dm 755 "${pkgdir}/usr/share/licenses"
+ cp -r legal "${pkgdir}/usr/share/licenses/${_pkgbase}"
+ pushd ../jre/legal
+ find . ! -type d -exec rm "${pkgdir}/usr/share/licenses/${_pkgbase}/{}" \;
+ popd
+ find "${pkgdir}/usr/share/licenses" -type d -empty -delete
+ ln -s ${_pkgbase} "${pkgdir}/usr/share/licenses/${_pkgname}"
+
+ # Man pages
+ for f in man/man1/* man/ja/man1/*; do
+ if [ ! -e "../jre/${f}" ]; then
+ install -Dm 644 "${f}" "${pkgdir}/usr/share/${f/\.1/-jetbrains${_majorver}.1}"
+ fi
+ done
+
+ # Icons
+ for s in 16 24 32 48; do
+ install -Dm 644 \
+ "${srcdir}/${_jdkdir}/src/java.desktop/unix/classes/sun/awt/X11/java-icon${s}.png" \
+ "${pkgdir}/usr/share/icons/hicolor/${s}x${s}/apps/${_pkgbase}.png"
+ done
+
+ # Desktop files
+ for f in jconsole java jshell; do
+ install -Dm 644 \
+ "${srcdir}/freedesktop-${f}.desktop" \
+ "${pkgdir}/usr/share/applications/${f}-${_pkgbase}.desktop"
+ done
+}
+
+# vim: ts=2 sw=2 et:
diff --git a/freedesktop-java.desktop b/freedesktop-java.desktop
new file mode 100644
index 00000000000..80173d6dc8f
--- /dev/null
+++ b/freedesktop-java.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Name=JetBrains Java 11 Runtime
+Name[fi]=JetBrains Java 11 - ajonaikainen ympäristö
+Comment=JetBrains Java 11 Runtime
+Comment[fi]=JetBrains Java 11 - ajonaikainen ympäristö
+Keywords=java;runtime
+Exec=/usr/lib/jvm/java-11-jetbrains/bin/java -jar
+Terminal=false
+Type=Application
+Icon=java11-jetbrains
+MimeType=application/x-java-archive;application/java-archive;application/x-jar;
+NoDisplay=true
diff --git a/freedesktop-jconsole.desktop b/freedesktop-jconsole.desktop
new file mode 100644
index 00000000000..6f9f415ab5d
--- /dev/null
+++ b/freedesktop-jconsole.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=JetBrains Java 11 Console
+Name[fi]=JetBrains Java 11 - konsoli
+Comment=JetBrains Java 11 Monitoring & Management Console
+Comment[fi]=JetBrains Java 11 - valvonta- ja hallintakonsoli
+Keywords=java;console;monitoring
+Exec=/usr/lib/jvm/java-11-jetbrains/bin/jconsole
+Terminal=false
+Type=Application
+Icon=java11-jetbrains
+Categories=Application;System;
diff --git a/freedesktop-jshell.desktop b/freedesktop-jshell.desktop
new file mode 100644
index 00000000000..937f0fee0a1
--- /dev/null
+++ b/freedesktop-jshell.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=JetBrains Java 11 Shell
+Comment=JetBrains Java 11 Shell
+Keywords=java;shell
+Exec=/usr/lib/jvm/java-11-jetbrains/bin/jshell
+Terminal=true
+Type=Application
+Icon=java11-jetbrains
+Categories=Application;System;
diff --git a/install_jdk-jetbrains.sh b/install_jdk-jetbrains.sh
new file mode 100644
index 00000000000..ea0eab83a76
--- /dev/null
+++ b/install_jdk-jetbrains.sh
@@ -0,0 +1,50 @@
+THIS_JDK='java-11-jetbrains'
+
+fix_default() {
+ if [ ! -x /usr/bin/java ]; then
+ /usr/bin/archlinux-java unset
+ echo ""
+ else
+ /usr/bin/archlinux-java get
+ fi
+}
+
+post_install() {
+ default=$(fix_default)
+ case ${default} in
+ "")
+ /usr/bin/archlinux-java set ${THIS_JDK}
+ ;;
+ ${THIS_JDK})
+ # Nothing
+ ;;
+ *)
+ echo "Default Java environment is already set to '${default}'"
+ echo "See 'archlinux-java help' to change it"
+ ;;
+ esac
+
+ if [ ! -f /etc/ssl/certs/java/cacerts ]; then
+ /usr/bin/update-ca-trust
+ fi
+}
+
+post_upgrade() {
+ default=$(fix_default)
+ if [ -z "${default}" ]; then
+ /usr/bin/archlinux-java set ${THIS_JDK}
+ fi
+
+ if [ ! -f /etc/ssl/certs/java/cacerts ]; then
+ /usr/bin/update-ca-trust
+ fi
+}
+
+pre_remove() {
+ if [ "x$(fix_default)" = "x${THIS_JDK}" ]; then
+ # Check JRE is still available
+ if [ -x /usr/lib/jvm/${THIS_JDK}/bin/java ]; then
+ /usr/bin/archlinux-java unset
+ fi
+ fi
+}
diff --git a/install_jre-jetbrains-headless.sh b/install_jre-jetbrains-headless.sh
new file mode 100644
index 00000000000..425d0620efd
--- /dev/null
+++ b/install_jre-jetbrains-headless.sh
@@ -0,0 +1,48 @@
+THIS_JRE='java-11-jetbrains'
+
+fix_default() {
+ if [ ! -x /usr/bin/java ]; then
+ /usr/bin/archlinux-java unset
+ echo ""
+ else
+ /usr/bin/archlinux-java get
+ fi
+}
+
+post_install() {
+ default=$(fix_default)
+ case ${default} in
+ "")
+ /usr/bin/archlinux-java set ${THIS_JRE}
+ ;;
+ ${THIS_JRE})
+ # Nothing
+ ;;
+ *)
+ echo "Default Java environment is already set to '${default}'"
+ echo "See 'archlinux-java help' to change it"
+ ;;
+ esac
+
+ if [ ! -f /etc/ssl/certs/java/cacerts ]; then
+ /usr/bin/update-ca-trust
+ fi
+}
+
+post_upgrade() {
+ if [ -z "$(fix_default)" ]; then
+ /usr/bin/archlinux-java set ${THIS_JRE}
+ fi
+
+ if [ ! -f /etc/ssl/certs/java/cacerts ]; then
+ /usr/bin/update-ca-trust
+ fi
+}
+
+pre_remove() {
+ default=$(fix_default)
+ if [ "x${default}" = "x${THIS_JRE}" ]; then
+ /usr/bin/archlinux-java unset
+ echo "No Java environment is set as default anymore"
+ fi
+}
diff --git a/install_jre-jetbrains.sh b/install_jre-jetbrains.sh
new file mode 100644
index 00000000000..c278bd2eb58
--- /dev/null
+++ b/install_jre-jetbrains.sh
@@ -0,0 +1,35 @@
+THIS_JRE='java-11-jetbrains'
+
+fix_default() {
+ if [ ! -x /usr/bin/java ]; then
+ /usr/bin/archlinux-java unset
+ echo ""
+ else
+ /usr/bin/archlinux-java get
+ fi
+}
+
+post_install() {
+ default=$(fix_default)
+ case ${default} in
+ "")
+ /usr/bin/archlinux-java set ${THIS_JRE}
+ ;;
+ ${THIS_JRE})
+ # Nothing
+ ;;
+ *)
+ echo "Default Java environment is already set to '${default}'"
+ echo "See 'archlinux-java help' to change it"
+ ;;
+ esac
+
+ echo "when you use a non-reparenting window manager,"
+ echo "set _JAVA_AWT_WM_NONREPARENTING=1 in /etc/profile.d/jre.sh"
+}
+
+post_upgrade() {
+ if [ -z "$(fix_default)" ]; then
+ /usr/bin/archlinux-java set ${THIS_JRE}
+ fi
+}