contrib/multimc/Pkgfile

75 lines
2.8 KiB
Plaintext
Raw Normal View History

2019-02-01 11:50:53 +01:00
# Description: Minecraft launcher with ability to manage multiple instances.
# URL: https://multimc.org/
# Maintainer: Danny Rawlins, crux at romster dot me
2022-08-28 13:49:53 +02:00
# Depends on: openjdk17-jdk qt5
2019-02-01 11:50:53 +01:00
name=multimc
2022-08-28 13:49:53 +02:00
_pkgname=multimc
version=0.6.16
2019-02-01 11:50:53 +01:00
release=1
2022-08-28 13:49:53 +02:00
source=(#https://github.com/MultiMC/Launcher/archive/refs/tags/0.6.16.tar.gz
https://github.com/MultiMC/Launcher/archive/$version/Launcher-$version.tar.gz
https://github.com/MultiMC/quazip/archive/b1a72ac0bb5a732bf887a535ab75c6f9bedb6b6b.tar.gz
#https://github.com/MultiMC/quazip/archive/multimc-3.tar.gz
#https://github.com/MultiMC/libnbtplusplus/archive/multimc-0.6.1.tar.gz
https://github.com/MultiMC/libnbtplusplus/archive/dc72a20b7efd304d12af2025223fad07b4b78464.tar.gz
"https://files.multimc.org/downloads/mmc-stable-lin64.tar.gz"
"0001-Readd-lin-system-and-LAUNCHER_LINUX_DATADIR.patch"
"fix-jars.patch"
"mmc-brand.patch"
"multimc.desktop"
)
2019-02-01 11:50:53 +01:00
build() {
2022-08-28 13:49:53 +02:00
cd Launcher-$version
2019-06-03 14:42:13 +02:00
2022-08-28 13:49:53 +02:00
patch -p1 < "${SRC}/0001-Readd-lin-system-and-LAUNCHER_LINUX_DATADIR.patch"
patch -p1 < "${SRC}/fix-jars.patch"
patch -p1 < "${SRC}/mmc-brand.patch"
2019-06-03 14:42:13 +02:00
2022-08-28 13:49:53 +02:00
# generate microsoft client id (https://aur.archlinux.org/packages/multimc-git)
pushd ${SRC}/MultiMC/bin
local client_id_asm=$(objdump -j '.text' --no-show-raw-insn -C --disassemble='Secrets::getMSAClientID(unsigned char)' MultiMC)
local client_id="$(grep -oP '[a-z0-9]{2}(?=,%r[89]d)' <<< ${client_id_asm} | tac | tr -d '\n')$(grep -oP '(push.+0x)\K[a-z0-9]{2}' <<< ${client_id_asm} | tac | tr -d '\n')"
client_id="${client_id:0:8}-${client_id:8:4}-${client_id:12:4}-${client_id:16:4}-${client_id:20}"
popd
sed -i 's/""/"'"${client_id}"'"/g' notsecrets/Secrets.cpp
2019-02-01 11:50:53 +01:00
2022-08-28 13:49:53 +02:00
rmdir libraries/libnbtplusplus
rmdir libraries/quazip
ln -sfT $SRC/libnbtplusplus-dc72a20b7efd304d12af2025223fad07b4b78464/ libraries/libnbtplusplus
ln -sfT $SRC/quazip-b1a72ac0bb5a732bf887a535ab75c6f9bedb6b6b/ libraries/quazip
2022-08-28 13:49:53 +02:00
export JAVA_HOME="/usr/lib/java/openjdk17-jdk/"
2019-02-01 11:50:53 +01:00
mkdir -p build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/usr" \
2022-08-28 13:49:53 +02:00
-DLauncher_LAYOUT=lin-system \
-DLauncher_APP_BINARY_NAME="${_pkgname}" \
-DLauncher_SHARE_DEST_DIR="share/${_pkgname}" \
-DLauncher_LIBRARAY_DEST_DIR="lib/${_pkgname}"
2019-02-01 11:50:53 +01:00
make
make DESTDIR=$PKG install
2022-08-28 13:49:53 +02:00
mkdir -p "${PKG}/etc/ld.so.conf.d"
echo -e "/usr/lib/${_pkgname}" > "${PKG}/etc/ld.so.conf.d/multimc5.conf"
install -D $SRC/Launcher-$version/launcher/package/ubuntu/multimc/opt/multimc/icon.svg \
2019-02-01 11:50:53 +01:00
$PKG/usr/share/pixmaps/multimc.svg
2022-08-28 13:49:53 +02:00
install -D $SRC/multimc.desktop \
2019-02-01 11:50:53 +01:00
$PKG/usr/share/applications/multimc.desktop
2019-06-03 14:42:13 +02:00
2022-08-28 13:49:53 +02:00
# install -D $SRC/Launcher-$version/build/libMultiMC_quazip.so \
# $PKG/usr/lib/libMultiMC_quazip.so
2019-06-03 14:42:13 +02:00
2022-08-28 13:49:53 +02:00
# install -D $SRC/Launcher-$version/build/libMultiMC_nbt++.so \
# $PKG/usr/lib/libMultiMC_nbt++.so
2019-02-01 11:50:53 +01:00
}