2022-05-18 14:49:53 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, zlib
|
|
|
|
, libpng
|
|
|
|
, libjpeg
|
|
|
|
, libGL
|
|
|
|
, libX11
|
|
|
|
, withTouchSupport ? false
|
|
|
|
, libXi
|
|
|
|
, libXext
|
|
|
|
, Cocoa
|
|
|
|
, Kernel
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "irrlichtmt";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "1.9.0mt8";
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "minetest";
|
|
|
|
repo = "irrlicht";
|
|
|
|
rev = version;
|
2022-09-30 11:47:45 +00:00
|
|
|
sha256 = "sha256-bwpALhBk16KugYqKuN57M3t5Ba7rdyrYWn/iBoi8hpg=";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
# https://github.com/minetest/minetest/pull/10729
|
2022-08-21 13:32:41 +00:00
|
|
|
postPatch = lib.optionalString (!withTouchSupport) ''
|
|
|
|
sed -i '1i #define NO_IRR_LINUX_X11_XINPUT2_' include/IrrCompileConfig.h
|
|
|
|
|
|
|
|
# HACK: Fix mistake in build script
|
|
|
|
sed -i '/''${X11_Xi_LIB}/d' source/Irrlicht/CMakeLists.txt
|
2022-05-18 14:49:53 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
zlib
|
|
|
|
libpng
|
|
|
|
libjpeg
|
|
|
|
libGL
|
|
|
|
libX11
|
|
|
|
] ++ lib.optionals withTouchSupport [
|
|
|
|
libXi
|
|
|
|
libXext
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
Cocoa
|
|
|
|
Kernel
|
|
|
|
];
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/minetest/irrlicht";
|
|
|
|
license = lib.licenses.zlib;
|
|
|
|
maintainers = with lib.maintainers; [ DeeUnderscore ];
|
|
|
|
description = "Minetest project's fork of Irrlicht, a realtime 3D engine written in C++";
|
|
|
|
};
|
|
|
|
}
|