2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
2021-12-06 16:07:01 +00:00
|
|
|
, stdenv
|
2022-12-17 10:02:37 +00:00
|
|
|
, fetchFromGitHub
|
2021-12-06 16:07:01 +00:00
|
|
|
, cmake
|
2022-12-17 10:02:37 +00:00
|
|
|
, pkg-config
|
|
|
|
, unzip
|
|
|
|
, SDL2
|
|
|
|
, boost
|
2021-12-06 16:07:01 +00:00
|
|
|
, freeimage
|
2022-12-17 10:02:37 +00:00
|
|
|
, freetype
|
2021-12-06 16:07:01 +00:00
|
|
|
, libpng
|
|
|
|
, ois
|
2022-12-17 10:02:37 +00:00
|
|
|
, pugixml
|
|
|
|
, zziplib
|
|
|
|
# linux
|
|
|
|
, freeglut
|
|
|
|
, libGL
|
|
|
|
, libGLU
|
|
|
|
, libICE
|
|
|
|
, libSM
|
2021-12-06 16:07:01 +00:00
|
|
|
, libX11
|
2022-12-17 10:02:37 +00:00
|
|
|
, libXaw
|
2021-12-06 16:07:01 +00:00
|
|
|
, libXmu
|
2022-12-17 10:02:37 +00:00
|
|
|
, libXrandr
|
2020-04-24 23:36:52 +00:00
|
|
|
, libXrender
|
2022-12-17 10:02:37 +00:00
|
|
|
, libXt
|
|
|
|
, libXxf86vm
|
|
|
|
, xorgproto
|
|
|
|
# darwin
|
2023-08-04 22:07:22 +00:00
|
|
|
, darwin
|
2022-12-17 10:02:37 +00:00
|
|
|
# optional
|
2021-12-06 16:07:01 +00:00
|
|
|
, withNvidiaCg ? false
|
|
|
|
, nvidia_cg_toolkit
|
|
|
|
, withSamples ? false
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
let
|
|
|
|
common = { version, hash }: stdenv.mkDerivation {
|
|
|
|
pname = "ogre";
|
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OGRECave";
|
|
|
|
repo = "ogre";
|
|
|
|
rev = "v${version}";
|
|
|
|
inherit hash;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
unzip
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
boost
|
|
|
|
freeimage
|
|
|
|
freetype
|
|
|
|
libpng
|
|
|
|
ois
|
|
|
|
pugixml
|
|
|
|
zziplib
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
freeglut
|
|
|
|
libGL
|
|
|
|
libGLU
|
|
|
|
libICE
|
|
|
|
libSM
|
|
|
|
libX11
|
|
|
|
libXaw
|
|
|
|
libXmu
|
|
|
|
libXrandr
|
|
|
|
libXrender
|
|
|
|
libXt
|
|
|
|
libXxf86vm
|
|
|
|
xorgproto
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.Cocoa
|
|
|
|
] ++ lib.optionals withNvidiaCg [
|
|
|
|
nvidia_cg_toolkit
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DOGRE_BUILD_COMPONENT_OVERLAY_IMGUI=FALSE"
|
|
|
|
"-DOGRE_BUILD_DEPENDENCIES=OFF"
|
|
|
|
"-DOGRE_BUILD_SAMPLES=${toString withSamples}"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"-DOGRE_BUILD_LIBS_AS_FRAMEWORKS=FALSE"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
meta = {
|
|
|
|
description = "3D Object-Oriented Graphics Rendering Engine";
|
|
|
|
homepage = "https://www.ogre3d.org/";
|
|
|
|
maintainers = with lib.maintainers; [ raskin wegank ];
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
ogre_14 = common {
|
|
|
|
version = "14.0.1";
|
|
|
|
hash = "sha256-jtUm0jy0GsxkGlFdODGodPsuSaQgiE77BORnA6SFViU=";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
ogre_13 = common {
|
|
|
|
version = "13.6.5";
|
|
|
|
hash = "sha256-8VQqePrvf/fleHijVIqWWfwOusGjVR40IIJ13o+HwaE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|