nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, fetchFromGitHub
4, cmake
5, glew
6, freeimage
7, liblockfile
8, openal
9, libtheora
10, SDL2
11, lzo
12, libjpeg
13, libogg
14, pcre
15, makeWrapper
16}:
17
18stdenv.mkDerivation rec {
19 pname = "openxray";
20 version = "1144-december-2021-rc1";
21
22 src = fetchFromGitHub {
23 owner = "OpenXRay";
24 repo = "xray-16";
25 rev = version;
26 fetchSubmodules = true;
27 sha256 = "07qj1lpp21g4p583gvz5h66y2q71ymbsz4g5nr6dcys0vm7ph88v";
28 };
29
30 nativeBuildInputs = [
31 cmake
32 makeWrapper
33 ];
34
35 buildInputs = [
36 glew
37 freeimage
38 liblockfile
39 openal
40 libtheora
41 SDL2
42 lzo
43 libjpeg
44 libogg
45 pcre
46 ];
47
48 # Crashes can happen, we'd like them to be reasonably debuggable
49 cmakeBuildType = "RelWithDebInfo";
50 dontStrip = true;
51
52 postInstall = ''
53 # needed because of SDL_LoadObject library loading code
54 wrapProgram $out/bin/xr_3da \
55 --prefix LD_LIBRARY_PATH : $out/lib
56 '';
57
58 meta = with lib; {
59 mainProgram = "xray-16";
60 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";
61 homepage = "https://github.com/OpenXRay/xray-16/";
62 license = licenses.unfree // {
63 url = "https://github.com/OpenXRay/xray-16/blob/${version}/License.txt";
64 };
65 maintainers = with maintainers; [ OPNA2608 ];
66 platforms = [ "x86_64-linux" "i686-linux" ];
67 };
68}