forked from lopsided98/nix-ros-overlay
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce version of Ogre removed from Nixpkgs. Required by lopsided98#161 Taken from NixOS/nixpkgs@40f52d9
- Loading branch information
Showing
2 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{ fetchFromGitHub | ||
, stdenv | ||
, lib | ||
, cmake | ||
, libGLU | ||
, libGL | ||
, freetype | ||
, freeimage | ||
, zziplib | ||
, xorgproto | ||
, libXrandr | ||
, libXaw | ||
, freeglut | ||
, libXt | ||
, libpng | ||
, boost | ||
, ois | ||
, libX11 | ||
, libXmu | ||
, libSM | ||
, pkg-config | ||
, libXxf86vm | ||
, libICE | ||
, libXrender | ||
, withNvidiaCg ? false | ||
, nvidia_cg_toolkit | ||
, withSamples ? false | ||
}: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "ogre"; | ||
version = "1.9.1"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "OGRECave"; | ||
repo = "ogre"; | ||
rev = "v${version}"; | ||
sha256 = "11lfgzqaps3728dswrq3cbwk7aicigyz08q4hfyy6ikc6m35r4wg"; | ||
}; | ||
|
||
# fix for ARM. sys/sysctl.h has moved in later glibcs, and | ||
# https://github.com/OGRECave/ogre-next/issues/132 suggests it isn't | ||
# needed anyway. | ||
postPatch = '' | ||
substituteInPlace OgreMain/src/OgrePlatformInformation.cpp \ | ||
--replace '#include <sys/sysctl.h>' "" | ||
''; | ||
|
||
cmakeFlags = [ | ||
"-DOGRE_BUILD_SAMPLES=${toString withSamples}" | ||
] | ||
++ map (x: "-DOGRE_BUILD_PLUGIN_${x}=on") | ||
([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG") | ||
++ map (x: "-DOGRE_BUILD_RENDERSYSTEM_${x}=on") [ "GL" ]; | ||
|
||
nativeBuildInputs = [ | ||
cmake | ||
pkg-config | ||
]; | ||
|
||
buildInputs = [ | ||
libGLU | ||
libGL | ||
freetype | ||
freeimage | ||
zziplib | ||
xorgproto | ||
libXrandr | ||
libXaw | ||
freeglut | ||
libXt | ||
libpng | ||
boost | ||
ois | ||
libX11 | ||
libXmu | ||
libSM | ||
libXxf86vm | ||
libICE | ||
libXrender | ||
] | ||
++ lib.optionals withNvidiaCg [ | ||
nvidia_cg_toolkit | ||
]; | ||
|
||
meta = { | ||
description = "A 3D engine"; | ||
homepage = "https://www.ogre3d.org/"; | ||
maintainers = [ lib.maintainers.raskin ]; | ||
platforms = lib.platforms.linux; | ||
license = lib.licenses.mit; | ||
}; | ||
} |