diff options
Diffstat (limited to 'pkgs/games')
-rw-r--r-- | pkgs/games/build-support/monogame-patcher/default.nix | 47 | ||||
-rw-r--r-- | pkgs/games/build-support/monogame-patcher/src/assembly-info.cs | 6 | ||||
-rw-r--r-- | pkgs/games/build-support/monogame-patcher/src/patcher.cs (renamed from pkgs/games/build-support/monogame-patcher/patcher.cs) | 0 | ||||
-rw-r--r-- | pkgs/games/build-support/monogame-patcher/src/patcher.csproj | 39 |
4 files changed, 65 insertions, 27 deletions
diff --git a/pkgs/games/build-support/monogame-patcher/default.nix b/pkgs/games/build-support/monogame-patcher/default.nix index fffa6825..1a06425e 100644 --- a/pkgs/games/build-support/monogame-patcher/default.nix +++ b/pkgs/games/build-support/monogame-patcher/default.nix @@ -1,31 +1,24 @@ -{ lib, runCommand, makeWrapper, fetchNuGet, mono, dotnetPackages }: +{ buildDotnetPackage, fetchNuGet }: -runCommand "monogame-patcher" { - nativeBuildInputs = [ mono makeWrapper ]; +buildDotnetPackage { + baseName = "monogame-patcher"; + version = "0.1.0"; - src = ./patcher.cs; + src = ./src; - cecil = "${fetchNuGet { - baseName = "Mono.Cecil"; - version = "0.10-beta7"; - sha256 = "03bina3llcnylrfrvp5psnwrfn757j7zch5r360rpdn7gmcjjcpl"; - outputFiles = [ "lib/net40/*" ]; - }}/lib/dotnet/Mono.Cecil"; + buildInputs = [ + (fetchNuGet { + baseName = "Mono.Cecil"; + version = "0.10-beta7"; + sha256 = "03bina3llcnylrfrvp5psnwrfn757j7zch5r360rpdn7gmcjjcpl"; + outputFiles = [ "lib/net40/*" ]; + }) - cliparser = "${fetchNuGet { - baseName = "CommandLineParser"; - version = "2.2.1"; - sha256 = "0wf8mzr16d2ni008m60rrk738v8ypk74llk6g8mlyx7rrlchnxaf"; - outputFiles = [ "lib/net45/*" ]; - }}/lib/dotnet/CommandLineParser"; - -} '' - mkdir -p "$out/bin" "$out/libexec/monogame-patcher" - mcs "$src" -out:"$out/libexec/monogame-patcher/patcher.exe" \ - -lib:"$cecil" -lib:"$cliparser" \ - -r:Mono.Cecil -r:Mono.Cecil.Rocks -r:CommandLine - - makeWrapper ${lib.escapeShellArg "${mono}/bin/mono"} "$out/bin/$name" \ - --set MONO_PATH "$cecil:$cliparser" \ - --add-flags "$out/libexec/monogame-patcher/patcher.exe" -'' + (fetchNuGet { + baseName = "CommandLineParser"; + version = "2.2.1"; + sha256 = "0wf8mzr16d2ni008m60rrk738v8ypk74llk6g8mlyx7rrlchnxaf"; + outputFiles = [ "lib/net45/*" ]; + }) + ]; +} diff --git a/pkgs/games/build-support/monogame-patcher/src/assembly-info.cs b/pkgs/games/build-support/monogame-patcher/src/assembly-info.cs new file mode 100644 index 00000000..55c4c4d3 --- /dev/null +++ b/pkgs/games/build-support/monogame-patcher/src/assembly-info.cs @@ -0,0 +1,6 @@ +using System.Reflection; + +[assembly: AssemblyTitle("monogame-patcher")] +[assembly: AssemblyVersion("0.1.0")] +[assembly: AssemblyDescription("Patches common annoyances in Mono Assemblies")] +[assembly: AssemblyCopyright("(c) 2018 aszlig")] diff --git a/pkgs/games/build-support/monogame-patcher/patcher.cs b/pkgs/games/build-support/monogame-patcher/src/patcher.cs index c1502ba1..c1502ba1 100644 --- a/pkgs/games/build-support/monogame-patcher/patcher.cs +++ b/pkgs/games/build-support/monogame-patcher/src/patcher.cs diff --git a/pkgs/games/build-support/monogame-patcher/src/patcher.csproj b/pkgs/games/build-support/monogame-patcher/src/patcher.csproj new file mode 100644 index 00000000..cd8f1c19 --- /dev/null +++ b/pkgs/games/build-support/monogame-patcher/src/patcher.csproj @@ -0,0 +1,39 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" + DefaultTargets="Build"> + + <Import Project="$(MSBuildToolsPath)/Microsoft.CSharp.targets" /> + + <ItemGroup> + <Compile Include="patcher.cs"/> + <Compile Include="assembly-info.cs"/> + </ItemGroup> + + <PropertyGroup> + <!-- I *hate* those long lines with a passion, so let's concat them --> + <Blurb>, Culture=neutral, PublicKeyToken=</Blurb> + + <CecilInfo>Version=0.10.0.0$(Blurb)50cebf1cceb9d05e</CecilInfo> + <CmdLineInfo>Version=2.2.1.0$(Blurb)de6f01bd326f8c32</CmdLineInfo> + </PropertyGroup> + + <ItemGroup> + <Reference Include="Mono.Cecil, $(CecilInfo)"> + <SpecificVersion>False</SpecificVersion> + <Private>True</Private> + </Reference> + <Reference Include="Mono.Cecil.Rocks"/> + <Reference Include="CommandLine, $(CmdLineInfo)"> + <SpecificVersion>False</SpecificVersion> + <Private>True</Private> + </Reference> + </ItemGroup> + + <PropertyGroup> + <AssemblyName>monogame-patcher</AssemblyName> + <OutputType>Exe</OutputType> + <OutDir>bin/Release/</OutDir> + <OutputPath>bin/Release</OutputPath> + <WarningLevel>4</WarningLevel> + <Optimize>true</Optimize> + </PropertyGroup> +</Project> |