2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, glew, freeimage, liblockfile
|
2019-11-19 14:32:11 +00:00
|
|
|
, openal, libtheora, SDL2, lzo, libjpeg, libogg, tbb
|
2020-11-29 09:47:58 +00:00
|
|
|
, pcre, makeWrapper, fetchpatch }:
|
2019-10-03 20:19:00 +01:00
|
|
|
|
2019-11-19 14:32:11 +00:00
|
|
|
let
|
2020-11-02 17:58:14 +00:00
|
|
|
version = "784-october-preview";
|
2019-10-03 20:19:00 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenXRay";
|
|
|
|
repo = "xray-16";
|
|
|
|
rev = version;
|
2020-11-02 17:58:14 +00:00
|
|
|
sha256 = "0q0h70gbpscdvn45wpxicljj4ji3cd2maijd5b7jhr1695h61q5y";
|
2019-10-03 20:19:00 +01:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2019-11-19 14:32:11 +00:00
|
|
|
# https://github.com/OpenXRay/xray-16/issues/518
|
|
|
|
cryptopp = stdenv.mkDerivation {
|
|
|
|
pname = "cryptopp";
|
|
|
|
version = "5.6.5";
|
|
|
|
|
|
|
|
inherit src;
|
|
|
|
|
|
|
|
postUnpack = "sourceRoot+=/Externals/cryptopp";
|
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=${placeholder "out"}" ];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-11-19 14:32:11 +00:00
|
|
|
description = "Crypto++, a free C++ class library of cryptographic schemes";
|
|
|
|
homepage = "https://cryptopp.com/";
|
|
|
|
license = with licenses; [ boost publicDomain ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "OpenXRay";
|
|
|
|
inherit version src;
|
|
|
|
|
2019-10-03 20:19:00 +01:00
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
cmakeFlags = [ "-DCMAKE_INCLUDE_PATH=${cryptopp}/include/cryptopp" ];
|
|
|
|
|
2020-11-29 09:47:58 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/OpenXRay/xray-16/commit/4532cba11e98808c92e56e246188863261ef9201.patch";
|
|
|
|
sha256 = "1hrm4rkkg946ai95krzpf3isryzbb2vips63gxf481plv4vlcfc9";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-10-03 20:19:00 +01:00
|
|
|
buildInputs = [
|
|
|
|
glew freeimage liblockfile openal cryptopp libtheora SDL2 lzo
|
|
|
|
libjpeg libogg tbb pcre
|
|
|
|
];
|
|
|
|
nativeBuildInputs = [ cmake makeWrapper ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace src/xrCore/xrCore.cpp \
|
|
|
|
--replace /usr/share $out/share
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# needed because of SDL_LoadObject library loading code
|
|
|
|
wrapProgram $out/bin/xr_3da \
|
|
|
|
--prefix LD_LIBRARY_PATH : $out/lib
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-12-09 11:58:04 +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";
|
2019-10-03 20:19:00 +01:00
|
|
|
homepage = src.meta.homepage;
|
|
|
|
license = licenses.unfree // {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "https://github.com/OpenXRay/xray-16/blob/xd_dev/License.txt";
|
2019-10-03 20:19:00 +01:00
|
|
|
};
|
|
|
|
maintainers = [ maintainers.gnidorah ];
|
2019-11-19 14:32:11 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
2019-10-03 20:19:00 +01:00
|
|
|
};
|
|
|
|
}
|