2021-06-21 11:53:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, SDL2
|
|
|
|
, SDL2_mixer
|
|
|
|
, freetype
|
|
|
|
, libGL
|
|
|
|
, libiconv
|
|
|
|
, libpng
|
|
|
|
, libvlc
|
|
|
|
, libvorbis
|
|
|
|
, openal
|
2022-08-30 03:00:28 +00:00
|
|
|
, python3
|
2021-06-21 11:53:18 +00:00
|
|
|
, zlib
|
|
|
|
}:
|
2010-08-01 15:14:33 +00:00
|
|
|
|
2021-06-21 11:53:18 +00:00
|
|
|
let
|
|
|
|
# the GLES backend on rpi is untested as I don't have the hardware
|
|
|
|
backend =
|
2022-07-30 16:21:10 +00:00
|
|
|
if stdenv.hostPlatform.isx86 then "OpenGL" else "GLES";
|
2021-06-21 11:53:18 +00:00
|
|
|
|
2021-06-27 05:38:33 +00:00
|
|
|
withVLC = stdenv.isDarwin;
|
|
|
|
|
|
|
|
inherit (lib) optional optionalString;
|
|
|
|
|
2021-06-21 11:53:18 +00:00
|
|
|
in
|
2010-08-01 14:24:46 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "gemrb";
|
2023-07-13 04:38:22 +00:00
|
|
|
version = "0.9.2";
|
2017-11-29 08:26:27 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-08-30 03:45:31 +00:00
|
|
|
owner = "gemrb";
|
|
|
|
repo = "gemrb";
|
|
|
|
rev = "v${version}";
|
2023-07-13 04:38:22 +00:00
|
|
|
hash = "sha256-riea48Jc9zYb19mf5sBunTp5l27PGRFd/B5KdCUWr6Y=";
|
2007-05-14 21:47:11 +00:00
|
|
|
};
|
|
|
|
|
2021-06-21 11:53:18 +00:00
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
SDL2_mixer
|
|
|
|
freetype
|
|
|
|
libGL
|
|
|
|
libiconv
|
|
|
|
libpng
|
|
|
|
libvorbis
|
|
|
|
openal
|
2022-08-30 03:00:28 +00:00
|
|
|
python3
|
2021-06-21 11:53:18 +00:00
|
|
|
zlib
|
2021-06-27 05:38:33 +00:00
|
|
|
]
|
|
|
|
++ optional withVLC libvlc;
|
2007-05-14 21:47:11 +00:00
|
|
|
|
2017-11-29 08:26:27 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2010-08-01 14:24:46 +00:00
|
|
|
|
2021-06-27 05:38:33 +00:00
|
|
|
# libvlc isn't being detected properly as of 0.9.0, so set it
|
|
|
|
LIBVLC_INCLUDE_PATH = optionalString withVLC "${lib.getDev libvlc}/include";
|
|
|
|
LIBVLC_LIBRARY_PATH = optionalString withVLC "${lib.getLib libvlc}/lib";
|
2021-06-21 11:53:18 +00:00
|
|
|
|
2017-11-29 08:26:27 +00:00
|
|
|
cmakeFlags = [
|
2021-06-27 05:38:33 +00:00
|
|
|
"-DDATA_DIR=${placeholder "out"}/share/gemrb"
|
|
|
|
"-DEXAMPLE_CONF_DIR=${placeholder "out"}/share/doc/gemrb/examples"
|
|
|
|
"-DSYSCONF_DIR=/etc"
|
2021-06-21 11:53:18 +00:00
|
|
|
# use the Mesa drivers for video on ARM (harmless on x86)
|
|
|
|
"-DDISABLE_VIDEOCORE=ON"
|
2017-11-29 08:26:27 +00:00
|
|
|
"-DLAYOUT=opt"
|
2021-06-21 11:53:18 +00:00
|
|
|
"-DOPENGL_BACKEND=${backend}"
|
|
|
|
"-DOpenGL_GL_PREFERENCE=GLVND"
|
2017-11-29 08:26:27 +00:00
|
|
|
];
|
2014-08-24 14:50:59 +00:00
|
|
|
|
2021-06-21 11:53:18 +00:00
|
|
|
postInstall = ''
|
|
|
|
for s in 36 48 72 96 144; do
|
|
|
|
install -Dm444 ../artwork/gemrb-logo-glow-''${s}px.png $out/share/icons/hicolor/''${s}x''${s}/gemrb.png
|
|
|
|
done
|
|
|
|
install -Dm444 ../artwork/gemrb-logo.png $out/share/icons/gemrb.png
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2009-03-03 13:27:40 +00:00
|
|
|
description = "Reimplementation of the Infinity Engine, used by games such as Baldur's Gate";
|
2014-08-24 14:50:59 +00:00
|
|
|
longDescription = ''
|
2017-11-29 08:26:27 +00:00
|
|
|
GemRB (Game engine made with pre-Rendered Background) is a portable
|
|
|
|
open-source implementation of Bioware's Infinity Engine. It was written to
|
|
|
|
support pseudo-3D role playing games based on the Dungeons & Dragons
|
|
|
|
ruleset (Baldur's Gate and Icewind Dale series, Planescape: Torment).
|
2014-08-24 14:50:59 +00:00
|
|
|
'';
|
2020-10-02 07:58:50 +00:00
|
|
|
homepage = "https://gemrb.org/";
|
2021-06-21 11:53:18 +00:00
|
|
|
license = licenses.gpl2Only;
|
2017-12-05 22:20:11 +00:00
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
2007-05-14 21:47:11 +00:00
|
|
|
};
|
|
|
|
}
|