2023-03-24 00:07:29 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchzip
|
|
|
|
, appimageTools
|
2024-09-19 14:19:46 +00:00
|
|
|
, makeWrapper
|
2023-03-24 00:07:29 +00:00
|
|
|
}:
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
let
|
2023-01-11 07:51:40 +00:00
|
|
|
pname = "osu-lazer-bin";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "2024.906.2";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
src = {
|
|
|
|
aarch64-darwin = fetchzip {
|
2023-03-24 00:07:29 +00:00
|
|
|
url = "https://github.com/ppy/osu/releases/download/${version}/osu.app.Apple.Silicon.zip";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-KyvC8gEqZvXMATxS2513X0WdlR7nF8tHS4R/TPFrHao=";
|
2024-01-02 11:29:13 +00:00
|
|
|
stripRoot = false;
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
2024-01-02 11:29:13 +00:00
|
|
|
x86_64-darwin = fetchzip {
|
2023-03-24 00:07:29 +00:00
|
|
|
url = "https://github.com/ppy/osu/releases/download/${version}/osu.app.Intel.zip";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-ToxDZHL59YPmybvB9tsiOnFEd+FJJE4mNMfaK6btYKo=";
|
2024-01-02 11:29:13 +00:00
|
|
|
stripRoot = false;
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
2024-01-02 11:29:13 +00:00
|
|
|
x86_64-linux = fetchurl {
|
2023-03-24 00:07:29 +00:00
|
|
|
url = "https://github.com/ppy/osu/releases/download/${version}/osu.AppImage";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-zQnR3KwlE1gTWH8f+GDRBsc7Whfn9XpT1D/NLg5TtrU=";
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
|
|
|
}.${stdenv.system} or (throw "${pname}-${version}: ${stdenv.system} is unsupported.");
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
meta = {
|
2023-03-24 00:07:29 +00:00
|
|
|
description = "Rhythm is just a *click* away (AppImage version for score submission and multiplayer, and binary distribution for Darwin systems)";
|
2023-01-11 07:51:40 +00:00
|
|
|
homepage = "https://osu.ppy.sh";
|
2024-01-02 11:29:13 +00:00
|
|
|
license = with lib.licenses; [
|
2023-01-11 07:51:40 +00:00
|
|
|
mit
|
|
|
|
cc-by-nc-40
|
|
|
|
unfreeRedistributable # osu-framework contains libbass.so in repository
|
|
|
|
];
|
2024-01-02 11:29:13 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
2024-07-27 06:49:29 +00:00
|
|
|
maintainers = with lib.maintainers; [ gepbird stepbrobd ];
|
2023-01-11 07:51:40 +00:00
|
|
|
mainProgram = "osu!";
|
2023-03-24 00:07:29 +00:00
|
|
|
platforms = [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ];
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
2023-03-24 00:07:29 +00:00
|
|
|
|
|
|
|
passthru.updateScript = ./update-bin.sh;
|
|
|
|
in
|
|
|
|
if stdenv.isDarwin
|
2024-01-02 11:29:13 +00:00
|
|
|
then stdenv.mkDerivation {
|
|
|
|
inherit pname version src meta passthru;
|
2023-03-24 00:07:29 +00:00
|
|
|
|
2024-01-02 11:29:13 +00: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
|
|
|
|
''
|
2024-09-19 14:19:46 +00:00
|
|
|
. ${makeWrapper}/nix-support/setup-hook
|
|
|
|
mv -v $out/bin/${pname} $out/bin/osu!
|
|
|
|
wrapProgram $out/bin/osu! \
|
|
|
|
--set OSU_EXTERNAL_UPDATE_PROVIDER 1
|
|
|
|
install -m 444 -D ${contents}/osu!.desktop -t $out/share/applications
|
2024-01-02 11:29:13 +00:00
|
|
|
for i in 16 32 48 64 96 128 256 512 1024; do
|
2024-09-19 14:19:46 +00:00
|
|
|
install -D ${contents}/osu!.png $out/share/icons/hicolor/''${i}x$i/apps/osu!.png
|
2024-01-02 11:29:13 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
}
|