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 19:19:00 +00:00
|
|
|
|
2019-11-19 14:32:11 +00:00
|
|
|
let
|
2021-05-07 07:19:32 +00:00
|
|
|
version = "822-december-preview";
|
2019-10-03 19:19:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OpenXRay";
|
|
|
|
repo = "xray-16";
|
|
|
|
rev = version;
|
|
|
|
fetchSubmodules = true;
|
2021-05-07 07:19:32 +00:00
|
|
|
sha256 = "06f3zjnib7hipyl3hnc6mwcj9f50kbwn522wzdjydz8qgdg60h3m";
|
2019-10-03 19:19:00 +00:00
|
|
|
};
|
|
|
|
|
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;
|
|
|
|
|
2021-05-07 07:19:32 +00:00
|
|
|
sourceRoot = "source/Externals/cryptopp";
|
2019-11-19 14:32:11 +00:00
|
|
|
|
|
|
|
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 {
|
2021-05-07 07:19:32 +00:00
|
|
|
pname = "openxray";
|
2019-11-19 14:32:11 +00:00
|
|
|
inherit version src;
|
|
|
|
|
2021-05-07 07:19:32 +00:00
|
|
|
# TODO https://github.com/OpenXRay/GameSpy/pull/6, check if merged in version > 822
|
|
|
|
# Fixes format hardening
|
2020-11-29 09:47:58 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
2021-05-07 07:19:32 +00:00
|
|
|
url = "https://github.com/OpenXRay/GameSpy/pull/6/commits/155af876281f5d94f0142886693314d97deb2d4c.patch";
|
|
|
|
sha256 = "1l0vcgvzzx8n56shpblpfdhvpr6c12fcqf35r0mflaiql8q7wn88";
|
|
|
|
stripLen = 1;
|
|
|
|
extraPrefix = "Externals/GameSpy/";
|
2020-11-29 09:47:58 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-05-07 07:19:32 +00:00
|
|
|
cmakeFlags = [ "-DCMAKE_INCLUDE_PATH=${cryptopp}/include/cryptopp" ];
|
|
|
|
|
2019-10-03 19:19:00 +00:00
|
|
|
buildInputs = [
|
|
|
|
glew freeimage liblockfile openal cryptopp libtheora SDL2 lzo
|
|
|
|
libjpeg libogg tbb pcre
|
|
|
|
];
|
2021-05-07 07:19:32 +00:00
|
|
|
|
2019-10-03 19:19:00 +00:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper ];
|
|
|
|
|
2021-05-07 07:19:32 +00:00
|
|
|
# https://github.com/OpenXRay/xray-16/issues/786
|
2019-10-03 19:19:00 +00:00
|
|
|
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 19:19:00 +00:00
|
|
|
homepage = src.meta.homepage;
|
|
|
|
license = licenses.unfree // {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "https://github.com/OpenXRay/xray-16/blob/xd_dev/License.txt";
|
2019-10-03 19:19:00 +00:00
|
|
|
};
|
2021-05-07 07:19:32 +00:00
|
|
|
maintainers = with maintainers; [ OPNA2608 ];
|
2019-11-19 14:32:11 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
2019-10-03 19:19:00 +00:00
|
|
|
};
|
|
|
|
}
|