diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2018-10-17 08:04:22 +0200 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2018-10-17 08:04:22 +0200 |
commit | 18fcc337affa09238a42e9a0ca21e08363c65eeb (patch) | |
tree | ddab7a25b417b95e708f33752b70327f5acaf55a /pkgs/games | |
parent | 71f67f178df91c42ff230c41ab724dd3a90a5bb5 (diff) | |
parent | 1ba50fe163b03b4e1083c8baaa112c827f5197ab (diff) | |
download | nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.tar nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.tar.gz nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.tar.bz2 nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.tar.lz nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.tar.xz nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.tar.zst nixlib-18fcc337affa09238a42e9a0ca21e08363c65eeb.zip |
Merge master into staging-next
Diffstat (limited to 'pkgs/games')
-rw-r--r-- | pkgs/games/dwarf-fortress/wrapper/default.nix | 65 | ||||
-rw-r--r-- | pkgs/games/steam/runtime-wrapped.nix | 1 | ||||
-rw-r--r-- | pkgs/games/teeworlds/default.nix | 57 |
3 files changed, 51 insertions, 72 deletions
diff --git a/pkgs/games/dwarf-fortress/wrapper/default.nix b/pkgs/games/dwarf-fortress/wrapper/default.nix index 8d9f06ffe143..058bb5f72ae6 100644 --- a/pkgs/games/dwarf-fortress/wrapper/default.nix +++ b/pkgs/games/dwarf-fortress/wrapper/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, buildEnv, substituteAll +{ stdenv, lib, buildEnv, substituteAll, runCommand , dwarf-fortress, dwarf-fortress-unfuck , dwarf-therapist , enableDFHack ? false, dfhack @@ -33,44 +33,41 @@ let ++ lib.optional enableTWBT twbt.art ++ [ dwarf-fortress ]; + fixup = lib.singleton (runCommand "fixup" {} '' + mkdir -p $out/data/init + cp ${dwarf-fortress}/data/init/init.txt $out/data/init/init.txt + '' + lib.optionalString enableDFHack '' + mkdir -p $out/hack + + # Patch the MD5 + orig_md5=$(cat "${dwarf-fortress}/hash.md5.orig") + patched_md5=$(cat "${dwarf-fortress}/hash.md5") + input_file="${dfhack_}/hack/symbols.xml" + output_file="$out/hack/symbols.xml" + + echo "[DFHack Wrapper] Fixing Dwarf Fortress MD5:" + echo " Input: $input_file" + echo " Search: $orig_md5" + echo " Output: $output_file" + echo " Replace: $patched_md5" + + substitute "$input_file" "$output_file" --replace "$orig_md5" "$patched_md5" + '' + lib.optionalString enableTWBT '' + substituteInPlace $out/data/init/init.txt \ + --replace '[PRINT_MODE:2D]' '[PRINT_MODE:TWBT]' + '' + '' + substituteInPlace $out/data/init/init.txt \ + --replace '[INTRO:YES]' '[INTRO:${unBool enableIntro}]' \ + --replace '[TRUETYPE:YES]' '[TRUETYPE:${unBool enableTruetype}]' \ + --replace '[FPS:NO]' '[FPS:${unBool enableFPS}]' + ''); + env = buildEnv { name = "dwarf-fortress-env-${dwarf-fortress.dfVersion}"; - paths = themePkg ++ pkgs; + paths = fixup ++ themePkg ++ pkgs; pathsToLink = [ "/" "/hack" "/hack/scripts" ]; - postBuild = '' - # De-symlink init.txt - cp $out/data/init/init.txt init.txt - rm -f $out/data/init/init.txt - mv init.txt $out/data/init/init.txt - '' + lib.optionalString enableDFHack '' - # De-symlink symbols.xml - rm $out/hack/symbols.xml - - # Patch the MD5 - orig_md5=$(cat "${dwarf-fortress}/hash.md5.orig") - patched_md5=$(cat "${dwarf-fortress}/hash.md5") - input_file="${dfhack_}/hack/symbols.xml" - output_file="$out/hack/symbols.xml" - - echo "[DFHack Wrapper] Fixing Dwarf Fortress MD5:" - echo " Input: $input_file" - echo " Search: $orig_md5" - echo " Output: $output_file" - echo " Replace: $patched_md5" - - substitute "$input_file" "$output_file" --replace "$orig_md5" "$patched_md5" - '' + lib.optionalString enableTWBT '' - substituteInPlace $out/data/init/init.txt \ - --replace '[PRINT_MODE:2D]' '[PRINT_MODE:TWBT]' - '' + '' - substituteInPlace $out/data/init/init.txt \ - --replace '[INTRO:YES]' '[INTRO:${unBool enableIntro}]' \ - --replace '[TRUETYPE:YES]' '[TRUETYPE:${unBool enableTruetype}]' \ - --replace '[FPS:NO]' '[FPS:${unBool enableFPS}]' - ''; - ignoreCollisions = true; }; in diff --git a/pkgs/games/steam/runtime-wrapped.nix b/pkgs/games/steam/runtime-wrapped.nix index a0ed5aaf210c..1cde38058e7c 100644 --- a/pkgs/games/steam/runtime-wrapped.nix +++ b/pkgs/games/steam/runtime-wrapped.nix @@ -14,6 +14,7 @@ let gcc.cc nss nspr + xorg.libxcb ]); allPkgs = overridePkgs ++ [ steam-runtime ]; diff --git a/pkgs/games/teeworlds/default.nix b/pkgs/games/teeworlds/default.nix index 7c5074c07085..58b04821e129 100644 --- a/pkgs/games/teeworlds/default.nix +++ b/pkgs/games/teeworlds/default.nix @@ -1,54 +1,35 @@ -{ fetchurl, stdenv, makeWrapper, python, alsaLib -, libX11, libGLU, SDL, lua5, zlib, bam, freetype +{ fetchurl, stdenv, cmake, pkgconfig, makeWrapper, python, alsaLib +, libX11, libGLU, SDL, lua5, zlib, freetype, wavpack }: stdenv.mkDerivation rec { - name = "teeworlds-0.6.4"; + name = "teeworlds-0.6.5"; src = fetchurl { - url = "https://downloads.teeworlds.com/teeworlds-0.6.4-src.tar.gz"; - sha256 = "1qlqzp4wqh1vnip081lbsjnx5jj5m5y4msrcm8glbd80pfgd2qf2"; + url = "https://downloads.teeworlds.com/teeworlds-0.6.5-src.tar.gz"; + sha256 = "07llxjc47d1gd9jqj3vf08cmw26ha6189mwcix1khwa3frfbilqb"; }; - # we always want to use system libs instead of these - postPatch = "rm -r other/{freetype,sdl}/{include,lib32,lib64}"; + postPatch = '' + # we always want to use system libs instead of these + rm -r other/{freetype,sdl}/{include,mac,windows} - buildInputs = [ - python makeWrapper alsaLib libX11 libGLU SDL lua5 zlib bam freetype - ]; - - buildPhase = '' - bam -a -v release + # set compiled-in DATA_DIR so resources can be found + substituteInPlace src/engine/shared/storage.cpp \ + --replace '#define DATA_DIR "data"' \ + '#define DATA_DIR "${placeholder "out"}/share/teeworlds/data"' ''; - installPhase = '' - # Copy the graphics, sounds, etc. - mkdir -p "$out/share/${name}" - cp -rv data other/icons "$out/share/${name}" + nativeBuildInputs = [ cmake pkgconfig ]; - # Copy the executables (client, server, etc.). - mkdir -p "$out/bin" - executables="" - for file in * - do - if [ -f "$file" ] && [ -x "$file" ] - then - executables="$file $executables" - fi - done - cp -v $executables "$out/bin" - # Make sure the programs are executed from the right directory so - # that they can access the graphics and sounds. - for program in $executables - do - wrapProgram $out/bin/$program \ - --run "cd $out/share/${name}" - done + buildInputs = [ + python alsaLib libX11 libGLU SDL lua5 zlib freetype wavpack + ]; - # Copy the documentation. - mkdir -p "$out/doc/${name}" - cp -v *.txt "$out/doc/${name}" + postInstall = '' + mkdir -p $out/share/doc/teeworlds + cp -v *.txt $out/share/doc/teeworlds/ ''; meta = { |