nixpkgs/pkgs/games/iortcw/default.nix
Naïm Favier 9160044f5f
treewide/makeWrapper: replace --run cd with --chdir
Lay the groundwork for switching to binary wrappers by reducing uses
of `--run` (which is not supported by `makeBinaryWrapper`).
2022-03-19 09:46:31 +01:00

28 lines
604 B
Nix

{ buildEnv, callPackage, makeWrapper }:
let
sp = callPackage ./sp.nix {};
mp = sp.overrideAttrs (oldAttrs: rec {
sourceRoot = "source/MP";
});
in buildEnv {
name = "iortcw";
paths = [ sp mp ];
pathsToLink = [ "/opt" ];
nativeBuildInputs = [ makeWrapper ];
# so we can launch sp from mp game and vice versa
postBuild = ''
for i in `find -L $out/opt/iortcw -maxdepth 1 -type f -executable`; do
makeWrapper $i $out/bin/`basename $i` --chdir "$out/opt/iortcw"
done
'';
meta = sp.meta // {
description = "Game engine for Return to Castle Wolfenstein";
};
}