2023-03-07 09:26:57 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchzip
|
|
|
|
, appimageTools
|
|
|
|
}:
|
2022-12-29 15:07:55 +01:00
|
|
|
|
2023-03-07 09:26:57 +01:00
|
|
|
let
|
2022-12-29 15:07:55 +01:00
|
|
|
pname = "osu-lazer-bin";
|
2024-03-14 20:11:53 +01:00
|
|
|
version = "2024.312.1";
|
2022-12-29 15:07:55 +01:00
|
|
|
|
2023-11-26 22:03:47 +01:00
|
|
|
src = {
|
|
|
|
aarch64-darwin = fetchzip {
|
2023-03-07 09:26:57 +01:00
|
|
|
url = "https://github.com/ppy/osu/releases/download/${version}/osu.app.Apple.Silicon.zip";
|
2024-03-14 20:11:53 +01:00
|
|
|
hash = "sha256-1MsZ9gHTZKArXk1b6XEBNk/ZWAUHKjbVrrn++dLulaQ=";
|
2023-11-26 22:03:47 +01:00
|
|
|
stripRoot = false;
|
2023-03-07 09:26:57 +01:00
|
|
|
};
|
2023-11-26 22:03:47 +01:00
|
|
|
x86_64-darwin = fetchzip {
|
2023-03-07 09:26:57 +01:00
|
|
|
url = "https://github.com/ppy/osu/releases/download/${version}/osu.app.Intel.zip";
|
2024-03-14 20:11:53 +01:00
|
|
|
hash = "sha256-Xgl8lrMsL9O9YHbEx3Iwwh9fpLOnYZN0Kt28F5X5OwE=";
|
2023-11-26 22:03:47 +01:00
|
|
|
stripRoot = false;
|
2023-03-07 09:26:57 +01:00
|
|
|
};
|
2023-11-26 22:03:47 +01:00
|
|
|
x86_64-linux = fetchurl {
|
2023-03-07 09:26:57 +01:00
|
|
|
url = "https://github.com/ppy/osu/releases/download/${version}/osu.AppImage";
|
2024-03-14 20:11:53 +01:00
|
|
|
hash = "sha256-1dzgs1p3/pf4eCdKvQ9JxowN+oBPBNaZv5e6qHeFPEM=";
|
2023-03-07 09:26:57 +01:00
|
|
|
};
|
|
|
|
}.${stdenv.system} or (throw "${pname}-${version}: ${stdenv.system} is unsupported.");
|
|
|
|
|
2023-11-26 22:03:47 +01:00
|
|
|
meta = {
|
2023-03-07 09:26:57 +01:00
|
|
|
description = "Rhythm is just a *click* away (AppImage version for score submission and multiplayer, and binary distribution for Darwin systems)";
|
2022-12-29 15:07:55 +01:00
|
|
|
homepage = "https://osu.ppy.sh";
|
2023-11-26 22:03:47 +01:00
|
|
|
license = with lib.licenses; [
|
2022-12-29 15:07:55 +01:00
|
|
|
mit
|
|
|
|
cc-by-nc-40
|
|
|
|
unfreeRedistributable # osu-framework contains libbass.so in repository
|
|
|
|
];
|
2023-11-26 22:03:47 +01:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
2023-12-18 18:17:31 +01:00
|
|
|
maintainers = with lib.maintainers; [ delan gepbird spacefault stepbrobd ];
|
2023-01-06 19:37:24 +01:00
|
|
|
mainProgram = "osu!";
|
2023-03-07 09:26:57 +01:00
|
|
|
platforms = [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ];
|
2022-12-29 15:07:55 +01:00
|
|
|
};
|
2023-03-07 09:26:57 +01:00
|
|
|
|
|
|
|
passthru.updateScript = ./update-bin.sh;
|
|
|
|
in
|
|
|
|
if stdenv.isDarwin
|
2023-11-26 22:03:47 +01:00
|
|
|
then stdenv.mkDerivation {
|
|
|
|
inherit pname version src meta passthru;
|
2023-03-07 09:26:57 +01:00
|
|
|
|
2023-11-26 22:03:47 +01:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
APP_DIR="$out/Applications"
|
|
|
|
mkdir -p "$APP_DIR"
|
|
|
|
cp -r . "$APP_DIR"
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
else appimageTools.wrapType2 {
|
|
|
|
inherit pname version src meta passthru;
|
|
|
|
|
|
|
|
extraPkgs = pkgs: with pkgs; [ icu ];
|
|
|
|
|
|
|
|
extraInstallCommands =
|
|
|
|
let
|
|
|
|
contents = appimageTools.extract { inherit pname version src; };
|
|
|
|
in
|
|
|
|
''
|
|
|
|
mv -v $out/bin/${pname}-${version} $out/bin/osu\!
|
|
|
|
install -m 444 -D ${contents}/osu\!.desktop -t $out/share/applications
|
|
|
|
for i in 16 32 48 64 96 128 256 512 1024; do
|
|
|
|
install -D ${contents}/osu\!.png $out/share/icons/hicolor/''${i}x$i/apps/osu\!.png
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
}
|