2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2024-01-25 14:12:00 +00:00
|
|
|
, gitUpdater
|
2022-06-16 17:23:12 +00:00
|
|
|
, cmake
|
|
|
|
, glew
|
|
|
|
, liblockfile
|
|
|
|
, openal
|
|
|
|
, libtheora
|
|
|
|
, SDL2
|
|
|
|
, lzo
|
|
|
|
, libjpeg
|
|
|
|
, libogg
|
|
|
|
, pcre
|
|
|
|
, makeWrapper
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-08-12 12:06:08 +00:00
|
|
|
pname = "openxray";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "2188-november-2023-rc1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenXRay";
|
|
|
|
repo = "xray-16";
|
2024-01-25 14:12:00 +00:00
|
|
|
rev = finalAttrs.version;
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-rRxw/uThACmT2qI8NUwJU+WbJ3BWUss6CH13R5aaHco=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
makeWrapper
|
2020-11-30 08:33:03 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
glew
|
|
|
|
liblockfile
|
|
|
|
openal
|
|
|
|
libtheora
|
|
|
|
SDL2
|
|
|
|
lzo
|
|
|
|
libjpeg
|
|
|
|
libogg
|
|
|
|
pcre
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# Crashes can happen, we'd like them to be reasonably debuggable
|
|
|
|
cmakeBuildType = "RelWithDebInfo";
|
|
|
|
dontStrip = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
# 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 ''
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapProgram $out/bin/xr_3da \
|
2024-01-25 14:12:00 +00:00
|
|
|
--run 'export LC_ALL=C'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
# dlopens its own libraries, relies on rpath not having its prefix stripped
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
|
|
|
passthru.updateScript = gitUpdater { };
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-01-25 14:12:00 +00:00
|
|
|
mainProgram = "xr_3da";
|
2020-12-25 13:55:36 +00:00
|
|
|
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";
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://github.com/OpenXRay/xray-16/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.unfree // {
|
2024-05-15 15:35:15 +00:00
|
|
|
url = "https://github.com/OpenXRay/xray-16/blob/${finalAttrs.version}/License.txt";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with maintainers; [ OPNA2608 ];
|
2024-01-25 14:12:00 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-01-25 14:12:00 +00:00
|
|
|
})
|