(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
(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