nixpkgs/pkgs/games/openxray/default.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

84 lines
1.8 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
gitUpdater,
cmake,
glew,
liblockfile,
openal,
libtheora,
SDL2,
lzo,
libjpeg,
libogg,
pcre,
makeWrapper,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "openxray";
version = "2188-november-2023-rc1";
src = fetchFromGitHub {
owner = "OpenXRay";
repo = "xray-16";
rev = finalAttrs.version;
fetchSubmodules = true;
hash = "sha256-rRxw/uThACmT2qI8NUwJU+WbJ3BWUss6CH13R5aaHco=";
};
strictDeps = true;
nativeBuildInputs = [
cmake
makeWrapper
];
buildInputs = [
glew
liblockfile
openal
libtheora
SDL2
lzo
libjpeg
libogg
pcre
];
# Crashes can happen, we'd like them to be reasonably debuggable
cmakeBuildType = "RelWithDebInfo";
dontStrip = true;
# Because we work around https://github.com/OpenXRay/xray-16/issues/1224 by using GCC,
# we need a followup workaround for Darwin locale stuff when using GCC:
# runtime error: locale::facet::_S_create_c_locale name not valid
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
wrapProgram $out/bin/xr_3da \
--run 'export LC_ALL=C'
'';
# dlopens its own libraries, relies on rpath not having its prefix stripped
dontPatchELF = true;
passthru.updateScript = gitUpdater { };
meta = with lib; {
mainProgram = "xr_3da";
description = "Improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World";
homepage = "https://github.com/OpenXRay/xray-16/";
license = licenses.unfree // {
url = "https://github.com/OpenXRay/xray-16/blob/${finalAttrs.version}/License.txt";
};
maintainers = with maintainers; [ OPNA2608 ];
platforms = [
"x86_64-linux"
"i686-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
};
})