From 95e444c5c099a7e05e07c46052c57b20deb28a84 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 25 Jun 2023 22:50:10 -0700 Subject: [PATCH] ... --- osu.scm | 48 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/osu.scm b/osu.scm index 981b922..551ce2b 100644 --- a/osu.scm +++ b/osu.scm @@ -1,8 +1,16 @@ (define-module (infiniteadaptability packages osu) + #:use-module (gnu packages base) + #:use-module (gnu packages bootstrap) + #:use-module (gnu packages compression) + #:use-module (gnu packages elf) + #:use-module (gnu packages gcc) + #:use-module (gnu packages glib) + #:use-module (gnu packages linux) #:use-module (guix download) #:use-module (guix gexp) #:use-module (nonguix build-system binary) - #:use-module (guix licenses) + #:use-module ((guix licenses) + #:prefix license:) #:use-module (guix packages)) (define-public osu @@ -19,23 +27,33 @@ (base32 "0qjri6rjzlfxlphx0v7ydi19c7ai3bblyn9d22ij75glgm75n0a0")))) (build-system binary-build-system) + (inputs (list `(,gcc "lib") + glibc + zlib)) + (native-inputs (list patchelf)) (arguments - (list #:phases #~(modify-phases %standard-phases - (delete 'strip-binaries) - (delete 'validate-runpath) - (delete 'make-dynamic-linker-cache) - (add-after 'install 'symlink-binary-file-and-cleanup - (lambda _ - (delete-file (string-append #$output - "/environment-variables")) - (chmod (string-append #$output "/osu.AppImage") - #o755) - (mkdir-p (string-append #$output "/bin")) - (symlink (string-append #$output "/osu.AppImage") - (string-append #$output "/bin/osu"))))))) + (list + #:patchelf-plan `(("osu.AppImage" ("gcc" "zlib"))) + #:phases #~(modify-phases %standard-phases + (delete 'strip) + (delete 'validate-runpath) + (delete 'make-dynamic-linker-cache) + (add-before 'patchelf 'patchelf-writable + (lambda _ + (make-file-writable "osu.AppImage"))) + (add-before 'install 'extract-appimage + (lambda _ + (chmod "osu.AppImage" #o755) + (invoke "./osu.AppImage" "--appimage-extract"))) + (add-after 'extract-appimage 'patch-osu-executable + (lambda _ + (let ((ld-so (string-append #$(this-package-input + "glibc") + #$(glibc-dynamic-linker)))) + (invoke "patchelf" "--set-interpreter" ld-so "squashfs-root/usr/bin/osu!"))))))) (home-page "https://osu.ppy.sh/home") (synopsis "The bestest free-to-win rhythm game") (description "osu!") - (license unlicense)))) + (license license:unlicense)))) osu -- 2.39.5