2021-10-14 00:43:12 +00:00
|
|
|
{ lib, stdenv, fetchzip, libGLU, libGL, libXrandr, libX11, libXxf86vm, zlib }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
common = import ./common.nix { inherit fetchzip; };
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = common.pname;
|
|
|
|
version = common.version;
|
|
|
|
|
|
|
|
src = common.src;
|
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -ie '/sys\/sysctl.h/d' source/Irrlicht/COSOperator.cpp
|
2021-10-14 00:43:12 +00:00
|
|
|
'' + lib.optionalString stdenv.isAarch64 ''
|
|
|
|
substituteInPlace source/Irrlicht/Makefile \
|
|
|
|
--replace "-DIRRLICHT_EXPORTS=1" "-DIRRLICHT_EXPORTS=1 -DPNG_ARM_NEON_OPT=0"
|
2020-10-16 20:44:37 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preConfigure = ''
|
|
|
|
cd source/Irrlicht
|
|
|
|
'';
|
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
preBuild = ''
|
|
|
|
makeFlagsArray+=(sharedlib NDEBUG=1 LDFLAGS="-lX11 -lGL -lXxf86vm")
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preInstall = ''
|
|
|
|
sed -i s,/usr/local/lib,$out/lib, Makefile
|
|
|
|
mkdir -p $out/lib
|
|
|
|
'';
|
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
buildInputs = [
|
|
|
|
libGLU libGL libXrandr libX11 libXxf86vm
|
|
|
|
] ++ lib.optional stdenv.isAarch64 zlib;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
2023-11-16 04:20:00 +00:00
|
|
|
homepage = "https://irrlicht.sourceforge.io/";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.zlib;
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Open source high performance realtime 3D engine written in C++";
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|