commit da230444098feede7d798b9be0691ed29b988a48
parent 25e59a5c99a5bfbdb732625d0ad00a098c791799
Author: Luke Willis <lukejw@loquat.dev>
Date: Mon, 22 Sep 2025 04:15:27 -0400
Add prismlauncher
Diffstat:
1 file changed, 77 insertions(+), 1 deletion(-)
diff --git a/loquat/packages/games.scm b/loquat/packages/games.scm
@@ -6,15 +6,89 @@
#:use-module (gnu packages elf)
#:use-module (gnu packages gl)
#:use-module (gnu packages image)
+ #:use-module (gnu packages java)
+ #:use-module (gnu packages kde-frameworks)
#:use-module (gnu packages libedit)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages pulseaudio)
#:use-module (gnu packages qt)
#:use-module (gnu packages sdl)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages video)
#:use-module (guix build-system cmake)
- #:use-module (guix build-system qt))
+ #:use-module (guix build-system qt)
+ #:use-module (guix gexp))
+
+;; For playing Minecraft. Setup to run on wayland by default.
+(define-public prismlauncher
+ (package
+ (name "prismlauncher")
+ (version "9.4")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/PrismLauncher/PrismLauncher")
+ (recursive? #t)
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1xxgyx0z5r3hk3yk4gglbfwvq2qk1j9a0dkrv55j4vrlkni79nrm"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ ;; Patch default settings
+ (add-after 'unpack 'change-default-settings
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "launcher/Application.cpp"
+ (("\"UseNativeGLFW\", false")
+ "\"UseNativeGLFW\", true"))))
+ ;; Add required environment variables
+ (add-after 'install 'patch-paths
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin/prismlauncher"))
+ (jdk21 (assoc-ref inputs "jdk21"))
+ (jdk17 (assoc-ref inputs "jdk17"))
+ (qtwayland (assoc-ref inputs "qtwayland"))
+ (qtsvg (assoc-ref inputs "qtsvg")))
+ (wrap-program bin
+ ;; Add all the OpenJDK versions for Minecraft as needed
+ `("PRISMLAUNCHER_JAVA_PATHS" ":" suffix (,(string-append jdk21 "/bin/java")
+ ,(string-append jdk17 "/bin/java")))
+ ;; Fix QT plugins (primarily for wayland support)
+ `("QT_PLUGIN_PATH" ":" prefix ,(map (lambda (package)
+ (string-append package "/lib/qt6/plugins"))
+ (list qtwayland qtsvg)))
+ ;; Add runtime libraries for MC
+ `("LD_LIBRARY_PATH" ":" prefix
+ (,@(map (lambda (dep)
+ (string-append (assoc-ref inputs dep)
+ "/lib"))
+ '("glfw" "mesa" "pulseaudio")))))
+ #t))))))
+ (native-inputs (list pkg-config extra-cmake-modules))
+ (inputs
+ `(("zlib" ,zlib)
+ ("qtbase" ,qtbase)
+ ("qt5compat" ,qt5compat)
+ ("qtnetworkauth" ,qtnetworkauth)
+ ("qtwayland" ,qtwayland)
+ ("qtsvg" ,qtsvg)
+ ;; Java versions to include
+ ("jdk17" ,openjdk17 "jdk")
+ ("jdk21" ,openjdk21 "jdk")
+ ;; Runtime deps for MC itself
+ ("glfw" ,glfw-3.4)
+ ("mesa" ,mesa)
+ ("pulseaudio" ,pulseaudio)))
+ (home-page "https://prismlauncher.org/")
+ (synopsis #f)
+ (description #f)
+ (license #f)))
;; I don't know if this is really necessary, but the upstream mgba package doesn't seem to
;; work on wayland when using mgba-qt.
@@ -77,3 +151,5 @@ and Game Boy Color games.")
;; Code is mainly MPL 2.0. "blip_buf.c" is LGPL 2.1+ and "inih.c"
;; is BSD-3
(license (list license:mpl2.0 license:lgpl2.1+ license:bsd-3))))
+
+prismlauncher