1 { fetchurl, stdenv, lib
3 , freetype, freeimage, zziplib, xorgproto, libXrandr
4 , libXaw, freeglut, libXt, libpng, boost, ois
5 , libX11, libXmu, libSM, pkg-config
8 , withNvidiaCg ? false, nvidia_cg_toolkit
9 , withSamples ? false }:
11 stdenv.mkDerivation rec {
16 url = "https://bitbucket.org/sinbad/ogre/get/v${lib.replaceStrings ["."] ["-"] version}.tar.gz";
17 sha256 = "1zwvlx5dz9nwjazhnrhzb0w8ilpa84r0hrxrmmy69pgr1p1yif5a";
20 # fix for ARM. sys/sysctl.h has moved in later glibcs, and
21 # https://github.com/OGRECave/ogre-next/issues/132 suggests it isn't
24 substituteInPlace OgreMain/src/OgrePlatformInformation.cpp \
25 --replace '#include <sys/sysctl.h>' ""
28 cmakeFlags = [ "-DOGRE_BUILD_SAMPLES=${toString withSamples}" ]
29 ++ map (x: "-DOGRE_BUILD_PLUGIN_${x}=on")
30 ([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG")
31 ++ map (x: "-DOGRE_BUILD_RENDERSYSTEM_${x}=on") [ "GL" ];
33 nativeBuildInputs = [ cmake pkg-config ];
36 freetype freeimage zziplib xorgproto libXrandr
37 libXaw freeglut libXt libpng boost ois
41 ] ++ lib.optional withNvidiaCg nvidia_cg_toolkit;
44 description = "A 3D engine";
45 homepage = "https://www.ogre3d.org/";
46 maintainers = [ lib.maintainers.raskin ];
47 platforms = lib.platforms.linux;
48 license = lib.licenses.mit;