blob: c41c28b90271106a3083614c4a48625722471ed3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
{ buildUnity, fetchItch, mono, monogamePatcher, strace }:
buildUnity rec {
name = "invisigun-heroes";
fullName = "Invisigun";
saveDir = "Sombr Studio/Invisigun Reloaded";
version = "1.8.7";
src = fetchItch {
name = "${name}-${version}.zip";
gameId = 25561;
uploadId = 208583;
version = "v${version}";
sha256 = "1ksq1xfs2xd4dn7anzyiy3d08a8k5ap3mb3a73cbz0khfivh4hgc";
};
nativeBuildInputs = [ mono monogamePatcher ];
buildPhase = ''
cat > nix-support.cs <<EOF
using System;
using UnityEngine;
public class NixSupport {
public static string GetFullPathStub(string _ignore) {
return Application.persistentDataPath;
}
public static string GetNickName(string _ignore) {
string envar;
envar = Environment.GetEnvironmentVariable("INVISIGUN_NICKNAME");
if (envar != null) return envar;
envar = Environment.GetEnvironmentVariable("USER");
if (envar != null) return envar;
return "";
}
}
EOF
mcs nix-support.cs -target:library \
-r:Invisigun_Data/Managed/UnityEngine.CoreModule \
-out:Invisigun_Data/Managed/NixSupport.dll
monogame-patcher replace-call \
-i Invisigun_Data/Managed/Assembly-CSharp.dll \
-a Invisigun_Data/Managed/NixSupport.dll \
'System.String System.IO.Path::GetFullPath(System.String)' \
'System.String NixSupport::GetFullPathStub(System.String)' \
FileManagerAdapter_Desktop::ApplicationPath
monogame-patcher replace-call \
-i Invisigun_Data/Managed/Assembly-CSharp.dll \
-a Invisigun_Data/Managed/NixSupport.dll \
'System.String Tools::FilterText(System.String)' \
'System.String NixSupport::GetNickName(System.String)' \
Tools::GetNickname
'';
sandbox.paths.required = [ "$XDG_DATA_HOME/Invisigun Reloaded" ];
}
|