armagetronad."0.4": fix installCheckPhase requiring an X server

+12 -3
+12 -3
pkgs/games/armagetronad/default.nix
··· 21 , libpng 22 , libxml2 23 , protobuf 24 , dedicatedServer ? false 25 }: 26 ··· 61 extraBuildInputs = [ protobuf boost ] 62 ++ lib.optionals (!dedicatedServer) [ glew ftgl freetype SDL2 SDL2_image SDL2_mixer ]; 63 extraNativeBuildInputs = [ bison ]; 64 }; 65 66 # https://gitlab.com/armagetronad/armagetronad/-/commits/hack-0.2.8-sty+ct+ap/?ref_type=heads ··· 134 nativeBuildInputs = [ autoconf automake gnum4 pkg-config which python3 ] 135 ++ (resolvedParams.extraNativeBuildInputs or []); 136 137 postInstall = lib.optionalString (!dedicatedServer) '' 138 mkdir -p $out/share/{applications,icons/hicolor} 139 ln -s $out/share/games/armagetronad/desktop/armagetronad*.desktop $out/share/applications/ ··· 145 installCheckPhase = '' 146 export XDG_RUNTIME_DIR=/tmp 147 bin="$out/bin/${mainProgram}" 148 - version="$("$bin" --version || true)" 149 - prefix="$("$bin" --prefix || true)" 150 - rubber="$("$bin" --doc | grep -m1 CYCLE_RUBBER)" 151 152 echo "Version: $version" >&2 153 echo "Prefix: $prefix" >&2
··· 21 , libpng 22 , libxml2 23 , protobuf 24 + , xvfb-run 25 , dedicatedServer ? false 26 }: 27 ··· 62 extraBuildInputs = [ protobuf boost ] 63 ++ lib.optionals (!dedicatedServer) [ glew ftgl freetype SDL2 SDL2_image SDL2_mixer ]; 64 extraNativeBuildInputs = [ bison ]; 65 + extraNativeInstallCheckInputs = lib.optionals (!dedicatedServer) [ xvfb-run ]; 66 }; 67 68 # https://gitlab.com/armagetronad/armagetronad/-/commits/hack-0.2.8-sty+ct+ap/?ref_type=heads ··· 136 nativeBuildInputs = [ autoconf automake gnum4 pkg-config which python3 ] 137 ++ (resolvedParams.extraNativeBuildInputs or []); 138 139 + nativeInstallCheckInputs = resolvedParams.extraNativeInstallCheckInputs or []; 140 + 141 postInstall = lib.optionalString (!dedicatedServer) '' 142 mkdir -p $out/share/{applications,icons/hicolor} 143 ln -s $out/share/games/armagetronad/desktop/armagetronad*.desktop $out/share/applications/ ··· 149 installCheckPhase = '' 150 export XDG_RUNTIME_DIR=/tmp 151 bin="$out/bin/${mainProgram}" 152 + if command -v xvfb-run &>/dev/null; then 153 + run="xvfb-run $bin" 154 + else 155 + run="$bin" 156 + fi 157 + version="$($run --version || true)" 158 + prefix="$($run --prefix || true)" 159 + rubber="$($run --doc | grep -m1 CYCLE_RUBBER)" 160 161 echo "Version: $version" >&2 162 echo "Prefix: $prefix" >&2