Skip to content

Commit

Permalink
Merge pull request NixOS#244426 from OPNA2608/update/openxray
Browse files Browse the repository at this point in the history
openxray: 1144-december-2021-rc1 -> 2188-november-2023-rc1
  • Loading branch information
Mindavi committed Jan 15, 2024
2 parents fcb7c27 + 362aba4 commit 031182b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
32 changes: 20 additions & 12 deletions pkgs/games/openxray/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ lib
, stdenv
, fetchFromGitHub
, gitUpdater
, cmake
, glew
, freeimage
, liblockfile
, openal
, libtheora
Expand All @@ -15,26 +15,27 @@
, makeWrapper
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "openxray";
version = "1144-december-2021-rc1";
version = "2188-november-2023-rc1";

src = fetchFromGitHub {
owner = "OpenXRay";
repo = "xray-16";
rev = version;
rev = finalAttrs.version;
fetchSubmodules = true;
sha256 = "07qj1lpp21g4p583gvz5h66y2q71ymbsz4g5nr6dcys0vm7ph88v";
hash = "sha256-rRxw/uThACmT2qI8NUwJU+WbJ3BWUss6CH13R5aaHco=";
};

strictDeps = true;

nativeBuildInputs = [
cmake
makeWrapper
];

buildInputs = [
glew
freeimage
liblockfile
openal
libtheora
Expand All @@ -49,20 +50,27 @@ stdenv.mkDerivation rec {
cmakeBuildType = "RelWithDebInfo";
dontStrip = true;

postInstall = ''
# needed because of SDL_LoadObject library loading code
# 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 ''
wrapProgram $out/bin/xr_3da \
--prefix LD_LIBRARY_PATH : $out/lib
--run 'export LC_ALL=C'
'';

# dlopens its own libraries, relies on rpath not having its prefix stripped
dontPatchELF = true;

passthru.updateScript = gitUpdater { };

meta = with lib; {
mainProgram = "xray-16";
mainProgram = "xr_3da";
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";
homepage = "https://github.com/OpenXRay/xray-16/";
license = licenses.unfree // {
url = "https://github.com/OpenXRay/xray-16/blob/${version}/License.txt";
};
maintainers = with maintainers; [ OPNA2608 ];
platforms = [ "x86_64-linux" "i686-linux" ];
platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
};
}
})
6 changes: 5 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38074,7 +38074,11 @@ with pkgs;

openxcom = callPackage ../games/openxcom { SDL = SDL_compat; };

openxray = callPackage ../games/openxray { };
openxray = callPackage ../games/openxray {
# Builds with Clang, but hits an assertion failure unless GCC is used
# https://github.com/OpenXRay/xray-16/issues/1224
stdenv = gccStdenv;
};

orthorobot = callPackage ../games/orthorobot { love = love_0_10; };

Expand Down

0 comments on commit 031182b

Please sign in to comment.