blob: 96130cb92abfff3239530886aea88f97cf566049 (
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
61
62
63
64
65
66
67
68
69
70
71
|
{ godot3
, callPackage
, mkNugetDeps
, mkNugetSource
, mono
, dotnet-sdk
, writeText
, scons
, python311
}:
(godot3.override {
scons = scons.override {
python3 = python311;
};
}).overrideAttrs (self: base: {
pname = "godot3-mono";
godotBuildDescription = "mono build";
nativeBuildInputs = base.nativeBuildInputs ++ [ mono dotnet-sdk ];
glue = callPackage ./glue.nix {};
nugetDeps = mkNugetDeps { name = "deps"; nugetDeps = import ./deps.nix; };
nugetSource =
mkNugetSource {
name = "${self.pname}-nuget-source";
description = "Nuget source with dependencies for ${self.pname}";
deps = [ self.nugetDeps ];
};
nugetConfig = writeText "NuGet.Config" ''
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="${self.pname}-deps" value="${self.nugetSource}/lib" />
</packageSources>
</configuration>
'';
sconsFlags = base.sconsFlags ++ [
"module_mono_enabled=true"
"mono_prefix=${mono}"
];
shouldConfigureNuget = true;
postConfigure = ''
echo "Setting up buildhome."
mkdir buildhome
export HOME="$PWD"/buildhome
echo "Overlaying godot glue."
cp -R --no-preserve=mode "$glue"/. .
if [ -n "$shouldConfigureNuget" ]; then
echo "Configuring NuGet."
mkdir -p ~/.nuget/NuGet
ln -s "$nugetConfig" ~/.nuget/NuGet/NuGet.Config
fi
'';
installedGodotShortcutFileName = "org.godotengine.GodotMono3.desktop";
installedGodotShortcutDisplayName = "Godot Engine (Mono) 3";
passthru = {
make-deps = callPackage ./make-deps.nix {};
};
})
|