From ef582b2805fca03c7f4aa9848cf7935407295139 Mon Sep 17 00:00:00 2001 From: Svein Ove Aas Date: Fri, 22 Jan 2016 23:54:49 +0000 Subject: factorio: init at 0.12.20 --- pkgs/games/factorio/default.nix | 100 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 pkgs/games/factorio/default.nix (limited to 'pkgs/games/factorio/default.nix') diff --git a/pkgs/games/factorio/default.nix b/pkgs/games/factorio/default.nix new file mode 100644 index 000000000000..b08f977cda6b --- /dev/null +++ b/pkgs/games/factorio/default.nix @@ -0,0 +1,100 @@ +{ stdenv, callPackage, fetchurl, makeWrapper +# Begin libraries +, alsaLib, libX11, libXcursor, libXinerama, libXrandr, libXi +# Begin download parameters +, username ? "" +, password ? "" +}: + +let + version = "0.12.20"; + + fetch = callPackage ./fetch.nix { username = username; password = password; }; + arch = if stdenv.system == "x86_64-linux" then "x64" + else if stdenv.system == "i686-linux" then "x32" + else abort "Unsupported platform"; + + variants = { + x64 = { + url = "https://www.factorio.com/get-download/${version}/alpha/linux64"; + sha256 = "1xpzrx3q678519qgjl92fxn3qv55hd188x9jp6dcfk2ljhi1gmqk"; + }; + + x32 = { + url = "https://www.factorio.com/get-download/${version}/alpha/linux32"; + sha256 = "1dl1dsp4nni5nda437ckyw1ss6w168g19v51h7cdvb3cgsdb7sab"; + }; + }; +in + +stdenv.mkDerivation rec { + name = "factorio-${version}"; + + src = fetch variants.${arch}; + + libPath = stdenv.lib.makeLibraryPath [ + alsaLib + libX11 + libXcursor + libXinerama + libXrandr + libXi + ]; + + buildInputs = [ makeWrapper ]; + + installPhase = '' + mkdir -p $out/{bin,share/factorio} + cp -a bin/${arch}/factorio $out/bin/factorio.${arch} + cp -a doc-html data $out/share/factorio/ + + # Fortunately, Factorio already supports system-wide installs. + # Unfortunately it's a bit inconvenient to set the paths. + cat > $out/share/factorio/config-base.cfg < $out/share/factorio/update-config.sh <