1 { lib, buildDotnetModule, dotnetCorePackages
3 , SDL2, freetype, openal, lua51Packages
7 buildDotnetModule rec {
8 pname = "openra-${engine.build}";
9 inherit (engine) version;
11 src = if engine ? src then engine.src else fetchFromGitHub {
14 rev = "${engine.build}-${engine.version}";
15 sha256 = engine.sha256;
18 nugetDeps = engine.deps;
20 dotnet-sdk = dotnetCorePackages.sdk_6_0;
21 dotnet-runtime = dotnetCorePackages.runtime_6_0;
25 dotnetFlags = [ "-p:Version=0.0.0.0" ]; # otherwise dotnet build complains, version is saved in VERSION file anyway
27 dotnetBuildFlags = [ "-p:TargetPlaform=unix-generic" ];
28 dotnetInstallFlags = [
29 "-p:TargetPlaform=unix-generic"
30 "-p:CopyGenericLauncher=True"
36 dontDotnetFixup = true;
38 # Microsoft.NET.Publish.targets(248,5): error MSB3021: Unable to copy file "[...]/Newtonsoft.Json.dll" to "[...]/Newtonsoft.Json.dll". Access to the path '[...]Newtonsoft.Json.dll' is denied. [/build/source/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj]
39 enableParallelBuilding = false;
42 make VERSION=${engine.build}-${version} version
46 # Create the file so that the install_data script will not attempt to download it.
47 # TODO: fetch the file and include it
48 touch './IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP'
50 # Install all the asset data
52 . ./packaging/functions.sh
53 install_data . "$out/lib/${pname}" cnc d2k ra
56 # Replace precompiled libraries with links to native one.
57 # This is similar to configure-system-libraries.sh in the source repository
58 ln -s -f ${lua51Packages.lua}/lib/liblua.so $out/lib/${pname}/lua51.so
59 ln -s -f ${SDL2}/lib/libSDL2.so $out/lib/${pname}/SDL2.so
60 ln -s -f ${openal}/lib/libopenal.so $out/lib/${pname}/soft_oal.so
61 ln -s -f ${freetype}/lib/libfreetype.so $out/lib/${pname}/freetype6.so
66 . ./packaging/functions.sh
67 install_linux_shortcuts . "" "$out/lib/${pname}" "$out/.bin-unwrapped" "$out/share" "${version}" cnc d2k ra
70 # Create Nix wrappers to the application scripts which setup the needed environment
71 for bin in $(find $out/.bin-unwrapped -type f); do
72 makeWrapper "$bin" "$out/bin/$(basename "$bin")" \
73 --prefix "PATH" : "${lib.makeBinPath [ dotnet-runtime ]}"
78 description = "Open Source real-time strategy game engine for early Westwood games such as Command & Conquer: Red Alert. ${engine.build} version";
79 homepage = "https://www.openra.net/";
80 license = licenses.gpl3;
81 maintainers = with maintainers; [ mdarocha ];
82 platforms = [ "x86_64-linux" ];
83 mainProgram = "openra-ra";