Hey,
i’m on nixos 20.09 and try to build godot-3.2.3-stable with support for C#.
I’m following the instruction on the godot docs, which states that one first has to enable the mono module and then generate the mono-glue. I tried to adapt the default.nix of the NixOS/nixpkgs repository to my needs but failed.
What i tried to do :
with import<nixpkgs>{};
stdenv.mkDerivation rec {
pname = "godot_cs";
version = "3.2.3";
src = fetchFromGitHub {
owner = "godotengine";
repo = "godot";
rev = "${version}-stable";
sha256 = "19vrp5lhyvxbm6wjxzn28sn3i0s8j08ca7nani8l1nrhvlc8wi0v";
};
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [
mono6 msbuild dotnetPackages.Nuget
scons xorg.libX11 xorg.libXcursor xorg.libXinerama xorg.libXrandr xorg.libXrender
xorg.libXi xorg.libXext xorg.libXfixes freetype openssl alsaLib libpulseaudio
libGLU zlib yasm
];
patches = [
./pkg_config_additions.patch
./dont_clobber_environment.patch
];
enableParallelBuilding = true;
buildPhase = ''
scons p=x11 tools=yes module_mono_enabled=yes mono_glue=no pulseaudio=true
./bin/godot.x11.tools.64.mono --generate-mono-glue modules/mono/glue
scons p=x11 target=release_debug tools=yes module_mono_enabled=yes
'';
outputs = [ "out" "dev" ];
installPhase = ''
mkdir -p "$out/bin"
cp bin/godot.* $out/bin/godot
mkdir "$dev"
cp -r modules/gdnative/include $dev
mkdir -p "$out"/share/{applications,icons/hicolor/scalable/apps}
cp misc/dist/linux/org.godotengine.Godot.desktop "$out/share/applications/"
cp icon.svg "$out/share/icons/hicolor/scalable/apps/godot.svg"
cp icon.png "$out/share/icons/godot.png"
substituteInPlace "$out/share/applications/org.godotengine.Godot.desktop" \
--replace "Exec=godot" "Exec=$out/bin/godot"
'';
}
But if i try to build the derivation with nix-build
i get an error:
Mono root directory not found. Using pkg-config instead
/nix/store/vnyfysaya7sblgdyvqjkrjbrb0cy11jf-bash-4.4-p23/bin/sh: pkg-config: command not found
OSError: 'pkg-config monosgen-2 --libs-only-L' exited 127:
File "/build/source/SConstruct", line 617:
SConscript("modules/SCsub")
...
...
builder for '/nix/store/gpf5rchkbmwc1kqirn2bydxlrlnny2pn-godot_cs-3.2.3.drv' failed with exit code 2
error: build of '/nix/store/gpf5rchkbmwc1kqirn2bydxlrlnny2pn-godot_cs-3.2.3.drv' failed
I am sorry but this is the first derivation i am trying to build and i am totally lost here. I have already searched the nixpkg manual but couldn’t find a solution there. If someone could help me and point me in the right direction i would be very grateful.