diff options
author | Robin Gloster <mail@glob.in> | 2016-08-12 09:46:53 +0000 |
---|---|---|
committer | Robin Gloster <mail@glob.in> | 2016-08-12 09:46:53 +0000 |
commit | b7787d932ec9cbd82ea6bc7c69d8df159b606fdc (patch) | |
tree | c4b6af2e6b49732ce5c6982cb8512ce9b7f1f34d /pkgs/games | |
parent | bc025e83bd6c44df38851ef23da53359a0e62841 (diff) | |
parent | 532b2222965377e77ed884c463ee2751fb51dba3 (diff) | |
download | nixpkgs-b7787d932ec9cbd82ea6bc7c69d8df159b606fdc.tar nixpkgs-b7787d932ec9cbd82ea6bc7c69d8df159b606fdc.tar.gz nixpkgs-b7787d932ec9cbd82ea6bc7c69d8df159b606fdc.tar.bz2 nixpkgs-b7787d932ec9cbd82ea6bc7c69d8df159b606fdc.tar.lz nixpkgs-b7787d932ec9cbd82ea6bc7c69d8df159b606fdc.tar.xz nixpkgs-b7787d932ec9cbd82ea6bc7c69d8df159b606fdc.tar.zst nixpkgs-b7787d932ec9cbd82ea6bc7c69d8df159b606fdc.zip |
Merge remote-tracking branch 'upstream/master' into hardened-stdenv
Diffstat (limited to 'pkgs/games')
-rw-r--r-- | pkgs/games/factorio/default.nix | 36 | ||||
-rw-r--r-- | pkgs/games/factorio/mods.nix | 213 | ||||
-rw-r--r-- | pkgs/games/factorio/utils.nix | 49 | ||||
-rw-r--r-- | pkgs/games/gambatte/default.nix | 2 | ||||
-rw-r--r-- | pkgs/games/gambatte/fix-scons-paths.patch | 15 | ||||
-rw-r--r-- | pkgs/games/hedgewars/default.nix | 9 | ||||
-rw-r--r-- | pkgs/games/openttd/default.nix | 6 | ||||
-rw-r--r-- | pkgs/games/terraria-server/default.nix | 1 | ||||
-rw-r--r-- | pkgs/games/vessel/default.nix | 2 | ||||
-rw-r--r-- | pkgs/games/xboard/default.nix | 8 | ||||
-rw-r--r-- | pkgs/games/zod/default.nix | 2 |
11 files changed, 323 insertions, 20 deletions
diff --git a/pkgs/games/factorio/default.nix b/pkgs/games/factorio/default.nix index cb04e9c4750..bb6cffdb122 100644 --- a/pkgs/games/factorio/default.nix +++ b/pkgs/games/factorio/default.nix @@ -1,6 +1,8 @@ { stdenv, callPackage, fetchurl, makeWrapper , alsaLib, libX11, libXcursor, libXinerama, libXrandr, libXi, mesa_noglu +, factorio-utils , releaseType +, mods ? [] , username ? "" , password ? "" }: @@ -8,7 +10,7 @@ assert releaseType == "alpha" || releaseType == "headless"; with stdenv.lib; let - version = "0.13.8"; + version = "0.13.13"; isHeadless = releaseType == "headless"; arch = if stdenv.system == "x86_64-linux" then { @@ -23,14 +25,14 @@ let fetch = rec { url = "https://www.factorio.com/get-download/${version}/${releaseType}/${arch.inUrl}"; - name = "factorio_${releaseType}_${arch.inTar}-${version}.tar.gz"; # TODO take this from 302 redirection somehow? fetchurl doesn't help. + name = "factorio_${releaseType}_${arch.inTar}-${version}.tar.gz"; x64 = { - headless = fetchurl { inherit name url; sha256 = "0dliympqnnawfw65n5gnda9mljyqwshmq2hvplf1h8nrp1rw3pgj"; }; - alpha = authenticatedFetch { inherit url; sha256 = "12safa8b4g5cpwxbkf8ldkb17lgf33rslr7p81l7gr1lyzfnf82c"; }; + headless = fetchurl { inherit name url; sha256 = "1ip0h2kh16s07nk6xqpm0i0yb0x32zn306414j15gqg3j0j0mzpn"; }; + alpha = authenticatedFetch { inherit url; sha256 = "1hvj51cggp6cbxyndbl4z07kadzxxk3diiqkkv0jm9s0nrwvq9zr"; }; }; i386 = { headless = abort "Factorio 32-bit headless binaries are not available for download."; - alpha = authenticatedFetch { inherit url; sha256 = "0m4m183avnqxkw28vb7za14dsmcd01sdldgga0br1clilxmgph2w"; }; + alpha = authenticatedFetch { inherit url; sha256 = "14dwlakn7z8jziy0hgm3nskr7chp7753z1dakxlymz9h5653cx8b"; }; }; }; @@ -54,14 +56,16 @@ let fi ''; + modDir = factorio-utils.mkModDirDrv mods; + base = { name = "factorio-${releaseType}-${version}"; src = fetch.${arch.inTar}.${releaseType}; + preferLocalBuild = true; dontBuild = true; - # TODO detangle headless/normal mode wrapping, libs, etc. test all urls 32/64/headless/gfx installPhase = '' mkdir -p $out/{bin,share/factorio} cp -a data $out/share/factorio @@ -71,8 +75,6 @@ let $out/bin/factorio ''; - preferLocalBuild = true; - meta = { description = "A game in which you build and maintain factories"; longDescription = '' @@ -112,7 +114,23 @@ let wrapProgram $out/bin/factorio \ --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$libPath \ --run "$out/share/factorio/update-config.sh" \ - --add-flags "-c \$HOME/.factorio/config.cfg" + --add-flags "-c \$HOME/.factorio/config.cfg ${optionalString (mods != []) "--mod-directory=${modDir}"}" + + # TODO Currently, every time a mod is changed/added/removed using the + # modlist, a new derivation will take up the entire footprint of the + # client. The only way to avoid this is to remove the mods arg from the + # package function. The modsDir derivation will have to be built + # separately and have the user specify it in the .factorio config or + # right along side it using a symlink into the store I think i will + # just remove mods for the client derivation entirely. this is much + # cleaner and more useful for headless mode. + + # TODO: trying to toggle off a mod will result in read-only-fs-error. + # not much we can do about that except warn the user somewhere. In + # fact, no exit will be clean, since this error will happen on close + # regardless. just prints an ugly stacktrace but seems to be otherwise + # harmless, unless maybe the user forgets and tries to use the mod + # manager. install -m0644 <(cat << EOF ${configBaseCfg} diff --git a/pkgs/games/factorio/mods.nix b/pkgs/games/factorio/mods.nix new file mode 100644 index 00000000000..501665494eb --- /dev/null +++ b/pkgs/games/factorio/mods.nix @@ -0,0 +1,213 @@ +# This file is here for demo purposes only, populated with a small sampling of +# mods. It will eventually be replaced by a nixos-channel that will provide +# derivations for most or all of the mods tracked through the official mod +# manager site. +{ stdenv, fetchurl +, factorio-utils +, allRecommendedMods ? true +, allOptionalMods ? false +}: +with stdenv.lib; +let + modDrv = factorio-utils.modDrv { inherit allRecommendedMods allOptionalMods; }; +in +rec { + + bobassembly = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobassembly_0.13.0.zip + ]; + sha256 = "0c0m7sb45r37g882x0aq8mc82yhfh9j9h8g018d4s5pf93vzr6d1"; + }; + deps = [ boblibrary ]; + optionalDeps = [ bobconfig ]; + recommendedDeps = [ bobplates ]; + }; + + bobconfig = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobconfig_0.13.1.zip + ]; + sha256 = "0z4kmggm1slbr3qiy5xahc9nhdffllp21n9nv5gh1zbzv72sb1rp"; + }; + }; + + bobelectronics = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobelectronics_0.13.1.zip + ]; + sha256 = "16sn5w33s0ckiwqxx7b2pcsqmhxbxjm2w4h4vd99hwpvdpjyav52"; + }; + deps = [ boblibrary ]; + optionalDeps = [ bobconfig ]; + recommendedDeps = [ bobplates ]; + }; + + bobenemies = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobenemies_0.13.1.zip + ]; + sha256 = "1wnb5wsvh9aa3i9mj17f36ybbd13qima3iwshw60i6xkzzqfk44d"; + }; + optionalDeps = [ bobconfig ]; + }; + + bobgreenhouse = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobgreenhouse_0.13.2.zip + ]; + sha256 = "1ql26875dvz2lqln289jg1w6yjzsd0x0pqmd570jffwi5m320rrw"; + }; + deps = [ boblibrary ]; + optionalDeps = [ bobconfig ]; + recommendedDeps = [ bobplates ]; + }; + + bobinserters = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobinserters_0.13.3.zip + ]; + sha256 = "0nys9zhaw0v3w2xzrhawr8g2hcxkzdmyqd4s8xm5bnbrgrq86g9z"; + }; + deps = [ boblibrary ]; + optionalDeps = [ bobconfig ]; + recommendedDeps = [ ]; + }; + + boblibrary = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/boblibrary_0.13.1.zip + ]; + sha256 = "04fybs626lzxf0p21jl8kakh2mddah7l9m57srk7a87jw5bj1zx8"; + }; + }; + + boblogistics = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/boblogistics_0.13.7.zip + ]; + sha256 = "0c91zmyxwsmyv6vm6gp498vb7flqlcyzkbp9s5q1651hpyd378hx"; + }; + deps = [ boblibrary ]; + optionalDeps = [ bobconfig ]; + recommendedDeps = [ bobplates ]; + }; + + bobmining = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobmining_0.13.1.zip + ]; + sha256 = "1l7k3v4aizihppgi802fr5b8zbnq2h05c2bbsk5hds239qgxy80m"; + }; + deps = [ boblibrary ]; + optionalDeps = [ bobconfig bobores bobplates ]; + }; + + bobmodules = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobmodules_0.13.0.zip + ]; + sha256 = "0ggd2gc4s5sbld7gyncbzdgq8gc00mvxjcfv7i2dchcrdzrlr556"; + }; + deps = [ boblibrary ]; + optionalDeps = [ bobconfig ]; + recommendedDeps = [ bobplates bobassembly bobelectronics ]; + }; + + bobores = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobores_0.13.1.zip + ]; + sha256 = "1rri70655kj77sdr3zgp56whmcl0gfjmw90jm7lj1jp8l1pdfzb9"; + }; + deps = [ boblibrary ]; + optionalDeps = [ bobconfig ]; + }; + + bobplates = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobplates_0.13.2.zip + ]; + sha256 = "0iczpa26hflj17k84p4n6wz0pwhbbrfk86dgac4bfz28kqg58nj1"; + }; + deps = [ boblibrary ]; + optionalDeps = [ bobconfig bobenemies ]; + recommendedDeps = [ bobores bobtech ]; + }; + + bobpower = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobpower_0.13.1.zip + ]; + sha256 = "18sblnlvprrm2vzlczlki09yj9lr4y64808zrwmcasf7470skar3"; + }; + deps = [ boblibrary ]; + optionalDeps = [ bobconfig ]; + recommendedDeps = [ bobplates ]; + }; + + bobrevamp = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobrevamp_0.13.0.zip + ]; + sha256 = "0rkyf61clh8fjg72z9i7r4skvdzgd49ky6s0486xxljhbil4nxb7"; + }; + deps = [ boblibrary ]; + }; + + bobtech = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobtech_0.13.0.zip + ]; + sha256 = "0arc9kilxzdpapn3gh5h8269ssgsjxib4ny0qissq2sg95gxlsn0"; + }; + deps = [ boblibrary ]; + optionalDeps = [ bobenemies ]; + }; + + bobtechsave = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobtechsave_0.13.0.zip + ]; + sha256 = "1vlv4sgdfd9ldjm8y79n95ms5k6x2i7khjc422lp9080m03v1hcl"; + }; + }; + + bobwarfare = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/bobwarfare_0.13.4.zip + ]; + sha256 = "07wzn16i4r0qjm41wfyl17rrhry2vrph08a0kq8w5iy6qcbqqfd3"; + }; + deps = [ boblibrary ]; + optionalDeps = [ boblibrary bobplates ]; + recommendedDeps = [ bobtech ]; + }; + + clock = modDrv { + src = fetchurl { + urls = [ + https://f.xor.us/factorio-mods/clock_0.13.0.zip + ]; + sha256 = "0nflywbj6p2kz2w9wff78vskzljrzaf32ib56k3z456d9y8mlxfd"; + }; + }; + +} diff --git a/pkgs/games/factorio/utils.nix b/pkgs/games/factorio/utils.nix new file mode 100644 index 00000000000..563ece6cb9c --- /dev/null +++ b/pkgs/games/factorio/utils.nix @@ -0,0 +1,49 @@ +# This file provides a top-level function that will be used by both nixpkgs and nixos +# to generate mod directories for use at runtime by factorio. +{ stdenv }: +with stdenv.lib; +{ + mkModDirDrv = mods: # a list of mod derivations + let + recursiveDeps = modDrv: [modDrv] ++ optionals (modDrv.deps == []) (map recursiveDeps modDrv.deps); + modDrvs = unique (flatten (map recursiveDeps mods)); + in + stdenv.mkDerivation { + name = "factorio-mod-directory"; + + preferLocalBuild = true; + buildCommand = '' + mkdir -p $out + for modDrv in ${toString modDrvs}; do + # NB: there will only ever be a single zip file in each mod derivation's output dir + ln -s $modDrv/*.zip $out + done + ''; + }; + + modDrv = { allRecommendedMods, allOptionalMods }: + { src + , name ? null + , deps ? [] + , optionalDeps ? [] + , recommendedDeps ? [] + }: stdenv.mkDerivation { + + inherit src; + + # Use the name of the zip, but endstrip ".zip" and possibly the querystring that gets left in by fetchurl + name = replaceStrings ["_"] ["-"] (if name != null then name else removeSuffix ".zip" (head (splitString "?" src.name))); + + deps = deps ++ optionals allOptionalMods optionalDeps + ++ optionals allRecommendedMods recommendedDeps; + + preferLocalBuild = true; + buildCommand = '' + mkdir -p $out + srcBase=$(basename $src) + srcBase=''${srcBase#*-} # strip nix hash + srcBase=''${srcBase%\?*} # strip querystring leftover from fetchurl + cp $src $out/$srcBase + ''; + }; +} diff --git a/pkgs/games/gambatte/default.nix b/pkgs/games/gambatte/default.nix index 969f231deda..dabcfb19db0 100644 --- a/pkgs/games/gambatte/default.nix +++ b/pkgs/games/gambatte/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { buildInputs = [ scons qt4 ]; + patches = [ ./fix-scons-paths.patch ]; + buildPhase = '' ./build_qt.sh ''; diff --git a/pkgs/games/gambatte/fix-scons-paths.patch b/pkgs/games/gambatte/fix-scons-paths.patch new file mode 100644 index 00000000000..ea10ee4163b --- /dev/null +++ b/pkgs/games/gambatte/fix-scons-paths.patch @@ -0,0 +1,15 @@ +diff --git a/libgambatte/SConstruct b/libgambatte/SConstruct +index e882514..87e1eaa 100644 +--- a/libgambatte/SConstruct ++++ b/libgambatte/SConstruct +@@ -5,7 +5,9 @@ vars = Variables() + vars.Add('CC') + vars.Add('CXX') + +-env = Environment(CPPPATH = ['src', 'include', '../common'], ++import os ++env = Environment(ENV = os.environ, ++ CPPPATH = ['src', 'include', '../common'], + CFLAGS = global_cflags + global_defines, + CXXFLAGS = global_cxxflags + global_defines, + variables = vars) diff --git a/pkgs/games/hedgewars/default.nix b/pkgs/games/hedgewars/default.nix index 7d0f59a4e0d..2486d1da470 100644 --- a/pkgs/games/hedgewars/default.nix +++ b/pkgs/games/hedgewars/default.nix @@ -5,7 +5,8 @@ let ghc = ghcWithPackages (pkgs: with pkgs; [ - network vector utf8-string bytestring-show random hslogger dataenc SHA entropy zlib_0_5_4_2 + network vector utf8-string bytestring-show random hslogger + dataenc SHA entropy zlib_0_5_4_2 ]); in stdenv.mkDerivation rec { @@ -21,6 +22,10 @@ stdenv.mkDerivation rec { qt4 ghc ffmpeg freeglut makeWrapper physfs ]; + postPatch = '' + substituteInPlace gameServer/CMakeLists.txt --replace mask evaluate + ''; + preBuild = '' export NIX_LDFLAGS="$NIX_LDFLAGS -rpath ${SDL_image}/lib -rpath ${SDL_mixer}/lib @@ -65,7 +70,7 @@ stdenv.mkDerivation rec { contact with explosions, to zero (the damage dealt to the attacked hedgehog or hedgehogs after a player's or CPU turn is shown only when all movement on the battlefield has ceased).''; - maintainers = with maintainers; [ kragniz ]; + maintainers = with maintainers; [ kragniz fpletz ]; platforms = ghc.meta.platforms; }; } diff --git a/pkgs/games/openttd/default.nix b/pkgs/games/openttd/default.nix index 03f94afd94f..7a7571a9fa5 100644 --- a/pkgs/games/openttd/default.nix +++ b/pkgs/games/openttd/default.nix @@ -21,11 +21,11 @@ let in stdenv.mkDerivation rec { name = "openttd-${version}"; - version = "1.6.0"; + version = "1.6.1"; src = fetchurl { url = "http://binaries.openttd.org/releases/${version}/${name}-source.tar.xz"; - sha256 = "1cjf9gz7d0sn7893wv9d00q724sxv3d81bgb0c5f5ppz2ssyc4jc"; + sha256 = "1ak32fj5xkk2fvmm3g8i7wzmk4bh2ijsp8fzvvw5wj6365p9j24v"; }; nativeBuildInputs = [ pkgconfig ]; @@ -71,7 +71,7 @@ stdenv.mkDerivation rec { ''; homepage = http://www.openttd.org/; license = stdenv.lib.licenses.gpl2; - platforms = stdenv.lib.platforms.unix; + platforms = stdenv.lib.platforms.linux; maintainers = with stdenv.lib.maintainers; [ jcumming the-kenny fpletz ]; }; } diff --git a/pkgs/games/terraria-server/default.nix b/pkgs/games/terraria-server/default.nix index 59dabf2f9cd..5fcb5063bbc 100644 --- a/pkgs/games/terraria-server/default.nix +++ b/pkgs/games/terraria-server/default.nix @@ -16,6 +16,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/bin cp -r Linux $out/ + chmod +x "$out/Linux/TerrariaServer.bin.x86_64" ln -s "$out/Linux/TerrariaServer.bin.x86_64" $out/bin/TerrariaServer # Fix "/lib64/ld-linux-x86-64.so.2" like references in ELF executables. find "$out" | while read filepath; do diff --git a/pkgs/games/vessel/default.nix b/pkgs/games/vessel/default.nix index f85fd267485..34b9a606fb9 100644 --- a/pkgs/games/vessel/default.nix +++ b/pkgs/games/vessel/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { message = goBuyItNow; name = "${name}-bin"; sha256 = "1vpwcrjiln2mx43h7ib3jnccyr3chk7a5x2bw9kb4lw8ycygvg96"; - } else throw "unsupported platform ${stdenv.s:ystem} only i686-linux supported for now."; + } else throw "unsupported platform ${stdenv.system} only i686-linux supported for now."; phases = "installPhase"; ld_preload = ./isatty.c; diff --git a/pkgs/games/xboard/default.nix b/pkgs/games/xboard/default.nix index 8d57b48481e..46d3873659f 100644 --- a/pkgs/games/xboard/default.nix +++ b/pkgs/games/xboard/default.nix @@ -6,11 +6,11 @@ let s = # Generated upstream information rec { baseName="xboard"; - version="4.9.0"; + version="4.9.1"; name="${baseName}-${version}"; - hash="1av6r3s5vyclwf3c9i1pkr2442ryrf4ixhhf2i44a4j1xyhlp5jb"; - url="http://ftp.gnu.org/gnu/xboard/xboard-4.9.0.tar.gz"; - sha256="1av6r3s5vyclwf3c9i1pkr2442ryrf4ixhhf2i44a4j1xyhlp5jb"; + hash="1mkh36xnnacnz9r00b5f9ld9309k32jv6mcavklbdnca8bl56bib"; + url="http://ftp.gnu.org/gnu/xboard/xboard-4.9.1.tar.gz"; + sha256="1mkh36xnnacnz9r00b5f9ld9309k32jv6mcavklbdnca8bl56bib"; }; buildInputs = [ libX11 xproto libXt libXaw libSM libICE libXmu diff --git a/pkgs/games/zod/default.nix b/pkgs/games/zod/default.nix index 9975aa1b15b..d7a0a62f5bd 100644 --- a/pkgs/games/zod/default.nix +++ b/pkgs/games/zod/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { buildInputs = [ unrar unzip SDL SDL_image SDL_ttf SDL_mixer libmysql makeWrapper ]; - NIX_LDFLAGS="-L${libmysql}/lib/mysql"; + NIX_LDFLAGS="-L${stdenv.lib.getLib libmysql}/lib/mysql"; installPhase = '' mkdir -p $out/bin $out/share/zod |