2021-06-21 12:53:18 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, SDL2
|
|
|
|
, SDL2_mixer
|
|
|
|
, freetype
|
|
|
|
, libGL
|
|
|
|
, libiconv
|
|
|
|
, libpng
|
|
|
|
, libvlc
|
|
|
|
, libvorbis
|
|
|
|
, openal
|
2022-08-30 04:00:28 +01:00
|
|
|
, python3
|
2021-06-21 12:53:18 +01:00
|
|
|
, zlib
|
|
|
|
}:
|
2010-08-01 16:14:33 +01:00
|
|
|
|
2021-06-21 12:53:18 +01:00
|
|
|
let
|
|
|
|
# the GLES backend on rpi is untested as I don't have the hardware
|
|
|
|
backend =
|
2022-07-30 17:21:10 +01:00
|
|
|
if stdenv.hostPlatform.isx86 then "OpenGL" else "GLES";
|
2021-06-21 12:53:18 +01:00
|
|
|
|
2021-06-27 06:38:33 +01:00
|
|
|
withVLC = stdenv.isDarwin;
|
|
|
|
|
|
|
|
inherit (lib) optional optionalString;
|
|
|
|
|
2021-06-21 12:53:18 +01:00
|
|
|
in
|
2010-08-01 15:24:46 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "gemrb";
|
2022-10-14 20:47:31 +01:00
|
|
|
version = "0.9.1.1";
|
2017-11-29 08:26:27 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-08-30 04:45:31 +01:00
|
|
|
owner = "gemrb";
|
|
|
|
repo = "gemrb";
|
|
|
|
rev = "v${version}";
|
2022-10-14 20:47:31 +01:00
|
|
|
hash = "sha256-pC83LgAy1aQxUhS2qa57hm03B37bj6dcRVRn7SI5I+k=";
|
2007-05-14 22:47:11 +01:00
|
|
|
};
|
|
|
|
|
2021-06-21 12:53:18 +01:00
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
SDL2_mixer
|
|
|
|
freetype
|
|
|
|
libGL
|
|
|
|
libiconv
|
|
|
|
libpng
|
|
|
|
libvorbis
|
|
|
|
openal
|
2022-08-30 04:00:28 +01:00
|
|
|
python3
|
2021-06-21 12:53:18 +01:00
|
|
|
zlib
|
2021-06-27 06:38:33 +01:00
|
|
|
]
|
|
|
|
++ optional withVLC libvlc;
|
2007-05-14 22:47:11 +01:00
|
|
|
|
2017-11-29 08:26:27 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2010-08-01 15:24:46 +01:00
|
|
|
|
2021-06-27 06:38:33 +01: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 12:53:18 +01:00
|
|
|
|
2017-11-29 08:26:27 +00:00
|
|
|
cmakeFlags = [
|
2021-06-27 06:38:33 +01:00
|
|
|
"-DDATA_DIR=${placeholder "out"}/share/gemrb"
|
|
|
|
"-DEXAMPLE_CONF_DIR=${placeholder "out"}/share/doc/gemrb/examples"
|
|
|
|
"-DSYSCONF_DIR=/etc"
|
2021-06-21 12:53:18 +01: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 12:53:18 +01:00
|
|
|
"-DOPENGL_BACKEND=${backend}"
|
|
|
|
"-DOpenGL_GL_PREFERENCE=GLVND"
|
2017-11-29 08:26:27 +00:00
|
|
|
];
|
2014-08-24 15:50:59 +01:00
|
|
|
|
2021-06-21 12:53:18 +01: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 = "A reimplementation of the Infinity Engine, used by games such as Baldur's Gate";
|
2014-08-24 15:50:59 +01: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 15:50:59 +01:00
|
|
|
'';
|
2020-10-02 08:58:50 +01:00
|
|
|
homepage = "https://gemrb.org/";
|
2021-06-21 12:53:18 +01:00
|
|
|
license = licenses.gpl2Only;
|
2017-12-05 22:20:11 +00:00
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
2007-05-14 22:47:11 +01:00
|
|
|
};
|
|
|
|
}
|