(define-module (gnu packages prism-launcher)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system qt)
  ;; I added a prefix here, as is done in many (most?) Guix package modules.
  ;; For one, it silences the ‘zlib’ (which is both a package & a licence) warning.
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix gexp)
  #:use-module (gnu packages ninja)
  #:use-module (gnu packages kde-frameworks)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages java)
  #:use-module (gnu packages gl))

(define-public prism-launcher
  (package
    (name "prism-launcher")
    (version "7.2")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/PrismLauncher/PrismLauncher")
             (commit version)
             (recursive? #t)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0q3fva33h5hvbd9hkfc48jzj8jyv4xpg0j2w6qnx4ydbs2khaxi4"))))
    (build-system cmake-build-system)
    (arguments
     (list
      ;; This is more idiomatic than (delete 'check):
      #:tests? #f                       ;no test suite
      #:imported-modules `((guix build qt-build-system)
                           (guix build qt-utils)
                           ,@%cmake-build-system-modules)
      #:modules '(((guix build qt-build-system) #:prefix qt:)
                  (guix build cmake-build-system)
                  (guix build utils))
      ;; I tweaked these because the quoting style was distracting to me,
      ;; (probably) not because they were wrong.
      #:configure-flags #~'("-GNinja"
                            ;; Why not the default "RelWithDebInfo"?
                            ;; But this is fine if there's a reason:
                            "-DCMAKE_BUILD_TYPE=Release"
                            "-DENABLE_LTO=ON"
                            "-DLauncher_QT_VERSION_MAJOR=5")
      #:phases
      #~(modify-phases %standard-phases
          (replace 'build
            (lambda* (#:key inputs #:allow-other-keys)
              (invoke "cmake" "--build" ".")))
          (replace 'install
            (lambda* (#:key inputs #:allow-other-keys)
              (invoke "cmake" "--install" ".")))
          (add-after 'install 'qt-wrap
            (assoc-ref qt:%standard-phases 'qt-wrap)))))
    ;; ‘Build’ tools should usually be ‘native-inputs’:
    (native-inputs (list extra-cmake-modules ninja pkg-config))
    ;; ‘Run-time’ tools & libraries should usually be ‘inputs’:
    (inputs (list mesa qtbase-5 qtsvg-5 zlib))
    ;; It would be ideal if we could make all ‘propagated-inputs’ regular ‘inputs’.
    ;; This would need more wrapping, though.
    (propagated-inputs (list openjdk `(,openjdk17 "jdk")))
    (synopsis "Launcher for Minecraft") ;example of upstream style
    (description "It launches Minecraft.") ;not an example of upstream style, but I like yours
    (home-page "")
    (license license:gpl3+)))

prism-launcher

Generated by Tobias Geerinckx-Rice using scpaste at Sun Oct 29 18:26:03 2023. CET. (original)