Don't hesitate editing and commenting

This commit is contained in:
qby 2024-01-16 18:14:46 +00:00
parent 75e6956cb2
commit 397689aab3

View File

@ -1,26 +1,105 @@
(define-module (nongnu packages liquidbounce) ;;; GNU Guix --- Functional package management for GNU
#:use-module (guix packages) ;;; Copyright © 2022 YOUR NAME <your-email@your-domain.com>
#:use-module (guix download) ;;;
#:use-module (nonguix licenses) ;;; This file is not part of GNU Guix.
#:use-module (nonguix build-system binary)) ;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
;; define-module
(define-module (nongnu packages liquidbounce liquidlauncher)
(use-modules #:use-module
(guix packages)
(guix download)
((non guix licenses) #:prefix license:)
(non guix build-system trivial binary rust)
(define-public liquidlauncher (define-public liquidlauncher
(package (package
(name "liquidlauncher") (name "liquidlauncher")
(version "0.1.8") (version version)
(source (origin (source
(method url-fetch) (origin
(uri (string-append "https://github.com/CCBlueX/LiquidLauncher/releases/download/" (method url-fetch/tarbomb git-fetch)
version "/liquidlauncher_" version "_" architecture "." packaging ".tar.gz")) (uri (git-reference (string-append
(sha256 (base32 (url "https://github.com/CCBlueX/LiquidLauncher/releases/download/"
version "/liquidlauncher_" version "_"
(%current-system) architecture "." packaging ".tar.gz"))
(commit version)))
(file-name (git-file-name "liquid-launcher"))
(sha256
(base32
"<INSERT CORRECT HASH>")))) "<INSERT CORRECT HASH>"))))
(build-system binary-build-system)
;; LiquidLauncher is an AppImage which is ready to run, so no need for a build. (snippet
'(begin
(setenv "PATH" (string-append (getenv "PATH") ":" (assoc-ref %build-inputs "node") ":" (assoc-ref %build-inputs "yarn")))
(zero? (system* "yarn"))
(zero? (system* "yarn" "build"))))))
;; building
(build-system trivial cargo binary gnu)
;; LiquidLauncher is an AppImage which is ready to run, no need for a build.
(native-inputs `(("runtime" "java-runtime"))) (native-inputs `(("runtime" "java-runtime")))
;; We need to specify the location of the binary after unpacking. You will need to adjust this path if it's incorrect. ;; We need to specify the location of the binary after unpacking. You will need to adjust this path if it's incorrect.
(arguments `(#:install-plan `(("liquidlauncher/LiquidLauncher" "bin/")) (native-inputs
`(("node" ,node)
("yarn" ,yarn)))
;; arguments
(arguments
`(#:install-plan `(("liquidlauncher/LiquidLauncher" "bin/"))
#:tests? #f)) #:tests? #f))
(home-page "https://liquidbounce.net") `(#:phases
(synopsis "Official launcher for LiquidBounce") (modify-phases %standard-phases
(description "LiquidLauncher is the official launcher for LiquidBounce. It eases the installation of the client and keeps it automatically up to date.") (add-before 'build 'prepare add-after 'unpack 'install-node-dependencies
(license license:gpl3))) (chdir "path-to-package.json-in-source")
(lambda _
(zero? (system* "tar" "-xzf" "LiquidLauncher.tar.gz"))
;; chmod
(chmod target "LiquidLauncher" #o755)
(zero? (system* "./LiquidLauncher" "--appimage-extract" "npm" "install"))))
(add-after 'install 'install-node-dependencies 'build-tauri 'desktop-integration
(lambda* _
(zero? (system* "npm" "run" "tauri" "build")
(#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(iconsdir (string-append out "/usr/share/icons"))
(desktopfile (string-append
out "/usr/share/applications/liquid-launcher.desktop"))
(bindir (string-append out "/usr/bin"))
(license-symlink (string-append
out "/usr/share/licenses/liquid-launcher")))
(system* "sed" "-i" "-E"
"s|Exec=AppRun|Exec=env DESKTOPINTEGRATION=false " bindir "|" desktopfile)
(mkdir-p iconsdir)
(install-file "/path/to/license" license-symlink)
(symlink "/opt/liquid-launcher-appimage/LiquidLauncher.AppImage" bindir)
(symlink "/opt/liquid-launcher-appimage/LICENSE" license-symlink)
;; copy
(copy-recursively file source "squashfs-root/usr/share/icons" iconsdir target))))))
(inputs
`(("fuse2" ,fuse2)
("zlib" ,zlib)))
;; modules
`(use-modules #:modules ((guix build utils))
#:builder
(begin
(let* ((source (assoc-ref %build-inputs "source"))
(out (assoc-ref %outputs "out"))
(target (string-append out "/bin/liquidlauncher")))
(mkdir-p (string-append out "/bin"))
;; properties
(home-page "https://github.com/CCBlueX/LiquidLauncher https://liquidbounce.net")
(synopsis "A LiquidBounce LiquidLauncher launcher for Minecraft, written in Rust using Tauri.client with mod support built from source code keeps it automatically up to date")
(description "LiquidLauncher is the official Minecraft client and launcher for the LiquidBounce mod. It streamlines the installation process and automatically keeps the client up to date.")
(license license:gpl3 gpl3+ expat)
))