2021-12-26 15:17:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
|
|
|
, buildDotnetModule
|
|
|
|
, fetchFromGitHub
|
2024-02-19 22:01:16 +00:00
|
|
|
, dotnetCorePackages
|
2021-12-26 15:17:12 +00:00
|
|
|
, makeDesktopItem
|
|
|
|
, copyDesktopItems
|
|
|
|
, ffmpeg
|
|
|
|
, alsa-lib
|
|
|
|
, SDL2
|
|
|
|
, lttng-ust
|
|
|
|
, numactl
|
2022-12-27 19:47:45 +00:00
|
|
|
, libglvnd
|
|
|
|
, xorg
|
|
|
|
, udev
|
2020-04-11 18:12:04 +00:00
|
|
|
}:
|
|
|
|
|
2021-12-26 15:17:12 +00:00
|
|
|
buildDotnetModule rec {
|
2020-04-11 18:12:04 +00:00
|
|
|
pname = "osu-lazer";
|
2024-03-11 21:03:01 +00:00
|
|
|
version = "2024.312.0";
|
2020-04-11 18:12:04 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ppy";
|
|
|
|
repo = "osu";
|
|
|
|
rev = version;
|
2024-03-11 21:03:01 +00:00
|
|
|
hash = "sha256-54georjON2Fu/kj4w4SeW0BR/aHomGrKeicJ9N4/Y9s=";
|
2020-04-11 18:12:04 +00:00
|
|
|
};
|
|
|
|
|
2021-12-26 15:17:12 +00:00
|
|
|
projectFile = "osu.Desktop/osu.Desktop.csproj";
|
|
|
|
nugetDeps = ./deps.nix;
|
2020-04-11 18:12:04 +00:00
|
|
|
|
2024-02-19 22:01:16 +00:00
|
|
|
dotnet-sdk = dotnetCorePackages.sdk_8_0;
|
|
|
|
dotnet-runtime = dotnetCorePackages.runtime_8_0;
|
|
|
|
|
2021-12-26 15:17:12 +00:00
|
|
|
nativeBuildInputs = [ copyDesktopItems ];
|
2020-04-11 18:12:04 +00:00
|
|
|
|
2021-12-26 15:17:12 +00:00
|
|
|
runtimeDeps = [
|
|
|
|
ffmpeg
|
|
|
|
alsa-lib
|
|
|
|
SDL2
|
|
|
|
lttng-ust
|
|
|
|
numactl
|
2022-12-27 19:47:45 +00:00
|
|
|
|
|
|
|
# needed to avoid:
|
|
|
|
# Failed to create SDL window. SDL Error: Could not initialize OpenGL / GLES library
|
|
|
|
libglvnd
|
|
|
|
|
|
|
|
# needed for the window to actually appear
|
|
|
|
xorg.libXi
|
|
|
|
|
|
|
|
# needed to avoid in runtime.log:
|
|
|
|
# [verbose]: SDL error log [debug]: Failed loading udev_device_get_action: /nix/store/*-osu-lazer-*/lib/osu-lazer/runtimes/linux-x64/native/libSDL2.so: undefined symbol: _udev_device_get_action
|
|
|
|
# [verbose]: SDL error log [debug]: Failed loading libudev.so.1: libudev.so.1: cannot open shared object file: No such file or directory
|
|
|
|
udev
|
2021-12-26 15:17:12 +00:00
|
|
|
];
|
2020-04-11 18:12:04 +00:00
|
|
|
|
2021-12-26 15:17:12 +00:00
|
|
|
executables = [ "osu!" ];
|
2020-04-11 18:12:04 +00:00
|
|
|
|
2021-12-26 15:17:12 +00:00
|
|
|
fixupPhase = ''
|
|
|
|
runHook preFixup
|
2020-04-11 18:12:04 +00:00
|
|
|
|
|
|
|
for i in 16 32 48 64 96 128 256 512 1024; do
|
|
|
|
install -D ./assets/lazer.png $out/share/icons/hicolor/''${i}x$i/apps/osu\!.png
|
|
|
|
done
|
|
|
|
|
2021-12-26 15:17:12 +00:00
|
|
|
ln -sft $out/lib/${pname} ${SDL2}/lib/libSDL2${stdenvNoCC.hostPlatform.extensions.sharedLibrary}
|
|
|
|
cp -f ${./osu.runtimeconfig.json} "$out/lib/${pname}/osu!.runtimeconfig.json"
|
2020-04-11 18:12:04 +00:00
|
|
|
|
2020-12-08 19:02:20 +00:00
|
|
|
runHook postFixup
|
|
|
|
'';
|
|
|
|
|
2021-12-26 15:17:12 +00:00
|
|
|
desktopItems = [(makeDesktopItem {
|
|
|
|
desktopName = "osu!";
|
|
|
|
name = "osu";
|
|
|
|
exec = "osu!";
|
|
|
|
icon = "osu!";
|
|
|
|
comment = meta.description;
|
|
|
|
type = "Application";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Game" ];
|
2021-12-26 15:17:12 +00:00
|
|
|
})];
|
2020-04-11 18:12:04 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-12-29 15:33:15 +00:00
|
|
|
description = "Rhythm is just a *click* away (no score submission or multiplayer, see osu-lazer-bin)";
|
2020-04-11 18:12:04 +00:00
|
|
|
homepage = "https://osu.ppy.sh";
|
2020-08-19 18:54:11 +00:00
|
|
|
license = with licenses; [
|
|
|
|
mit
|
|
|
|
cc-by-nc-40
|
|
|
|
unfreeRedistributable # osu-framework contains libbass.so in repository
|
|
|
|
];
|
2023-12-18 17:31:11 +00:00
|
|
|
maintainers = with maintainers; [ gepbird thiagokokada ];
|
2020-04-11 18:12:04 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2021-10-08 16:41:39 +00:00
|
|
|
mainProgram = "osu!";
|
2020-04-11 18:12:04 +00:00
|
|
|
};
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
}
|