2023-03-24 00:07:29 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchzip
|
|
|
|
, appimageTools
|
|
|
|
}:
|
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";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "2023.1008.1";
|
2023-03-24 00:07:29 +00:00
|
|
|
name = "${pname}-${version}";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
osu-lazer-bin-src = {
|
|
|
|
aarch64-darwin = {
|
|
|
|
url = "https://github.com/ppy/osu/releases/download/${version}/osu.app.Apple.Silicon.zip";
|
2023-10-19 13:55:26 +00:00
|
|
|
sha256 = "sha256-eL5UVZqAH7Ta442xIDjaOPu3NXJmck+lS+BoD/qnOMs=";
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
|
|
|
x86_64-darwin = {
|
|
|
|
url = "https://github.com/ppy/osu/releases/download/${version}/osu.app.Intel.zip";
|
2023-10-19 13:55:26 +00:00
|
|
|
sha256 = "sha256-x/HL73Fao11GVj7uMFpx4uOKv8Gmiy1PEgee2sP1fvg=";
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
|
|
|
x86_64-linux = {
|
|
|
|
url = "https://github.com/ppy/osu/releases/download/${version}/osu.AppImage";
|
2023-10-19 13:55:26 +00:00
|
|
|
sha256 = "sha256-QqyymPkeRcedK75O9S0zO8DrUmPKuC7Mp4SbXT+QM9I=";
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
|
|
|
}.${stdenv.system} or (throw "${pname}-${version}: ${stdenv.system} is unsupported.");
|
|
|
|
|
|
|
|
linux = appimageTools.wrapType2 rec {
|
|
|
|
inherit name pname version meta;
|
|
|
|
|
|
|
|
src = fetchurl (osu-lazer-bin-src);
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
darwin = stdenv.mkDerivation rec {
|
|
|
|
inherit name pname version meta;
|
|
|
|
|
|
|
|
src = fetchzip (osu-lazer-bin-src // { stripRoot = false; });
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
dontBuild = true;
|
|
|
|
dontFixup = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
APP_DIR="$out/Applications"
|
|
|
|
mkdir -p "$APP_DIR"
|
|
|
|
cp -r . "$APP_DIR"
|
|
|
|
runHook postInstall
|
2023-01-11 07:51:40 +00:00
|
|
|
'';
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
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";
|
|
|
|
license = with licenses; [
|
|
|
|
mit
|
|
|
|
cc-by-nc-40
|
|
|
|
unfreeRedistributable # osu-framework contains libbass.so in repository
|
|
|
|
];
|
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2023-10-19 13:55:26 +00:00
|
|
|
maintainers = with maintainers; [ delan stepbrobd spacefault ];
|
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
|
|
|
|
then darwin
|
|
|
|
else linux
|
|
|
|
|