Merge pull request #106377 from oxalica/osu-lazer

This commit is contained in:
Sandro 2020-12-26 20:10:50 +01:00 committed by GitHub
commit 81181e752a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 563 additions and 227 deletions

View file

@ -13,13 +13,13 @@ let
in stdenv.mkDerivation rec {
pname = "osu-lazer";
version = "2020.1204.0";
version = "2020.1225.0";
src = fetchFromGitHub {
owner = "ppy";
repo = "osu";
rev = version;
sha256 = "1yr9rkkmm15lgbfbrvpyp0d66i5v2xs39abw8yv6qlf70qh4bsg5";
sha256 = "BISczC4xYcF6m5l3ye/bdZxs/aK0Jz6sFVFOgNDo0v0=";
};
patches = [ ./bypass-tamper-detection.patch ];
@ -40,7 +40,7 @@ in stdenv.mkDerivation rec {
export HOME=$(mktemp -d)
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_NOLOGO=1
nuget sources Add -Name nixos -Source "$PWD/nixos"
nuget init "$nugetDeps" "$PWD/nixos"
@ -49,7 +49,7 @@ in stdenv.mkDerivation rec {
mkdir -p $HOME/.nuget/NuGet
cp $HOME/.config/NuGet/NuGet.Config $HOME/.nuget/NuGet
dotnet restore --source "$PWD/nixos" osu.Desktop
dotnet restore --source "$PWD/nixos" osu.Desktop --runtime ${runtimeId}
runHook postConfigure
'';
@ -59,6 +59,7 @@ in stdenv.mkDerivation rec {
dotnet build osu.Desktop \
--no-restore \
--configuration Release \
--runtime ${runtimeId} \
-p:Version=${version}
runHook postBuild
'';
@ -69,10 +70,9 @@ in stdenv.mkDerivation rec {
dotnet publish osu.Desktop \
--no-build \
--configuration Release \
--runtime ${runtimeId} \
--no-self-contained \
--output $out/lib/osu
shopt -s extglob
rm -r $out/lib/osu/runtimes/!(${runtimeId})
makeWrapper $out/lib/osu/osu\! $out/bin/osu\! \
--set DOTNET_ROOT "${dotnet-netcore}" \
@ -93,6 +93,13 @@ in stdenv.mkDerivation rec {
runHook postInstall
'';
fixupPhase = ''
runHook preFixup
cp -f ${./osu.runtimeconfig.json} "$out/lib/osu/osu!.runtimeconfig.json"
ln -sft $out/lib/osu ${SDL2}/lib/libSDL2${stdenv.hostPlatform.extensions.sharedLibrary}
runHook postFixup
'';
# Strip breaks the executable.
dontStrip = true;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "netcoreapp3.1",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "3.1.0"
}
}
}

View file

@ -5,7 +5,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
deps_file="$(realpath "./deps.nix")"
new_version="$(curl -s "https://api.github.com/repos/ppy/osu/releases" | jq -r '.[0].name')"
new_version="$(curl -s "https://api.github.com/repos/ppy/osu/releases?per_page=1" | jq -r '.[0].name')"
old_version="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./default.nix)"
if [[ "$new_version" == "$old_version" ]]; then
echo "Up to date"
@ -36,7 +36,7 @@ cat >./nuget_tmp.config <<EOF
</configuration>
EOF
dotnet restore osu.Desktop --configfile ./nuget_tmp.config
dotnet restore osu.Desktop --configfile ./nuget_tmp.config --runtime linux-x64
echo "{ fetchNuGet }: [" >"$deps_file"
while read pkg_spec; do