makedeb


prismlauncher-git 9.0.r1.12db1ef-1


Minecraft launcher with ability to manage multiple instances.

Click here to go back to the commit logs for prismlauncher-git.

Commit:


Hash: fb3c98c83b00eda0826a33de6b2bae9601f00d9e

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


diff --git a/.SRCINFO b/.SRCINFO
index de2a91f..febe1f7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -2,10 +2,10 @@ generated-by = makedeb
 pkgname = prismlauncher-git
 pkgbase = prismlauncher-git
 pkgdesc = Minecraft launcher with ability to manage multiple instances.
-pkgrel = 3
-pkgver = 8.0.r1.bdec11c
+pkgrel = 1
+pkgver = 8.0.r1.9137721
 url = https://github.com/PrismLauncher/PrismLauncher
-arch = i686
+arch = i386
 arch = amd64
 arch = arm64
 arch = armhf
@@ -31,11 +31,16 @@ 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
 provides = prismlauncher
 source = git+https://github.com/PrismLauncher/PrismLauncher.git
+source = gcc-armv7-fix.patch
 sha256sums = SKIP
+sha256sums = 42394447d4b52c9329ff45f3c700c0eb2090a5803c5de010587d64294c37420f
 makedepends = scdoc
 makedepends = extra-cmake-modules
 makedepends = cmake
@@ -49,5 +54,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 ca94c30..c8f8afb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,27 +4,32 @@
 
 _pkgname=prismlauncher
 pkgname=${_pkgname}-git
-pkgver=8.0.r1.bdec11c
-pkgrel=3
+pkgver=8.0.r1.9137721
+pkgrel=1
 pkgdesc="Minecraft launcher with ability to manage multiple instances."
-arch=('i686' 'amd64' 'arm64' 'armhf' 'riscv64')
-url="https://github.com/PrismLauncher/PrismLauncher"
+arch=('i386' 'amd64' 'arm64' 'armhf' 'riscv64')
+url='https://github.com/PrismLauncher/PrismLauncher'
 license=('GPL3')
 depends=('libqt5svg5' 'qt5-image-formats-plugins' 'libqt5xml5' 'libqt5core5a' 'libqt5network5' 'libqt5gui5')
 provides=('prismlauncher')
 conflicts=('prismlauncher')
 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=("git+https://github.com/PrismLauncher/PrismLauncher.git")
+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=('git+https://github.com/PrismLauncher/PrismLauncher.git'
+        'gcc-armv7-fix.patch')
 
-sha256sums=('SKIP')
+sha256sums=('SKIP'
+            '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/}
@@ -34,57 +39,71 @@ 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
 
 pkgver() {
-  cd "PrismLauncher"
-  printf "%s.%s.r%s.%s" "$(grep -m 1 -oP 'Launcher_VERSION_MAJOR +\K\d+' CMakeLists.txt)" \
-    "$(grep -m 1 -oP 'Launcher_VERSION_MINOR +\K\d+' CMakeLists.txt)" \
-    "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+    cd "PrismLauncher"
+    printf "%s.%s.r%s.%s" "$(grep -m 1 -oP 'Launcher_VERSION_MAJOR +\K\d+' CMakeLists.txt)" \
+        "$(grep -m 1 -oP 'Launcher_VERSION_MINOR +\K\d+' CMakeLists.txt)" \
+        "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
 }
 
 prepare() {
-  cd "PrismLauncher"
-  git submodule init
-  git submodule update
+    cd "PrismLauncher"
+    git submodule init
+    git submodule update
+    cd ..
+
+    # 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" --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"
-  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"
+    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/build"
-  ctest . -E Task  # Skip unreliable Task test
+    cd "${srcdir}/PrismLauncher/build"
+    ctest . -E Task  # Skip unreliable Task test
 }
 
 package() {
-  cd "${srcdir}/PrismLauncher/build"
-  DESTDIR="$pkgdir" cmake --install .
+    cd "${srcdir}/PrismLauncher/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)
+ {