summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD32
-rw-r--r--crystallauncher100
3 files changed, 119 insertions, 37 deletions
diff --git a/.SRCINFO b/.SRCINFO
index cb09c370d1d..30ff4b7a48d 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,24 +1,26 @@
pkgbase = crystallauncher
- pkgdesc = Crystal Launcher is a unofficial launcher for Minecraft that has own packages repository. It can also run official launcher packages.
- pkgver = 1.0.0.1
+ pkgdesc = Crystal Launcher is a unofficial Minecraft launcher with support for modpacks and custom HD skin and cape system
+ pkgver = 1.1.0.0
pkgrel = 1
url = https://crystal-launcher.net/
- arch = any
+ arch = i686
+ arch = x86_64
license = CCPL
makedepends = unzip
- depends = java-runtime
- depends = openal
- depends = java-openjfx
+ depends = java-runtime=8
+ depends = java8-openjfx
+ depends = bash
+ depends = zenity
provides = crystallauncher
noextract = jar
- source = http://main.crystal-launcher.pl/releases/other/CrystalLauncher.jar
+ source = https://crystal-launcher.net/releases/other/CrystalLauncher.jar
source = crystallauncher
source = crystallauncher.desktop
source = crystallauncher.png
- md5sums = SKIP
- md5sums = 59a97acf743c32226f52b374dc84803d
- md5sums = 4724472411e932b005f1b0d66a47f14e
- md5sums = 1fc2ef4be5729d96f9928af152fc1763
+ sha256sums = cb495e726512a039df6f6d297ba7cfd9ce0b1fe368bad5ba20abe7852d65527a
+ sha256sums = e0a4ecd9122c81bb6949db9b12e174e1e79b5cdff52073f22b7f812577b56825
+ sha256sums = 08fd03cd4f89291b2290f96aeec2bd40c267b03afbabd42a3ad5b127c43cc3f2
+ sha256sums = 214f4f12eb772d2ce945723ab7b126b1fb3e78c009f4132d6b0f98ea2270ab0c
pkgname = crystallauncher
diff --git a/PKGBUILD b/PKGBUILD
index 082d8d4c127..46b57d34dd4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,28 +2,25 @@
pkgname=crystallauncher
pkgrel=1
-pkgver=1.0.0.1
-pkgdesc="Crystal Launcher is a unofficial launcher for Minecraft that has own packages repository. It can also run official launcher packages."
-arch=('any')
+pkgver=1.1.0.0
+pkgdesc="Crystal Launcher is a unofficial Minecraft launcher with support for modpacks and custom HD skin and cape system"
+arch=('i686' 'x86_64')
url="https://crystal-launcher.net/"
license=('CCPL')
-depends=('jdk8-openjdk' 'openal' 'java8-openjfx')
+depends=('java-runtime=8' 'java8-openjfx' 'bash' 'zenity')
makedepends=('unzip')
provides=('crystallauncher')
-source=("http://main.crystal-launcher.pl/releases/other/CrystalLauncher.jar"
- "crystallauncher"
- "crystallauncher.desktop"
- "crystallauncher.png"
- )
-noextract=('jar')
-
-
-md5sums=('5a1ad091cd288d88c4132d8d9a616a00'
- '39650fe38b376bcd45090640fa867cc3'
- '4724472411e932b005f1b0d66a47f14e'
- '1fc2ef4be5729d96f9928af152fc1763')
+source=("https://crystal-launcher.net/releases/other/CrystalLauncher.jar"
+ "crystallauncher"
+ "crystallauncher.desktop"
+ "crystallauncher.png")
+noextract=('jar')
+sha256sums=('cb495e726512a039df6f6d297ba7cfd9ce0b1fe368bad5ba20abe7852d65527a'
+ 'e0a4ecd9122c81bb6949db9b12e174e1e79b5cdff52073f22b7f812577b56825'
+ '08fd03cd4f89291b2290f96aeec2bd40c267b03afbabd42a3ad5b127c43cc3f2'
+ '214f4f12eb772d2ce945723ab7b126b1fb3e78c009f4132d6b0f98ea2270ab0c')
pkgver() {
echo $pkgver
@@ -39,9 +36,8 @@ package() {
# install shell wrapper script
install -D -m755 "${srcdir}/crystallauncher" "${pkgdir}/usr/bin/crystallauncher"
-noextract=('jar')
# install jar
- install -D -m644 "${srcdir}/CrystalLauncher.jar" "${pkgdir}/usr/share/java/CrystalLauncher/launcher.jar"
+ install -D -m644 "${srcdir}/CrystalLauncher.jar" "${pkgdir}/usr/share/java/CrystalLauncher/launcher.jar"
# install desktop launcher with icon
install -D -m644 "${srcdir}/crystallauncher.desktop" "${pkgdir}/usr/share/applications/crystallauncher.desktop"
diff --git a/crystallauncher b/crystallauncher
index ccc4b89800b..1f4e5708cd9 100644
--- a/crystallauncher
+++ b/crystallauncher
@@ -1,13 +1,97 @@
-#!/bin/sh
+#!/bin/bash
-# fix for users of special IM modules
+# env
+JVM_EXEC_ORACLE=/1usr/lib/jvm/java-8-jdk/jre/bin/java
+JVM_EXEC=/usr/lib/jvm/java-8-openjdk/jre/bin/java
+JVM=java
+IS_OPENJDK=0
+
+# env fixes
unset XMODIFIERS GTK_IM_MODULE QT_IM_MODULE
+unset CLASSPATH
+unset JAVA_OPTIONS
+
+assert_check_jvm_env() {
+ if [ -f $JVM_EXEC_ORACLE ]; then
+ JVM=$JVM_EXEC_ORACLE
+ elif [ -f $JVM_EXEC ]; then
+ JVM=$JVM_EXEC;
+ else
+ if ! command -v $JVM &> /dev/null; then
+ show_message "Java not found!!!";
+ exit 1;
+ else
+ _tmp=`command -v $JVM`
+ JVM=`realpath $_tmp`
+ fi
+ fi
+ IS_OPENJDK="$(is_openjdk)";
+}
+
+is_openjdk() {
+ if [[ $($JVM -version 2>&1 | grep "OpenJDK") ]]; then echo 1; else echo 0; fi;
+}
+
+assert_is_java8() {
+ version="$(jdk_version)";
+ if [[ "$version" == "8" ]]; then
+ return 0;
+ else
+ show_message "You're using Java $version, which is not supported by Crystal Launcher! Please install openjdk8 or oracle jdk8...";
+ exit 1;
+ fi
+}
+
+jdk_version() {
+ local result
+ local java_cmd
+ java_cmd=$JVM
+ local IFS=$'\n'
+ # remove \r for Cygwin
+ local lines=$("$java_cmd" -Xms32M -Xmx32M -version 2>&1 | tr '\r' '\n')
+ if [[ -z $java_cmd ]]
+ then
+ result=no_java
+ else
+ for line in $lines; do
+ if [[ (-z $result) && ($line = *"version \""*) ]]
+ then
+ local ver=$(echo $line | sed -e 's/.*version "\(.*\)"\(.*\)/\1/; 1q')
+ # on macOS, sed doesn't support '?'
+ if [[ $ver = "1."* ]]
+ then
+ result=$(echo $ver | sed -e 's/1\.\([0-9]*\)\(.*\)/\1/; 1q')
+ else
+ result=$(echo $ver | sed -e 's/\([0-9]*\)\(.*\)/\1/; 1q')
+ fi
+ fi
+ done
+ fi
+ echo "$result"
+}
+
+show_message() {
+ zenity --info --text="$1"
+}
+
+run() {
+ mkdir -p ${HOME}/.local/share/CrystalLauncher
+ echo ${HOME}/.local/share/CrystalLauncher > ${HOME}/.crystalinst
+
+ if [ ! -f ${HOME}/.local/share/CrystalLauncher/launcher.jar ]; then
+ touch ${HOME}/.local/share/CrystalLauncher/launcher.jar
+ fi
-mkdir -p ${HOME}/.local/share/CrystalLauncher
-echo ${HOME}/.local/share/CrystalLauncher > ${HOME}/.crystalinst
+ exec $JVM -jar /usr/share/java/CrystalLauncher/launcher.jar $@ | sed 's/\\n/\n/g; s/\\r/\r/g' #console output fix
+}
-if [ ! -f ${HOME}/.local/share/CrystalLauncher/launcher.jar ]; then
- touch ${HOME}/.local/share/CrystalLauncher/launcher.jar
-fi
+echo "Crystal Launcher launch script";
+assert_check_jvm_env;
+echo "Using Java executable: $JVM"
+assert_is_java8;
+echo "Using Java version: $version";
-exec java -jar /usr/share/java/CrystalLauncher/launcher.jar $@
+if [[ "$IS_OPENJDK" == "1" ]]; then
+ echo "[WARNING] Using OpenJDK implementation of Java... It's strongly recommended to use Oracle Java for best performance!";
+fi;
+run;