diff --git a/games/prismlauncher/Makefile b/games/prismlauncher/Makefile index 714390e18e4d..7bc29be57b6c 100644 --- a/games/prismlauncher/Makefile +++ b/games/prismlauncher/Makefile @@ -1,35 +1,40 @@ PORTNAME= prismlauncher DISTVERSION= 8.4 CATEGORIES= games java MAINTAINER= Alexander88207@protonmail.com COMMENT= Minecraft launcher with ability to manage multiple instances WWW= https://prismlauncher.org/ LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/COPYING.md LIB_DEPENDS= libcmark.so:textproc/cmark \ libquazip1-qt6.so:archivers/quazip@qt6 \ libtomlplusplus.so:devel/tomlplusplus RUN_DEPENDS= lwjgl>0:games/lwjgl \ lwjgl3>0:games/lwjgl3 \ openjdk21>0:java/openjdk21 \ xrandr:x11/xrandr USES= cmake compiler:c++17-lang desktop-file-utils gl kde:6 qt:6 \ shared-mime-info USE_GITHUB= yes GH_ACCOUNT= PrismLauncher GH_PROJECT= ${GH_ACCOUNT} GH_TUPLE= gulrak:filesystem:2fc4b463:filesystem/libraries/filesystem \ PrismLauncher:libnbtplusplus:23b95512:libnbtplusplus/libraries/libnbtplusplus USE_GL= opengl USE_JAVA= yes USE_KDE= ecm:build USE_QT= 5compat base CMAKE_ARGS= -DJAVA_HOME=${JAVA_HOME} -DJava_JAVAC_EXECUTABLE=${JAVAC} \ -DLauncher_BUILD_PLATFORM=FreeBSD +post-patch: + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ + ${WRKSRC}/launcher/minecraft/LaunchProfile.cpp \ + ${WRKSRC}/launcher/minecraft/MinecraftInstance.cpp + .include diff --git a/games/prismlauncher/files/patch-launcher_minecraft_LaunchProfile.cpp b/games/prismlauncher/files/patch-launcher_minecraft_LaunchProfile.cpp index e44a7c27b8bb..3d00cebbefd3 100644 --- a/games/prismlauncher/files/patch-launcher_minecraft_LaunchProfile.cpp +++ b/games/prismlauncher/files/patch-launcher_minecraft_LaunchProfile.cpp @@ -1,18 +1,18 @@ # Patch taken from er2off: https://github.com/er2off/freebsd-ports --- launcher/minecraft/LaunchProfile.cpp.orig 2023-11-27 12:45:04 UTC +++ launcher/minecraft/LaunchProfile.cpp @@ -344,6 +344,14 @@ void LaunchProfile::getLibraryFiles(const RuntimeConte jars.clear(); nativeJars.clear(); for (auto lib : getLibraries()) { +#ifdef Q_OS_FREEBSD + // HACKHACK: use system lwjgl3 until mojang will fix it + QString artifact = lib->artifactId(); + if (artifact.startsWith("lwjgl") && lib->version().startsWith("3.")) { -+ jars += "/usr/local/share/java/classes/lwjgl3/" + artifact + ".jar"; ++ jars += "%%LOCALBASE%%/share/java/classes/lwjgl3/" + artifact + ".jar"; + continue; + } +#endif lib->getApplicableFiles(runtimeContext, jars, nativeJars, native32, native64, overridePath); } // NOTE: order is important here, add main jar last to the lists diff --git a/games/prismlauncher/files/patch-launcher_minecraft_MinecraftInstance.cpp b/games/prismlauncher/files/patch-launcher_minecraft_MinecraftInstance.cpp index eb4cc4ed4837..1f8887bc7703 100644 --- a/games/prismlauncher/files/patch-launcher_minecraft_MinecraftInstance.cpp +++ b/games/prismlauncher/files/patch-launcher_minecraft_MinecraftInstance.cpp @@ -1,20 +1,20 @@ # Patch taken from er2off: https://github.com/er2off/freebsd-ports --- launcher/minecraft/MinecraftInstance.cpp.orig 2023-11-27 12:44:40 UTC +++ launcher/minecraft/MinecraftInstance.cpp @@ -305,7 +305,16 @@ QString MinecraftInstance::getNativePath() const QString MinecraftInstance::getNativePath() const { +#ifdef Q_OS_FREEBSD + Version instance_ver{ getPackProfile()->getComponentVersion("net.minecraft") }; + QDir natives_dir; + if (instance_ver < Version("1.13.0")) -+ natives_dir = QDir("/usr/local/lib/lwjgl/"); ++ natives_dir = QDir("%%LOCALBASE%%/lib/lwjgl/"); + else -+ natives_dir = QDir("/usr/local/lib/lwjgl3/"); ++ natives_dir = QDir("%%LOCALBASE%%/lib/lwjgl3/"); +#else QDir natives_dir(FS::PathCombine(instanceRoot(), "natives/")); +#endif return natives_dir.absolutePath(); }