2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, SDL2
|
|
|
|
, SDL2_mixer
|
|
|
|
, freetype
|
|
|
|
, libGL
|
|
|
|
, libiconv
|
|
|
|
, libpng
|
|
|
|
, libvlc
|
|
|
|
, libvorbis
|
|
|
|
, openal
|
2022-09-30 11:47:45 +00:00
|
|
|
, python3
|
2021-06-28 23:13:55 +00:00
|
|
|
, zlib
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
let
|
|
|
|
# the GLES backend on rpi is untested as I don't have the hardware
|
|
|
|
backend =
|
2022-08-12 12:06:08 +00:00
|
|
|
if stdenv.hostPlatform.isx86 then "OpenGL" else "GLES";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2021-07-03 03:11:41 +00:00
|
|
|
withVLC = stdenv.isDarwin;
|
|
|
|
|
|
|
|
inherit (lib) optional optionalString;
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gemrb";
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "0.9.1.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-09-25 04:45:31 +00:00
|
|
|
owner = "gemrb";
|
|
|
|
repo = "gemrb";
|
|
|
|
rev = "v${version}";
|
2022-10-21 18:38:19 +00:00
|
|
|
hash = "sha256-pC83LgAy1aQxUhS2qa57hm03B37bj6dcRVRn7SI5I+k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
SDL2_mixer
|
|
|
|
freetype
|
|
|
|
libGL
|
|
|
|
libiconv
|
|
|
|
libpng
|
|
|
|
libvorbis
|
|
|
|
openal
|
2022-09-30 11:47:45 +00:00
|
|
|
python3
|
2021-06-28 23:13:55 +00:00
|
|
|
zlib
|
2021-07-03 03:11:41 +00:00
|
|
|
]
|
|
|
|
++ optional withVLC libvlc;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2021-07-03 03:11:41 +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-28 23:13:55 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
cmakeFlags = [
|
2021-07-03 03:11:41 +00:00
|
|
|
"-DDATA_DIR=${placeholder "out"}/share/gemrb"
|
|
|
|
"-DEXAMPLE_CONF_DIR=${placeholder "out"}/share/doc/gemrb/examples"
|
|
|
|
"-DSYSCONF_DIR=/etc"
|
2021-06-28 23:13:55 +00:00
|
|
|
# use the Mesa drivers for video on ARM (harmless on x86)
|
|
|
|
"-DDISABLE_VIDEOCORE=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DLAYOUT=opt"
|
2021-06-28 23:13:55 +00:00
|
|
|
"-DOPENGL_BACKEND=${backend}"
|
|
|
|
"-DOpenGL_GL_PREFERENCE=GLVND"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +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-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A reimplementation of the Infinity Engine, used by games such as Baldur's Gate";
|
|
|
|
longDescription = ''
|
|
|
|
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).
|
|
|
|
'';
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://gemrb.org/";
|
2021-06-28 23:13:55 +00:00
|
|
|
license = licenses.gpl2Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
|
|
|
};
|
|
|
|
}
|