Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: proton-osu-bin and umu osu #213

Merged
merged 28 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ed6e227
Add proton-osu package (temporary)
ProspectPyxis Oct 19, 2024
589213b
Add umu to osu-stable, hopefully
ProspectPyxis Oct 19, 2024
5f41988
Add proton-osu to packages list
ProspectPyxis Oct 19, 2024
b86a38b
Add proton-osu properly to osu-stable
ProspectPyxis Oct 19, 2024
20b8891
Add umu to osu-stable
ProspectPyxis Oct 19, 2024
08f8c2f
Fix uncapitalized license type
ProspectPyxis Oct 19, 2024
d601ff3
Fix proton-osu source typo
ProspectPyxis Oct 19, 2024
c04b0d5
Add proper hash to proton-osu
ProspectPyxis Oct 19, 2024
5ef5a77
Remove ipc bridge if umu is used
ProspectPyxis Oct 19, 2024
94ddcb1
Change umu to umu-run in osu-stable
ProspectPyxis Oct 19, 2024
3027035
Remove flags from umu winetricks usage
ProspectPyxis Oct 19, 2024
2f0bcef
Try not moving osu after installation
ProspectPyxis Oct 20, 2024
fff074c
Various hopeful fixes
ProspectPyxis Oct 20, 2024
66538d5
Add more hopeful fixes
ProspectPyxis Oct 20, 2024
cf5d387
Add LD_LIBRARY_PATH to script
ProspectPyxis Oct 20, 2024
cc81aa8
Force only 32-bit libraries
ProspectPyxis Oct 20, 2024
834e36d
Hopefully fix driver load issues
ProspectPyxis Oct 20, 2024
5316720
Try to fix driver issues again
ProspectPyxis Oct 20, 2024
6193b4c
Tweak library and driver handling more
ProspectPyxis Oct 20, 2024
2e77502
Add more attempts to fix broken drivers
ProspectPyxis Oct 20, 2024
772247b
Fix drivers, attempt 8
ProspectPyxis Oct 20, 2024
f227a7b
Retry putting 32-bit first in LD_LIBRARY_PATH
ProspectPyxis Oct 20, 2024
fff7e77
Just get the package into a PR-ready state for now
ProspectPyxis Oct 20, 2024
45a50c4
Fix alejandra formatting
ProspectPyxis Oct 23, 2024
5d2f740
Rename proton-osu to follow proton-ge-bin convention
ProspectPyxis Oct 23, 2024
5941d62
Fix alejandra formatting, again
ProspectPyxis Oct 23, 2024
af46e7f
Actually properly fix alejandra formatting
ProspectPyxis Oct 23, 2024
4eb17f6
Merge branch 'fufexan:master' into proton-osu
ProspectPyxis Oct 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
};

osu-stable = pkgs.callPackage ./osu-stable {
inherit (config.packages) osu-mime;
inherit (config.packages) osu-mime proton-osu-bin umu;
wine = config.packages.wine-osu;
wine-discord-ipc-bridge = config.packages.wine-discord-ipc-bridge.override {wine = config.packages.wine-osu;};
};
Expand All @@ -80,6 +80,8 @@
'';
};

proton-osu-bin = pkgs.callPackage ./proton-osu-bin {};

roblox-player = pkgs.callPackage ./roblox-player {
wine = config.packages.wine-tkg;
inherit (config.packages) wine-discord-ipc-bridge;
Expand Down
8 changes: 8 additions & 0 deletions pkgs/osu-stable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ of files. In any case, **do not stop the command!**

If anything goes wrong and for some reason osu! won't start, delete the `~/.osu`
directory and re-run `osu-stable`.

## Additional Overrides

This package has the following additional overrides:

- `protonPath` Proton compatibility tool if umu is used.
Defaults to [`proton-osu`](../proton-osu/README.md).
- `protonVerbs`
67 changes: 54 additions & 13 deletions pkgs/osu-stable/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
wine-discord-ipc-bridge,
winetricks,
wine,
umu,
proton-osu-bin,
wineFlags ? "",
pname ? "osu-stable",
location ? "$HOME/.osu",
useUmu ? false,
protonPath ? "${proton-osu-bin.steamcompattool}",
protonVerbs ? ["waitforexitandrun"],
tricks ? ["gdiplus" "dotnet45" "meiryo"],
preCommands ? "",
postCommands ? "",
Expand All @@ -35,26 +40,62 @@
# disables vsync for OpenGL
export vblank_mode=0

PATH=$PATH:${wine}/bin:${winetricks}/bin
# ID for umu
export GAMEID="osu-wine-umu"
export STORE="none"

PATH=${
lib.makeBinPath (
if useUmu
then [umu]
else [wine winetricks]
)
}:$PATH
USER="$(whoami)"
OSU="$WINEPREFIX/drive_c/osu/osu!.exe"

if [ ! -d "$WINEPREFIX" ]; then
# install tricks
winetricks -q -f ${tricksFmt}
wineserver -k
${
if useUmu
then ''
export PROTON_VERBS="${lib.strings.concatStringsSep "," protonVerbs}"
export PROTONPATH="${protonPath}"

if [ ! -d "$WINEPREFIX" ]; then
umu-run winetricks ${tricksFmt}
fi

if [ ! -f "$OSU" ]; then
umu-run ${src}
mv "$WINEPREFIX/drive_c/users/steamuser/AppData/Local/osu!" $WINEPREFIX/drive_c/osu
fi
''
else ''
if [ ! -d "$WINEPREFIX" ]; then
# install tricks
winetricks -q -f ${tricksFmt}
wineserver -k

# install osu
wine ${src}
wineserver -k
mv "$WINEPREFIX/drive_c/users/$USER/AppData/Local/osu!" $WINEPREFIX/drive_c/osu
fi
# install osu
wine ${src}
wineserver -k
mv "$WINEPREFIX/drive_c/users/$USER/AppData/Local/osu!" $WINEPREFIX/drive_c/osu
fi
''
}

${preCommands}

wine ${wine-discord-ipc-bridge}/bin/winediscordipcbridge.exe &
${gamemode}/bin/gamemoderun wine ${wineFlags} "$OSU" "$@"
wineserver -w
${
if useUmu
then ''
${gamemode}/bin/gamemoderun umu-run "$OSU" "$@"
''
else ''
wine ${wine-discord-ipc-bridge}/bin/winediscordipcbridge.exe &
${gamemode}/bin/gamemoderun wine ${wineFlags} "$OSU" "$@"
wineserver -w
''
}

${postCommands}
'';
Expand Down
4 changes: 4 additions & 0 deletions pkgs/proton-osu-bin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# proton-osu-bin

Build of Wine/Proton with various patches, such as low-latency audio.
Intended to be used with osu!.
40 changes: 40 additions & 0 deletions pkgs/proton-osu-bin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
lib,
stdenvNoCC,
fetchzip,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "proton-osu-bin";
version = "proton-osu-9-7";

src = fetchzip {
url = "https://github.com/whrvt/umubuilder/releases/download/${finalAttrs.version}/${finalAttrs.version}.tar.xz";
hash = "sha256-SPj7ogWjPxlBILRiGmMXti0fZyyLdzfoA308xbIAn3Q=";
};

outputs = [
"out"
"steamcompattool"
];

buildCommand = ''
runHook preBuild

echo "${finalAttrs.pname} should not be installed into environments. Please use programs.steam.extraCompatPackages instead." > $out

ln -s $src $steamcompattool

runHook postBuild
'';

meta = {
description = ''
Compatibily tool for Steam Play, patched with low-latency audio and intended for osu!.

(This is intended for use in the `programs.steam.extraCompatPackages` option only.)
'';
homepage = "https://github.com/whrvt/umubuilder";
license = lib.licenses.gpl3Plus;
platforms = ["x86_64-linux"];
};
})