Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Sep 2024 18:48:15 GMT
From:      Vladimir Druzenko <vvd@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 1079dca83e68 - main - games/prismlauncher: Replace hardcoded /usr/local with LOCALBASE
Message-ID:  <202409091848.489ImFGu014478@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by vvd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1079dca83e68bc158791d69083095a90fc901c7e

commit 1079dca83e68bc158791d69083095a90fc901c7e
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2024-09-09 18:42:28 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-09-09 18:48:00 +0000

    games/prismlauncher: Replace hardcoded /usr/local with LOCALBASE
    
    Approved by:    Alexander Vereeken <Alexander88207@protonmail.com> (maintainer)
---
 games/prismlauncher/Makefile                                         | 5 +++++
 games/prismlauncher/files/patch-launcher_minecraft_LaunchProfile.cpp | 2 +-
 .../files/patch-launcher_minecraft_MinecraftInstance.cpp             | 4 ++--
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/games/prismlauncher/Makefile b/games/prismlauncher/Makefile
index 714390e18e4d..7bc29be57b6c 100644
--- a/games/prismlauncher/Makefile
+++ b/games/prismlauncher/Makefile
@@ -32,4 +32,9 @@ 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 <bsd.port.mk>
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
@@ -9,7 +9,7 @@
 +        // 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
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
@@ -9,9 +9,9 @@
 +    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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409091848.489ImFGu014478>