]> infiniteadaptability.org Git - packages/commitdiff
... osu
authoralex <[email protected]>
Sat, 13 Apr 2024 06:32:37 +0000 (23:32 -0700)
committeralex <[email protected]>
Sat, 13 Apr 2024 06:32:37 +0000 (23:32 -0700)
infiniteadaptability/osu.scm

index 546a02d510f68183b38b26ffe261ab8b07b56167..6ad7649e79c832a74d14811b664c266b04b6a8bb 100644 (file)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages linux)
+  #:use-module (guix build-system trivial)
   #:use-module (guix download)
   #:use-module (guix gexp)
+  #:use-module (guix git-download)
+  #:use-module (nongnu packages dotnet)
   #:use-module (nonguix build-system binary)
   #:use-module ((guix licenses)
                 #:prefix license:)
   #:use-module (guix packages))
 
 (define-public osu
-  (let ((version "2023.610.0"))
+  (let ((version "2024.412.0"))
     (package
       (name "osu")
       (version version)
       (source (origin
-                (method url-fetch)
-                (uri (string-append
-                      "https://github.com/ppy/osu/releases/download/" version
-                      "/osu.AppImage"))
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/ppy/osu.git")
+                     (commit version)))
                 (sha256
                  (base32
-                  "0qjri6rjzlfxlphx0v7ydi19c7ai3bblyn9d22ij75glgm75n0a0"))))
-      (build-system binary-build-system)
-      (inputs (list `(,gcc "lib")
-                   glibc
-                   zlib))
-      (native-inputs (list patchelf))
+                  "11w2np6gz3r5v9h8xcms8n32gz90dciinrxgfzf3dfcz20pfiwnd"))
+               (file-name (string-append "osu-" version "-checkout"))))
+      (build-system trivial-build-system)
       (arguments
-       (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!")))))))
+       #:phases
+       (modify-phases %standard-phases
+       (replace 'build
+         (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (dotnet (assoc-ref inputs "dotnet"))
+                    (dotnet-root (string-append dotnet "/share/dotnet"))
+                   (invoke "dotnet" "restore")
+                   (invoke "dotnet" "build")))))))
+      (inputs (list dotnet-sdk-8.0.4))
       (home-page "https://osu.ppy.sh/home")
       (synopsis "The bestest free-to-win rhythm game")
       (description "osu!")
       (license license:unlicense))))
 
+(define dotnet-sdk-8.0.4
+  (let ((dotnet-sdk-version "8.0.4"))
+  (package
+    (inherit dotnet)
+    (version "8.0.204")
+    (source
+      (origin
+         (method url-fetch/tarbomb)
+         (uri
+          (string-append "https://download.visualstudio.microsoft.com/download/pr/0a1b3cbd-b4af-4d0d-9ed7-0054f0e200b4/4bcc533c66379caaa91770236667aacb/dotnet-sdk-"
+                         version
+                         "-linux-x64.tar.gz"))
+         (sha256
+          (base32
+           "05fxhm93lm2h3l4hiqrggx2jddqd4p388pfhgh2r9a8i1zf39j0f"))))
+    (arguments
+       `(#:patchelf-plan
+         `(("dotnet"
+            ("gcc:lib" "zlib"))
+           (,,(string-append "shared/Microsoft.NETCore.App/"
+                             dotnet-sdk-version
+                             "/libSystem.Net.Security.Native.so")
+            ("mit-krb5"))
+           (,,(string-append "shared/Microsoft.NETCore.App/"
+                             dotnet-sdk-version
+                             "/libSystem.Security.Cryptography.Native.OpenSsl.so")
+            ("openssl"))
+           (,,(string-append "shared/Microsoft.NETCore.App/"
+                             dotnet-sdk-version
+                             "/libSystem.IO.Compression.Native.so")
+            ("zlib"))
+           (,,(string-append "shared/Microsoft.NETCore.App/"
+                             dotnet-sdk-version
+                             "/libcoreclrtraceptprovider.so")
+            ("gcc:lib" "lttng-ust"))
+           (,,(string-append "shared/Microsoft.NETCore.App/"
+                             dotnet-sdk-version "/createdump")
+            ("gcc:lib"))
+           (,,(string-append "shared/Microsoft.NETCore.App/"
+                             dotnet-sdk-version "/libclrjit.so")
+            ("gcc:lib"))
+           (,,(string-append "shared/Microsoft.NETCore.App/"
+                             dotnet-sdk-version "/libcoreclr.so")
+            ("gcc:lib" "icu4c"))
+           (,,(string-append "shared/Microsoft.NETCore.App/"
+                             dotnet-sdk-version "/libhostpolicy.so")
+            ("gcc:lib"))
+           (,,(string-append "shared/Microsoft.NETCore.App/"
+                             dotnet-sdk-version "/libmscordaccore.so")
+            ("gcc:lib"))
+           (,,(string-append "shared/Microsoft.NETCore.App/"
+                             dotnet-sdk-version "/libmscordbi.so")
+            ("gcc:lib"))
+           (,,(string-append "packs/Microsoft.NETCore.App.Host.linux-x64/"
+                             dotnet-sdk-version
+                             "/runtimes/linux-x64/native/singlefilehost")
+            ("gcc:lib" "openssl" "mit-krb5" "zlib" "icu4c"))
+           (,,(string-append "packs/Microsoft.NETCore.App.Host.linux-x64/"
+                             dotnet-sdk-version
+                             "/runtimes/linux-x64/native/apphost")
+            ("gcc:lib"))
+           (,,(string-append "packs/Microsoft.NETCore.App.Host.linux-x64/"
+                             dotnet-sdk-version
+                             "/runtimes/linux-x64/native/libnethost.so")
+            ("gcc:lib"))
+           (,,(string-append "sdk/" version "/AppHostTemplate/apphost")
+            ("gcc:lib"))
+           (,,(string-append "host/fxr/" dotnet-sdk-version "/libhostfxr.so")
+            ("gcc:lib")))
+         #:install-plan
+         `(("." "share/dotnet/"))
+         #:phases
+         (modify-phases %standard-phases
+           (add-before 'patchelf 'patchelf-writable
+             (lambda _
+               (for-each make-file-writable (find-files "."))))
+           (add-after 'install 'install-wrapper
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin-dir (string-append out "/bin"))
+                      (dotnet-target (string-append out "/share/dotnet/dotnet"))
+                      (dotnet-dest (string-append bin-dir "/dotnet")))
+                 (mkdir-p bin-dir)
+                 (symlink dotnet-target dotnet-dest)
+                 ;; First symlink, then wrap-program: dotnet cannot run when renamed
+                 (wrap-program dotnet-dest
+                   ;; Ensure the `dotnet' program does not phone home to share telemetry
+                   `("DOTNET_CLI_TELEMETRY_OPTOUT" = ("1"))))))))))))
+
 osu