Created
December 3, 2018 21:28
-
-
Save fusion809/a8b5066b02178d9dc486c12ea51dfa52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, fetchFromGitHub, mono, makeWrapper, lua | |
, SDL2, freetype, openal, systemd, pkgconfig, | |
dotnetPackages, gnome3, curl, unzip, which, python | |
}: | |
let | |
engine = fetchFromGitHub { | |
owner = "RAunplugged"; | |
repo = "OpenRA" ; | |
rev = "unplugged-cd82382"; | |
sha256 = "1zn35ks63ngqrm49mrlf2ri185yhaica1lg652rvaqv4m1pnrrxr"; | |
}; | |
in | |
stdenv.mkDerivation rec { | |
name = "openra-ura-${version}"; | |
version = "407"; | |
commit = "2f7f784127dc7a94cd934089954193d126971d60"; | |
meta = with stdenv.lib; { | |
description = "Re-imaginging of the original Command & Conquer Red Alert game"; | |
homepage = "http://redalertunplugged.com/"; | |
maintainers = [ maintainers.fusion809 ]; | |
license = licenses.gpl3; | |
platforms = platforms.linux; | |
}; | |
src = fetchFromGitHub { | |
owner = "RAunplugged"; | |
repo = "uRA"; | |
rev = "${commit}"; | |
sha256 = "0hhwzc3fkh0kb9w6zzmq5sqzn5hhx8qxnz6464ds5djk5cglnphz"; | |
}; | |
patches = [ ./Makefile.patch ]; | |
dontStrip = true; | |
buildInputs = (with dotnetPackages; | |
[ NUnit3 NewtonsoftJson MonoNat FuzzyLogicLibrary SmartIrc4net SharpZipLib MaxMindGeoIP2 MaxMindDb SharpFont StyleCopMSBuild StyleCopPlusMSBuild RestSharp NUnitConsole OpenNAT ]) | |
++ [ curl unzip lua gnome3.zenity ]; | |
nativeBuildInputs = [ curl unzip mono makeWrapper lua pkgconfig ]; | |
postPatch = '' | |
mkdir Support | |
sed -i \ | |
-e 's/^VERSION.*/VERSION = ${version}/g' \ | |
Makefile | |
''; | |
preConfigure = '' | |
cp -a ${engine} engine | |
sed -i 's,curl,curl --insecure,g' engine/thirdparty/{fetch-thirdparty-deps,noget}.sh | |
engine/thirdparty/fetch-thirdparty-deps.sh | |
substituteInPlace engine/thirdparty/configure-native-deps.sh --replace "locations=\"" "locations=\"${lua}/lib " | |
mkdir Support | |
makeFlags="prefix=$out" | |
make version | |
''; | |
buildFlags = [ "build" ]; | |
doCheck = true; | |
#TODO: check | |
checkTarget = "check"; | |
postInstall = with stdenv.lib; let | |
runtime = makeLibraryPath [ SDL2 freetype openal systemd lua ]; | |
binaries= makeBinPath [ which mono gnome3.zenity python ]; | |
in '' | |
mkdir -p $out{lib/openra-ura/mods,bin,share/pixmaps,share/doc/packages/openra-ra,share/applications,share/appdata} | |
cp -r engine/{glsl,lua,AUTHORS,COPYING,Eluant.dll*,FuzzyLogicLibrary.dll,GeoLite2-Country.mmdb.gz,'global mix database.dat',ICSharpCode.SharpZipLib.dll,launch-dedicated.sh,launch-game.sh,MaxMind.Db.dll,OpenAL-CS.dll,OpenAL-CS.dll.config,Open.Nat.dll,OpenRA.Game.exe,OpenRA.Platforms.Default.dll,OpenRA.Server.exe,OpenRA.Utility.exe,rix0rrr.BeaconLib.dll,SDL2-CS.dll,SDL2-CS.dll.config,SharpFont.dll,SharpFont.dll.config,VERSION} $out/lib/openra-ura | |
cp -r mods/ura $out/lib/openra-ura/mods | |
cp -r engine/mods/{common,modcontent} $out/lib/openra-ura/mods | |
cp -r README.md $out/share/doc/packages/openra-ura/README.md | |
install -Dm644 ${./openra-ura.desktop} $out/share/applications/openra-ura.desktop | |
install -Dm755 ${./openra-ura} $out/bin/openra-ura | |
mkdir $out/share/icons/hicolor/{16x16,32x32,48x48,64x64,128x128,256x256}/apps -p | |
mv packaging/linux/mod_16x16.png "$out/share/icons/hicolor/16x16/apps/openra-ura.png" | |
mv packaging/linux/mod_32x32.png "$out/share/icons/hicolor/32x32/apps/openra-ura.png" | |
mv packaging/linux/mod_48x48.png "$out/share/icons/hicolor/48x48/apps/openra-ura.png" | |
mv packaging/linux/mod_64x64.png "$out/share/icons/hicolor/64x64/apps/openra-ura.png" | |
mv packaging/linux/mod_128x128.png "$out/share/icons/hicolor/128x128/apps/openra-ura.png" | |
mv packaging/linux/mod_256x256.png "$out/share/icons/hicolor/256x256/apps/openra-ura.png" | |
rm $out/lib/openra-ura/*.sh | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment