diff options
author | seth | 2021-12-16 08:49:08 -0500 |
---|---|---|
committer | seth | 2021-12-16 08:49:08 -0500 |
commit | 755439aee6ea64864aa291500d66f7bb78d0bcee (patch) | |
tree | d28fc117d75cd2d6eddb3c9d041a858ab2e99239 | |
parent | a90cf05eea366669f09c34679c63c642b0168af2 (diff) | |
download | aur-755439aee6ea64864aa291500d66f7bb78d0bcee.tar.gz |
fix microsoft login and data directory issues
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | 0001-Readd-lin-system-and-LAUNCHER_LINUX_DATADIR.patch | 75 | ||||
-rwxr-xr-x | PKGBUILD | 40 | ||||
-rw-r--r-- | change-build-name.patch | 24 | ||||
-rw-r--r-- | fix-jars.patch | 14 | ||||
-rw-r--r-- | mmc-brand.patch | 45 | ||||
-rw-r--r-- | multimc.desktop | 12 |
7 files changed, 188 insertions, 36 deletions
@@ -1,7 +1,7 @@ pkgbase = multimc5 pkgdesc = Minecraft launcher with ability to manage multiple instances. pkgver = 0.6.14 - pkgrel = 1 + pkgrel = 2 url = https://multimc.org/ arch = i686 arch = x86_64 @@ -20,12 +20,20 @@ pkgbase = multimc5 source = multimc5::git+https://github.com/MultiMC/Launcher#tag=0.6.14 source = libnbtplusplus::git+https://github.com/MultiMC/libnbtplusplus#commit=dc72a20b7efd304d12af2025223fad07b4b78464 source = quazip::git+https://github.com/MultiMC/quazip#commit=b1a72ac0bb5a732bf887a535ab75c6f9bedb6b6b + source = https://files.multimc.org/downloads/mmc-stable-lin64.tar.gz source = modern-java.patch - source = change-build-name.patch + source = 0001-Readd-lin-system-and-LAUNCHER_LINUX_DATADIR.patch + source = fix-jars.patch + source = mmc-brand.patch + source = multimc.desktop sha512sums = SKIP sha512sums = SKIP sha512sums = SKIP + sha512sums = df53f8b13ceeddc7922b6553730f29fdf92662277d20c9fc97d56965df1fe2349dd724ad8f911b105b02653fad112785e72ffadbf5571458fa23a45daf473e11 sha512sums = ede87db7e1ce67184409123720b48f65d35884bac5dfff34cc099c5d7520fd9173be00997df82ad29da4640928134a7199ffdd1cbaa83a72101dbed72736508b - sha512sums = d8153fefa3bc8ec6166448be39c675579676b7762b149d0e1be57aee05fad1ec9f3d4781fd591721518cc0efd4cad6d196a9357199c5d9b4cd858c1a3e7f6dc4 + sha512sums = d0e3152b885ec73b019dc0269d46e1ce0c43211bbcf05776a1e97f10fdc29f442930cc2d5144c0f979133e6aec68bf68474b924c746d1fa6b8c7f604af6eb83f + sha512sums = 1dc559a4b463bb9b0648d221df48a8ab562db186ea44fe0a3dba1af9c51306983faa27839abe7aea0478fb4d165fcf4af0db411fe063a18dcb9ca03c06196397 + sha512sums = 82f66f6aac1f7c09d2e242768b77af692216cfa99925585a7871fa71bec8197a246b66a3af7d9eab8856655ce80e4ced26a0fc331579a18badd8f86005b5bf53 + sha512sums = 07a7d3c13b418d18f96e3cf46b8608c69e7346554e8cc62c5d1b54b57c3b2be8ee4481f431b30b71795395c1b5ff5964f7403a6f77bf3ba316dcea3d472b0e8c pkgname = multimc5 diff --git a/0001-Readd-lin-system-and-LAUNCHER_LINUX_DATADIR.patch b/0001-Readd-lin-system-and-LAUNCHER_LINUX_DATADIR.patch new file mode 100644 index 000000000000..18e488b6079c --- /dev/null +++ b/0001-Readd-lin-system-and-LAUNCHER_LINUX_DATADIR.patch @@ -0,0 +1,75 @@ +From 27e3d0174139b99da9e6afad1ba6fffff95ff3a9 Mon Sep 17 00:00:00 2001 +From: Miko <mikoxyzzz@gmail.com> +Date: Sat, 20 Nov 2021 20:10:36 +0100 +Subject: [PATCH] Readd "lin-system" and LAUNCHER_LINUX_DATADIR + +During the debranding of MultiMC, peterix removed the "lin-system" +layout and LAUNCHER_LINUX_DATADIR (previously known as +MULTIMC_LINUX_DATADIR.) This patch reverts those two changes. + +Signed-off-by: Miko <mikoxyzzz@gmail.com> +--- + CMakeLists.txt | 20 ++++++++++++++++++-- + launcher/Application.cpp | 8 +++++++- + 2 files changed, 25 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0cf93758..2fc38b59 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -140,8 +140,8 @@ endif() + ####################################### Install layout ####################################### + + # How to install the build results +-set(Launcher_LAYOUT "auto" CACHE STRING "The layout for the launcher installation (auto, win-bundle, lin-nodeps, mac-bundle)") +-set_property(CACHE Launcher_LAYOUT PROPERTY STRINGS auto win-bundle lin-nodeps mac-bundle) ++set(Launcher_LAYOUT "auto" CACHE STRING "The layout for the launcher installation (auto, win-bundle, lin-nodeps, lin-system, mac-bundle)") ++set_property(CACHE Launcher_LAYOUT PROPERTY STRINGS auto win-bundle lin-nodeps lin-system mac-bundle) + + if(Launcher_LAYOUT STREQUAL "auto") + if(UNIX AND APPLE) +@@ -206,6 +206,22 @@ elseif(Launcher_LAYOUT_REAL STREQUAL "lin-nodeps") + configure_file(launcher/Launcher.in "${CMAKE_CURRENT_BINARY_DIR}/LauncherScript" @ONLY) + install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/LauncherScript" DESTINATION ${BUNDLE_DEST_DIR} RENAME ${Launcher_Name}) + ++elseif(Launcher_LAYOUT_REAL STREQUAL "lin-system") ++ set(Launcher_APP_BINARY_NAME "devlauncher" CACHE STRING "Name of the Launcher binary") ++ set(Launcher_BINARY_DEST_DIR "bin" CACHE STRING "Path to the binary directory") ++ set(Launcher_LIBRARY_DEST_DIR "lib${LIB_SUFFIX}" CACHE STRING "Path to the library directory") ++ set(Launcher_SHARE_DEST_DIR "share/devlauncher" CACHE STRING "Path to the shard data directory") ++ set(JARS_DEST_DIR "${Launcher_SHARE_DEST_DIR}/jars") ++ ++ set(BINARY_DEST_DIR ${Launcher_BINARY_DEST_DIR}) ++ set(LIBRARY_DEST_DIR ${Launcher_LIBRARY_DEST_DIR}) ++ ++ MESSAGE(STATUS "Compiling for linux system with ${Launcher_SHARE_DEST_DIR} and LAUNCHER_LINUX_DATADIR") ++ SET(Launcher_APP_BINARY_DEFS "-DMULTIMC_JARS_LOCATION=${CMAKE_INSTALL_PREFIX}/${JARS_DEST_DIR}" "-DLAUNCHER_LINUX_DATADIR") ++ ++ # install as bundle with no dependencies included ++ set(INSTALL_BUNDLE "nodeps") ++ + elseif(Launcher_LAYOUT_REAL STREQUAL "win-bundle") + set(BINARY_DEST_DIR ".") + set(LIBRARY_DEST_DIR ".") +diff --git a/launcher/Application.cpp b/launcher/Application.cpp +index 8789d096..6ef64762 100644 +--- a/launcher/Application.cpp ++++ b/launcher/Application.cpp +@@ -304,7 +304,13 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) + } + else + { +-#if defined(Q_OS_MAC) ++#ifdef LAUNCHER_LINUX_DATADIR ++ QString xdgDataHome = QFile::decodeName(qgetenv("XDG_DATA_HOME")); ++ if (xdgDataHome.isEmpty()) ++ xdgDataHome = QDir::homePath() + QLatin1String("/.local/share"); ++ dataPath = xdgDataHome + "/multimc"; ++ adjustedBy += "XDG standard " + dataPath; ++#elif defined(Q_OS_MAC) + QDir foo(FS::PathCombine(applicationDirPath(), "../../Data")); + dataPath = foo.absolutePath(); + adjustedBy += "Fallback to special Mac location " + dataPath; +-- +2.34.0 + @@ -5,10 +5,11 @@ # Contributor: xiretza <xiretza+aur@gmail.com> pkgname=multimc5 +_pkgname=multimc pkgver=0.6.14 _nbtplusplusver=dc72a20b7efd304d12af2025223fad07b4b78464 _quazipver=b1a72ac0bb5a732bf887a535ab75c6f9bedb6b6b -pkgrel=1 +pkgrel=2 pkgdesc="Minecraft launcher with ability to manage multiple instances." arch=('i686' 'x86_64') url="https://multimc.org/" @@ -25,28 +26,47 @@ conflicts=('multimc') source=("${pkgname}::git+https://github.com/MultiMC/Launcher#tag=${pkgver}" "libnbtplusplus::git+https://github.com/MultiMC/libnbtplusplus#commit=${_nbtplusplusver}" "quazip::git+https://github.com/MultiMC/quazip#commit=${_quazipver}" + "https://files.multimc.org/downloads/mmc-stable-lin64.tar.gz" "modern-java.patch" - "change-build-name.patch" + "0001-Readd-lin-system-and-LAUNCHER_LINUX_DATADIR.patch" + "fix-jars.patch" + "mmc-brand.patch" + "multimc.desktop" ) sha512sums=('SKIP' 'SKIP' 'SKIP' + 'df53f8b13ceeddc7922b6553730f29fdf92662277d20c9fc97d56965df1fe2349dd724ad8f911b105b02653fad112785e72ffadbf5571458fa23a45daf473e11' 'ede87db7e1ce67184409123720b48f65d35884bac5dfff34cc099c5d7520fd9173be00997df82ad29da4640928134a7199ffdd1cbaa83a72101dbed72736508b' - 'd8153fefa3bc8ec6166448be39c675579676b7762b149d0e1be57aee05fad1ec9f3d4781fd591721518cc0efd4cad6d196a9357199c5d9b4cd858c1a3e7f6dc4') + 'd0e3152b885ec73b019dc0269d46e1ce0c43211bbcf05776a1e97f10fdc29f442930cc2d5144c0f979133e6aec68bf68474b924c746d1fa6b8c7f604af6eb83f' + '1dc559a4b463bb9b0648d221df48a8ab562db186ea44fe0a3dba1af9c51306983faa27839abe7aea0478fb4d165fcf4af0db411fe063a18dcb9ca03c06196397' + '82f66f6aac1f7c09d2e242768b77af692216cfa99925585a7871fa71bec8197a246b66a3af7d9eab8856655ce80e4ced26a0fc331579a18badd8f86005b5bf53' + '07a7d3c13b418d18f96e3cf46b8608c69e7346554e8cc62c5d1b54b57c3b2be8ee4481f431b30b71795395c1b5ff5964f7403a6f77bf3ba316dcea3d472b0e8c') + prepare() { cd "${srcdir}/${pkgname}" + patch -p1 < "${srcdir}/0001-Readd-lin-system-and-LAUNCHER_LINUX_DATADIR.patch" + patch -p1 < "${srcdir}/modern-java.patch" + patch -p1 < "${srcdir}/fix-jars.patch" + patch -p1 < "${srcdir}/mmc-brand.patch" + + # generate microsoft client id (https://aur.archlinux.org/packages/multimc-git) + pushd ${srcdir}/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}" + + cd "${srcdir}/${pkgname}" + + sed -i 's/""/"'"${client_id}"'"/g' notsecrets/Secrets.cpp + # https://wiki.archlinux.org/title/VCS_package_guidelines#Git_submodules git submodule init git config submodule.depends/libnbtplusplus.url "${srcdir}/libnbtplusplus" git config submodule.libraries/quazip.url "${srcdir}/quazip" git submodule update - # update build target to modern java version - patch -p1 < "${srcdir}/modern-java.patch" - - # update the desktop file to have correct paths - patch -p1 < "${srcdir}/change-build-name.patch" } build() { @@ -58,6 +78,8 @@ build() { -DMultiMC_UPDATER=OFF \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DMultiMC_LAYOUT=lin-system \ + -DLauncher_APP_BINARY_NAME="${_pkgname}" \ + -DLauncher_SHARE_DEST_DIR="share/${_pkgname}" \ .. make } @@ -71,7 +93,7 @@ package() { cd "${srcdir}/${pkgname}/build" make install DESTDIR="${pkgdir}" install -Dm644 "${srcdir}/${pkgname}/launcher/package/ubuntu/multimc/opt/multimc/icon.svg" "${pkgdir}/usr/share/pixmaps/multimc.svg" - install -Dm644 "${srcdir}/${pkgname}/launcher/package/ubuntu/multimc/usr/share/applications/multimc.desktop" "${pkgdir}/usr/share/applications/multimc.desktop" + install -Dm644 "${srcdir}/multimc.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop" } # vim:set ts=2 sw=2 et: diff --git a/change-build-name.patch b/change-build-name.patch deleted file mode 100644 index 5e70108c9ed3..000000000000 --- a/change-build-name.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/notsecrets/CMakeLists.txt 2021-12-09 18:17:38.829876859 -0500 -+++ b/notsecrets/CMakeLists.txt 2021-12-09 18:17:54.970177730 -0500 -@@ -3,7 +3,7 @@ - target_compile_definitions(secrets PUBLIC -DEMBED_SECRETS) - target_include_directories(secrets PUBLIC .) - --set(Launcher_CommonName "DevLauncher") -+set(Launcher_CommonName "multimc") - - set(Launcher_Copyright "MultiMC Contributors" PARENT_SCOPE) - set(Launcher_Domain "multimc.org" PARENT_SCOPE) - ---- a/launcher/package/ubuntu/multimc/usr/share/applications/multimc.desktop 2021-12-13 16:07:16.892548884 -0500 -+++ b/launcher/package/ubuntu/multimc/usr/share/applications/multimc.desktop 2021-12-13 16:06:22.262325147 -0500 -@@ -1,7 +1,7 @@ - [Desktop Entry] - Categories=Game; --Exec=/opt/multimc/run.sh --Icon=/opt/multimc/icon.svg -+Exec=multimc -+Icon=/usr/share/pixmaps/multimc.svg - Keywords=game;Minecraft; - MimeType= - Name=MultiMC 5 diff --git a/fix-jars.patch b/fix-jars.patch new file mode 100644 index 000000000000..4d276841bc88 --- /dev/null +++ b/fix-jars.patch @@ -0,0 +1,14 @@ +diff '--color=auto' --unified --recursive --text --new-file Launcher0/launcher/Application.cpp Launcher1/launcher/Application.cpp +--- Launcher0/launcher/Application.cpp 2021-12-13 06:20:23.475484553 +0000 ++++ Launcher1/launcher/Application.cpp 2021-12-13 06:24:20.661422670 +0000 +@@ -524,6 +524,10 @@ + FS::updateTimestamp(m_rootPath); + #endif + ++#ifdef MULTIMC_JARS_LOCATION ++ m_jarsPath = TOSTRING(MULTIMC_JARS_LOCATION); ++#endif ++ + qDebug() << BuildConfig.LAUNCHER_DISPLAYNAME << ", (c) 2013-2021 " << BuildConfig.LAUNCHER_COPYRIGHT; + qDebug() << "Version : " << BuildConfig.printableVersionString(); + qDebug() << "Git commit : " << BuildConfig.GIT_COMMIT; diff --git a/mmc-brand.patch b/mmc-brand.patch new file mode 100644 index 000000000000..4296441969bd --- /dev/null +++ b/mmc-brand.patch @@ -0,0 +1,45 @@ +diff '--color=auto' -x '.*' --unified --recursive --text --new-file Launcher0/launcher/Application.cpp Launcher1/launcher/Application.cpp +--- Launcher0/launcher/Application.cpp 2021-12-13 07:43:23.274019056 +0000 ++++ Launcher1/launcher/Application.cpp 2021-12-13 07:50:33.016549365 +0000 +@@ -312,7 +312,7 @@ + QString xdgDataHome = QFile::decodeName(qgetenv("XDG_DATA_HOME")); + if (xdgDataHome.isEmpty()) + xdgDataHome = QDir::homePath() + QLatin1String("/.local/share"); +- dataPath = xdgDataHome + "/devlauncher"; ++ dataPath = xdgDataHome + "/multimc"; + adjustedBy += "XDG standard " + dataPath; + #elif defined(Q_OS_MAC) + QDir foo(FS::PathCombine(applicationDirPath(), "../../Data")); +diff '--color=auto' -x '.*' --unified --recursive --text --new-file Launcher0/launcher/resources/multimc/multimc.qrc Launcher1/launcher/resources/multimc/multimc.qrc +--- Launcher0/launcher/resources/multimc/multimc.qrc 2021-12-13 06:20:23.494484805 +0000 ++++ Launcher1/launcher/resources/multimc/multimc.qrc 2021-12-13 08:03:35.943090237 +0000 +@@ -282,6 +282,9 @@ + <file>32x32/instances/herobrine.png</file> + <file>128x128/instances/herobrine.png</file> + ++ <file>32x32/instances/infinity.png</file> ++ <file>128x128/instances/infinity.png</file> ++ + <file>32x32/instances/magitech.png</file> + <file>128x128/instances/magitech.png</file> + +diff '--color=auto' -x '.*' --unified --recursive --text --new-file Launcher0/notsecrets/CMakeLists.txt Launcher1/notsecrets/CMakeLists.txt +--- Launcher0/notsecrets/CMakeLists.txt 2021-12-13 06:20:23.524485203 +0000 ++++ Launcher1/notsecrets/CMakeLists.txt 2021-12-13 06:37:14.725320153 +0000 +@@ -3,14 +3,14 @@ + target_compile_definitions(secrets PUBLIC -DEMBED_SECRETS) + target_include_directories(secrets PUBLIC .) + +-set(Launcher_CommonName "DevLauncher") ++set(Launcher_CommonName "MultiMC") + + set(Launcher_Copyright "MultiMC Contributors" PARENT_SCOPE) + set(Launcher_Domain "multimc.org" PARENT_SCOPE) + set(Launcher_Name "${Launcher_CommonName}" PARENT_SCOPE) + set(Launcher_DisplayName "${Launcher_CommonName} 5" PARENT_SCOPE) + set(Launcher_UserAgent "${Launcher_CommonName}/5.0" PARENT_SCOPE) +-set(Launcher_ConfigFile "devlauncher.cfg" PARENT_SCOPE) ++set(Launcher_ConfigFile "multimc.cfg" PARENT_SCOPE) + set(Launcher_Git "https://github.com/MultiMC/Launcher" PARENT_SCOPE) + + set(Launcher_Branding_ICNS "notsecrets/Launcher.icns" PARENT_SCOPE) diff --git a/multimc.desktop b/multimc.desktop new file mode 100644 index 000000000000..ba150cabc6e2 --- /dev/null +++ b/multimc.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=1.0 +Name=MultiMC +GenericName=Minecraft Launcher +Comment=Free, open source launcher and instance manager for Minecraft. +Type=Application +Terminal=false +# not the best idea but...it works +Exec=sh -c "multimc -d $HOME/.local/share/multimc" +Icon=multimc +Categories=Game +Keywords=game;minecraft; |