2023-01-11 07:51:40 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, boost
|
|
|
|
, freeimage
|
|
|
|
, freetype
|
|
|
|
, libpng
|
|
|
|
, ois
|
|
|
|
, zziplib
|
|
|
|
, freeglut
|
|
|
|
, libGL
|
|
|
|
, libGLU
|
|
|
|
, libICE
|
|
|
|
, libSM
|
|
|
|
, libX11
|
|
|
|
, libXaw
|
|
|
|
, libXmu
|
|
|
|
, libXrandr
|
2020-04-24 23:36:52 +00:00
|
|
|
, libXrender
|
2023-01-11 07:51:40 +00:00
|
|
|
, libXt
|
|
|
|
, libXxf86vm
|
|
|
|
, xorgproto
|
|
|
|
, darwin
|
|
|
|
, withNvidiaCg ? false
|
|
|
|
, nvidia_cg_toolkit
|
|
|
|
, withSamples ? false
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
let
|
|
|
|
inherit (darwin.apple_sdk.frameworks) AGL Cocoa;
|
|
|
|
in
|
2022-01-13 20:06:32 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ogre";
|
|
|
|
version = "1.10.11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-01-11 07:51:40 +00:00
|
|
|
url = "https://bitbucket.org/sinbad/ogre/get/v${lib.replaceStrings ["."] ["-"] version}.tar.gz";
|
|
|
|
sha256 = "1zwvlx5dz9nwjazhnrhzb0w8ilpa84r0hrxrmmy69pgr1p1yif5a";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
patches = [
|
|
|
|
# aarch64-darwin support
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/OGRECave/ogre/commit/bd5fbe3482c56e58c6c3b3bf439b1eab8c1be258.patch";
|
|
|
|
includes = [ "OgreMain/include/OgrePlatform*.h" ];
|
|
|
|
sha256 = "sha256-ELeCklQkltz7DeDaGl78Jk1H3Wdfu8fMUiMZaJM4s/Y=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/OGRECave/ogre/commit/0873244cc06b613ca2afbcb5522fe9ef89f111c5.patch";
|
|
|
|
sha256 = "sha256-xGvlMB55B2rdthxNMIM5iFf9p/6zuE8bGL9P04qtweQ=";
|
|
|
|
})
|
|
|
|
# aarch64-linux support
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-build-on-aarch64-linux.patch";
|
|
|
|
url = "https://github.com/OGRECave/ogre/commit/8ec086e9bc2e24fab373b514c572483b69071d69.patch";
|
|
|
|
sha256 = "sha256-22wlJPZ7lRIPAMqvpI/2YI0neQjGi1UXt8y5zNSpxCw=";
|
|
|
|
})
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
freeimage
|
|
|
|
freetype
|
|
|
|
libpng
|
|
|
|
ois
|
|
|
|
zziplib
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
freeglut
|
|
|
|
libGL
|
|
|
|
libGLU
|
|
|
|
libICE
|
|
|
|
libSM
|
|
|
|
libX11
|
|
|
|
libXaw
|
|
|
|
libXmu
|
|
|
|
libXrandr
|
|
|
|
libXrender
|
|
|
|
libXt
|
|
|
|
libXxf86vm
|
|
|
|
xorgproto
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
AGL
|
|
|
|
Cocoa
|
|
|
|
] ++ lib.optionals withNvidiaCg [
|
|
|
|
nvidia_cg_toolkit
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DOGRE_BUILD_COMPONENT_OVERLAY_IMGUI=FALSE"
|
|
|
|
"-DOGRE_BUILD_SAMPLES=${toString withSamples}"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"-DOGRE_BUILD_LIBS_AS_FRAMEWORKS=FALSE"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
2023-01-11 07:51:40 +00:00
|
|
|
description = "3D Object-Oriented Graphics Rendering Engine";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.ogre3d.org/";
|
2023-01-11 07:51:40 +00:00
|
|
|
maintainers = with lib.maintainers; [ raskin wegank ];
|
|
|
|
platforms = lib.platforms.unix;
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.mit;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|