8 , extraBuildInputs ? [ ]
17 launcher = writeShellScript "${pname}" ''
19 assetDir="''${XDG_DATA_HOME:-$HOME/.local/share}/${pname}"
20 [ -d "$assetDir" ] || mkdir -p "$assetDir"
24 requiredFiles=(master.dat critter.dat)
25 for f in "''${requiredFiles[@]}"; do
26 if [ ! -f "$f" ]; then
27 echo "Required file $f not found in $PWD, note the files are case-sensitive"
32 if [ ! -d "data/sound/music" ]; then
33 echo "data/sound/music directory not found in $PWD. This may prevent in-game music from functioning."
37 if [ $notice -ne 0 ]; then
38 echo "Please reference the installation instructions at https://github.com/alexbatalov/fallout2-ce"
41 if [ $fault -ne 0 ]; then
45 exec @out@/libexec/${pname} "$@"
49 inherit pname version src patches;
51 nativeBuildInputs = [ cmake ];
52 buildInputs = [ SDL2 ] ++ extraBuildInputs;
53 hardeningDisable = [ "format" ];
54 cmakeBuildType = "RelWithDebInfo";
57 substituteInPlace third_party/fpattern/CMakeLists.txt \
58 --replace "FetchContent_Populate" "#FetchContent_Populate" \
59 --replace "{fpattern_SOURCE_DIR}" "${fpattern}/include" \
60 --replace "$/nix/" "/nix/"
66 install -D ${pname} $out/libexec/${pname}
67 install -D ${launcher} $out/bin/${pname}
68 substituteInPlace $out/bin/${pname} --subst-var out
74 license = licenses.sustainableUse;
75 maintainers = with maintainers; [ hughobrien ];
76 platforms = platforms.linux;