2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, glew
|
|
|
|
, freeimage
|
|
|
|
, liblockfile
|
|
|
|
, openal
|
|
|
|
, libtheora
|
|
|
|
, SDL2
|
|
|
|
, lzo
|
|
|
|
, libjpeg
|
|
|
|
, libogg
|
|
|
|
, pcre
|
|
|
|
, makeWrapper
|
|
|
|
, enableMultiplayer ? false # Requires old, insecure Crypto++ version
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "1144-december-2021-rc1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenXRay";
|
|
|
|
repo = "xray-16";
|
|
|
|
rev = version;
|
|
|
|
fetchSubmodules = true;
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "07qj1lpp21g4p583gvz5h66y2q71ymbsz4g5nr6dcys0vm7ph88v";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# https://github.com/OpenXRay/xray-16/issues/518
|
2022-06-16 17:23:12 +00:00
|
|
|
ancientCryptopp = stdenv.mkDerivation {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "cryptopp";
|
|
|
|
version = "5.6.5";
|
|
|
|
|
|
|
|
inherit src;
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
sourceRoot = "source/Externals/cryptopp";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
installFlags = [ "PREFIX=${placeholder "out"}" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
dontStrip = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Crypto++, a free C++ class library of cryptographic schemes";
|
|
|
|
homepage = "https://cryptopp.com/";
|
|
|
|
license = with licenses; [ boost publicDomain ];
|
|
|
|
platforms = platforms.all;
|
2022-06-16 17:23:12 +00:00
|
|
|
knownVulnerabilities = [
|
|
|
|
"CVE-2019-14318"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
2022-06-16 17:23:12 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2021-05-20 23:08:51 +00:00
|
|
|
pname = "openxray";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit version src;
|
|
|
|
|
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
|
|
|
|
freeimage
|
|
|
|
liblockfile
|
|
|
|
openal
|
|
|
|
libtheora
|
|
|
|
SDL2
|
|
|
|
lzo
|
|
|
|
libjpeg
|
|
|
|
libogg
|
|
|
|
pcre
|
|
|
|
] ++ lib.optionals enableMultiplayer [
|
|
|
|
ancientCryptopp
|
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
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_CRYPTOPP=${if enableMultiplayer then "ON" else "OFF"}"
|
|
|
|
] ++ lib.optionals enableMultiplayer [
|
|
|
|
"-DCMAKE_INCLUDE_PATH=${ancientCryptopp}/include/cryptopp"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# needed because of SDL_LoadObject library loading code
|
|
|
|
wrapProgram $out/bin/xr_3da \
|
|
|
|
--prefix LD_LIBRARY_PATH : $out/lib
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
mainProgram = "xray-16";
|
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 // {
|
|
|
|
url = "https://github.com/OpenXRay/xray-16/blob/xd_dev/License.txt";
|
|
|
|
};
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with maintainers; [ OPNA2608 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
};
|
|
|
|
}
|