makedeb
Prism Launcher fork with support for alternative auth servers
Click here to go back to the commit logs for fjordlauncher.
Hash: 555278df16d57c8abd93e7cd8d549e41a2050a60
Message: various improvements for armv7 and optdepends
- support more architectures by making architecture detection more reliable
- add `gamemode`, `flite`, `x11-xserver-utils` as suggested packages
- change java 8 from recommended to suggested
- add a patch to workaround gcc/armv7 bug https://github.com/PrismLauncher/PrismLauncher/issues/128
- support generic builds for pentium CPUs
- indent with 4 spaces
Signed-off-by: lordpipe <lordpipe@protonmail.com>
diff --git a/.SRCINFO b/.SRCINFO
index eea5041..b7678ae 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -2,10 +2,10 @@ generated-by = makedeb
pkgname = prismlauncher
pkgbase = prismlauncher
pkgdesc = Minecraft launcher with ability to manage multiple instances.
-pkgrel = 4
+pkgrel = 5
pkgver = 7.2
url = https://prismlauncher.org
-arch = i686
+arch = i386
arch = amd64
arch = arm64
arch = armhf
@@ -30,10 +30,15 @@ makedepends = qt5-qmake
makedepends = qtbase5-dev-tools
makedepends = gcc
makedepends = g++
-optdepends = java-runtime=8: support for Minecraft versions < 1.17
optdepends = java-runtime=17: support for Minecraft versions >= 1.17
+optdepends = s!java-runtime=8: support for Minecraft versions <= 1.16
+optdepends = s!gamemode: support for GameMode
+optdepends = s!flite: narrator support
+optdepends = s!x11-xserver-utils: xrandr is needed to support Minecraft versions <= 1.12
source = https://github.com/PrismLauncher/PrismLauncher/releases/download/7.2/PrismLauncher-7.2.tar.gz
+source = gcc-armv7-fix.patch
sha256sums = 5733b55c4532286813a6fb7de2f3a38e6f6db743a251919c8b646d32a84514b4
+sha256sums = 42394447d4b52c9329ff45f3c700c0eb2090a5803c5de010587d64294c37420f
makedepends = scdoc
makedepends = extra-cmake-modules
makedepends = cmake
@@ -47,5 +52,8 @@ makedepends = qt5-qmake
makedepends = qtbase5-dev-tools
makedepends = gcc
makedepends = g++
-optdepends = java-runtime=8: support for Minecraft versions < 1.17
optdepends = java-runtime=17: support for Minecraft versions >= 1.17
+optdepends = s!java-runtime=8: support for Minecraft versions <= 1.16
+optdepends = s!gamemode: support for GameMode
+optdepends = s!flite: narrator support
+optdepends = s!x11-xserver-utils: xrandr is needed to support Minecraft versions <= 1.12
diff --git a/PKGBUILD b/PKGBUILD
index fd4feb9..a013b46 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,23 +4,28 @@
pkgname=prismlauncher
pkgver=7.2
-pkgrel=4
-pkgdesc="Minecraft launcher with ability to manage multiple instances."
-arch=('i686' 'amd64' 'arm64' 'armhf' 'riscv64')
-url="https://prismlauncher.org"
+pkgrel=5
+pkgdesc='Minecraft launcher with ability to manage multiple instances.'
+arch=('i386' 'amd64' 'arm64' 'armhf' 'riscv64')
+url='https://prismlauncher.org'
license=('GPL3')
depends=('libqt5svg5' 'qt5-image-formats-plugins' 'libqt5xml5' 'libqt5core5a' 'libqt5network5' 'libqt5gui5')
makedepends=('scdoc' 'extra-cmake-modules' 'cmake' 'git' 'openjdk-17-jdk' 'zlib1g-dev' 'libgl1-mesa-dev' 'qtbase5-dev' 'qtchooser' 'qt5-qmake' 'qtbase5-dev-tools' 'gcc' 'g++')
-optdepends=('java-runtime=8: support for Minecraft versions < 1.17'
- 'java-runtime=17: support for Minecraft versions >= 1.17')
-source=("https://github.com/PrismLauncher/PrismLauncher/releases/download/$pkgver/PrismLauncher-$pkgver.tar.gz")
-sha256sums=('5733b55c4532286813a6fb7de2f3a38e6f6db743a251919c8b646d32a84514b4')
+optdepends=('java-runtime=17: support for Minecraft versions >= 1.17'
+ 's!java-runtime=8: support for Minecraft versions <= 1.16'
+ 's!gamemode: support for GameMode'
+ 's!flite: narrator support'
+ 's!x11-xserver-utils: xrandr is needed to support Minecraft versions <= 1.12')
+source=("https://github.com/PrismLauncher/PrismLauncher/releases/download/$pkgver/PrismLauncher-$pkgver.tar.gz"
+ 'gcc-armv7-fix.patch')
+sha256sums=('5733b55c4532286813a6fb7de2f3a38e6f6db743a251919c8b646d32a84514b4'
+ '42394447d4b52c9329ff45f3c700c0eb2090a5803c5de010587d64294c37420f')
# allow for ARM support
#TODO: makedeb's hard-coding for x86-64 has been fixed in a future makedeb version
-#TODO: these 6 lines make this script match the behavior of future makedeb. When it releases, remove this
-CARCH="$(uname -p)"
-CHOST="$(uname -p)-pc-linux-gnu"
+#TODO: these 8 lines make this script match the behavior of future makedeb. When it releases, remove this
+CARCH="$(dpkg --print-architecture)"
+CHOST="$(uname -m)-pc-linux-gnu"
CFLAGS=${CFLAGS/-march=x86-64/}
CXXFLAGS=${CXXFLAGS/-march=x86-64/}
CFLAGS=${CFLAGS/-mtune=generic/}
@@ -30,44 +35,59 @@ CXXFLAGS=${CXXFLAGS/-fcf-protection/}
# if the user hasn't specified a tuning/architecture, specify our own minimal defaults to cover the earliest CPUs
if [[ ${CFLAGS} != *"-mtune"* && ${CFLAGS} != *"-march"* ]]; then
- case $(uname -m) in
- x86_64)
- CFLAGS+=" -march=x86-64 -mtune=generic -fcf-protection"
- CXXFLAGS+=" -march=x86-64 -mtune=generic -fcf-protection"
- ;;
- aarch64*|armv8*|armv9*|arm64*)
- CFLAGS+=" -march=armv8-a -mtune=generic"
- CXXFLAGS+=" -march=armv8-a -mtune=generic"
- ;;
- arm*)
- CFLAGS+=" -march=armv7-a"
- CXXFLAGS+=" -march=armv7-a"
- ;;
- riscv64*)
- CFLAGS+=" -march=rv64imafdc"
- CXXFLAGS+=" -march=rv64imafdc"
- ;;
- esac
+ case "$(uname -m)" in
+ x86_64)
+ CFLAGS+=" -march=x86-64 -mtune=generic -fcf-protection"
+ CXXFLAGS+=" -march=x86-64 -mtune=generic -fcf-protection"
+ ;;
+ i686)
+ CFLAGS+=" -march=i686 -mtune=generic"
+ CXXFLAGS+=" -march=i686 -mtune=generic"
+ ;;
+ aarch64*|armv8*|armv9*|arm64*)
+ CFLAGS+=" -march=armv8-a -mtune=generic"
+ CXXFLAGS+=" -march=armv8-a -mtune=generic"
+ ;;
+ arm*)
+ CFLAGS+=" -march=armv7-a+fp"
+ CXXFLAGS+=" -march=armv7-a+fp"
+ ;;
+ riscv64*)
+ CFLAGS+=" -march=rv64imafdc"
+ CXXFLAGS+=" -march=rv64imafdc"
+ ;;
+ esac
fi
+prepare() {
+ # workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64860
+ # more info: https://github.com/PrismLauncher/PrismLauncher/issues/128
+ if [[ "$(uname -m)" = armv7* ]]; then
+ echo "GCC / ARMv7 fix is needed for this architecture, applying gcc-armv7-fix.patch"
+ patch --directory="PrismLauncher-$pkgver" --forward --strip=1 --input="${srcdir}/gcc-armv7-fix.patch"
+ else
+ echo "GCC / ARMv7 fix is not needed for this architecture, skipping gcc-armv7-fix.patch"
+ fi
+}
+
build() {
- cd "${srcdir}/PrismLauncher-$pkgver"
- cmake -DCMAKE_BUILD_TYPE=None \
- -DCMAKE_INSTALL_PREFIX="/usr" \
- -DLauncher_BUILD_PLATFORM="debian" \
- -DLauncher_APP_BINARY_NAME="${pkgname}" \
- -DLauncher_QT_VERSION_MAJOR=5 \
- -DENABLE_LTO=ON \
- -Bbuild -S.
- cmake --build build
+ cd "${srcdir}/PrismLauncher-$pkgver"
+ cmake -DCMAKE_BUILD_TYPE=None \
+ -DCMAKE_INSTALL_PREFIX="/usr" \
+ -DLauncher_BUILD_PLATFORM="debian" \
+ -DLauncher_APP_BINARY_NAME="${pkgname}" \
+ -DLauncher_QT_VERSION_MAJOR=5 \
+ -DENABLE_LTO=ON \
+ -Bbuild -S.
+ cmake --build build
}
check() {
- cd "${srcdir}/PrismLauncher-$pkgver/build"
- ctest . -E Task # Skip unreliable Task test
+ cd "${srcdir}/PrismLauncher-$pkgver/build"
+ ctest . -E Task # Skip unreliable Task test
}
package() {
- cd "${srcdir}/PrismLauncher-$pkgver/build"
- DESTDIR="$pkgdir" cmake --install .
+ cd "${srcdir}/PrismLauncher-$pkgver/build"
+ DESTDIR="$pkgdir" cmake --install .
}
diff --git a/gcc-armv7-fix.patch b/gcc-armv7-fix.patch
new file mode 100644
index 0000000..d4e6ffc
--- /dev/null
+++ b/gcc-armv7-fix.patch
@@ -0,0 +1,18 @@
+diff --unified --recursive --text package.orig/libraries/libnbtplusplus/include/tag_primitive.h package.new/libraries/libnbtplusplus/include/tag_primitive.h
+--- package.orig/libraries/libnbtplusplus/include/tag_primitive.h 2023-07-29 07:27:41.045212463 +0000
++++ package.new/libraries/libnbtplusplus/include/tag_primitive.h 2023-07-29 07:28:19.127613449 +0000
+@@ -77,14 +77,6 @@
+ typedef tag_primitive<float> tag_float;
+ typedef tag_primitive<double> tag_double;
+
+-//Explicit instantiations
+-template class NBT_EXPORT tag_primitive<int8_t>;
+-template class NBT_EXPORT tag_primitive<int16_t>;
+-template class NBT_EXPORT tag_primitive<int32_t>;
+-template class NBT_EXPORT tag_primitive<int64_t>;
+-template class NBT_EXPORT tag_primitive<float>;
+-template class NBT_EXPORT tag_primitive<double>;
+-
+ template<class T>
+ void tag_primitive<T>::read_payload(io::stream_reader& reader)
+ {