summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiovanni Santini2021-08-09 15:48:51 +0200
committerGiovanni Santini2021-08-09 15:50:26 +0200
commita427839a01b08041bddb50f5ae408c9d3627b642 (patch)
tree8846eb724e79a9bab3498c689638108e55fc1f5e
downloadaur-a427839a01b08041bddb50f5ae408c9d3627b642.tar.gz
addpkg: crystal-launcher
- New package for Crystal Launcher. Based on the prototype files available in /usr/share/pacman .
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD49
-rw-r--r--crystal-launcher.desktop9
-rw-r--r--crystal-launcher.install19
-rwxr-xr-xcrystal-launcher.sh29
5 files changed, 127 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..79179301732a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = crystal-launcher
+ pkgdesc = A custom Minecraft launcher with its own package system
+ pkgver = 20210809
+ pkgrel = 1
+ url = https://crystal-launcher.net/
+ install = crystal-launcher.install
+ arch = any
+ license = unknown
+ depends = java-runtime=8
+ depends = java-runtime>=16
+ depends = java8-openjfx
+ source = crystal-launcher.jar::http://main.crystal-launcher.pl/releases/other/CrystalLauncher.jar
+ source = crystal-launcher.png::http://main.crystal-launcher.pl/releases/icon.png
+ source = crystal-launcher.sh
+ source = crystal-launcher.desktop
+ sha256sums = cb495e726512a039df6f6d297ba7cfd9ce0b1fe368bad5ba20abe7852d65527a
+ sha256sums = 214f4f12eb772d2ce945723ab7b126b1fb3e78c009f4132d6b0f98ea2270ab0c
+ sha256sums = 6aec5cf9f6ed8a20e138104e0cb9f33c1cbb0798ca00981158b9dbd3c4cc437a
+ sha256sums = ff160d4a4cfe366f0ec806d7eeeac4bfd5e83c3d01afbc22ecc5caa1adb247ef
+
+pkgname = crystal-launcher
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..258047220c66
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,49 @@
+# Maintainer: Giovanni Santini <giovannisantini93@yahoo.it>
+pkgname=crystal-launcher
+pkgver=20210809
+pkgrel=1
+pkgdesc="A custom Minecraft launcher with its own package system"
+arch=(any)
+url="https://crystal-launcher.net/"
+license=('unknown')
+depends=(
+ # For Minecraft >= 1.17
+ "java-runtime=8"
+ # For Minecraft < 1.17
+ "java-runtime>=16"
+ # For client GUI
+ java8-openjfx
+)
+install="$pkgname.install"
+source=("$pkgname.jar::http://main.crystal-launcher.pl/releases/other/CrystalLauncher.jar"
+ "$pkgname.png::http://main.crystal-launcher.pl/releases/icon.png"
+ "$pkgname.sh"
+ "$pkgname.desktop")
+noextract=()
+sha256sums=('cb495e726512a039df6f6d297ba7cfd9ce0b1fe368bad5ba20abe7852d65527a'
+ '214f4f12eb772d2ce945723ab7b126b1fb3e78c009f4132d6b0f98ea2270ab0c'
+ '6aec5cf9f6ed8a20e138104e0cb9f33c1cbb0798ca00981158b9dbd3c4cc437a'
+ 'ff160d4a4cfe366f0ec806d7eeeac4bfd5e83c3d01afbc22ecc5caa1adb247ef')
+
+# Adjust this based on the runtimes you will use.
+# The defaults are the one available in the official repositories.
+_jre_16="jre-openjdk"
+_jre_8="jre8-openjdk"
+
+package() {
+ cd "$srcdir"
+
+ mkdir -p "$pkgdir/usr/share/java"
+ cp -v "$pkgname.jar" "$pkgdir/usr/share/java"
+
+ mkdir -p "$pkgdir/usr/bin"
+ # Adjust the JVMs in the script
+ sed -i "$pkgname.sh" -e "s|%JAVA_8%|$_jre_8|" -e "s|%JAVA_16%|$_jre_16|"
+ cp -v "$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
+
+ mkdir -p "$pkgdir/usr/share/applications"
+ cp -v "$pkgname.desktop" "$pkgdir/usr/share/applications"
+
+ mkdir -p "$pkgdir/usr/share/pixmaps"
+ cp -v "$pkgname.png" "$pkgdir/usr/share/pixmaps"
+}
diff --git a/crystal-launcher.desktop b/crystal-launcher.desktop
new file mode 100644
index 000000000000..8101803e9493
--- /dev/null
+++ b/crystal-launcher.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Crystal Launcher
+GenericName=Crystal Launcher
+Comment=A Minecraft modpack launcher
+Exec=/usr/bin/crystal-launcher
+Icon=crystal-launcher
+Terminal=false
+Type=Application
+Categories=Game;
diff --git a/crystal-launcher.install b/crystal-launcher.install
new file mode 100644
index 000000000000..b964b407222d
--- /dev/null
+++ b/crystal-launcher.install
@@ -0,0 +1,19 @@
+# Based on the prototype here:
+# /usr/share/pacman/proto.install
+
+post_install() {
+ echo "If you would like to configure a specific directory for the launcher files,"
+ echo "write the desired path to the file '.crystalinst' in your home directory."
+ echo
+ echo "An example is:"
+ echo ' echo "/PATH/FOR/LAUNCHER" > $HOME/.crystalinst'
+}
+
+post_remove() {
+ echo "Remember to remove the launcher files!"
+ echo
+ echo "You can see where the files are stored via:"
+ echo ' cat $HOME/.crystalinst'
+ echo "You can then remove the files via:"
+ echo " rm -rfv /PATH/FOR/LAUNCHER"
+}
diff --git a/crystal-launcher.sh b/crystal-launcher.sh
new file mode 100755
index 000000000000..d58f853eb35d
--- /dev/null
+++ b/crystal-launcher.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+# Based on:
+# https://wiki.archlinux.org/title/Java_package_guidelines
+
+# Force installation in the standard path
+CL_INST_CONF="$HOME/.crystalinst"
+if [ ! -f $CL_INST_CONF ]
+then
+ touch "$CL_INST_CONF"
+ echo "$HOME/Crystal-Launcher" > "$CL_INST_CONF"
+fi
+
+# At the first time set up the proper JREs in the config file
+JAVA_8="%JAVA_8%"
+JAVA_16="%JAVA_16%"
+
+CL_CONFIG="`cat $CL_INST_CONF`/config.prop"
+if [ ! -f $CL_CONFIG ]
+then
+ touch $CL_CONFIG
+ echo "customjvmdir_v2.path=/usr/lib/jvm/$JAVA_8/jre/bin/java" > "$CL_CONFIG"
+ echo "customjvmdir_v2.use=true" >> "$CL_CONFIG"
+ echo "customjvmdir_v3.path=/usr/lib/jvm/$JAVA_16/bin/java" >> "$CL_CONFIG"
+ echo "customjvmdir_v3.use=true" >> "$CL_CONFIG"
+fi
+
+# Run the app correctly
+exec /usr/bin/java -jar '/usr/share/java/crystal-launcher.jar' "$@"
+