2024-01-13 08:15:51 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, fetchpatch, fetchurl, cmake, pkg-config, doxygen,
|
2020-04-24 23:36:52 +00:00
|
|
|
libX11, libXinerama, libXrandr, libGLU, libGL,
|
2024-01-13 08:15:51 +00:00
|
|
|
glib, libxml2, pcre, zlib,
|
2023-04-29 16:46:19 +00:00
|
|
|
AGL, Accelerate, Carbon, Cocoa, Foundation,
|
2021-12-06 16:07:01 +00:00
|
|
|
boost,
|
2020-04-24 23:36:52 +00:00
|
|
|
jpegSupport ? true, libjpeg,
|
2024-01-13 08:15:51 +00:00
|
|
|
exrSupport ? false, openexr_3,
|
2020-04-24 23:36:52 +00:00
|
|
|
gifSupport ? true, giflib,
|
|
|
|
pngSupport ? true, libpng,
|
|
|
|
tiffSupport ? true, libtiff,
|
|
|
|
gdalSupport ? false, gdal,
|
|
|
|
curlSupport ? true, curl,
|
2024-02-29 20:09:43 +00:00
|
|
|
colladaSupport ? false, opencollada,
|
2023-10-09 19:29:22 +00:00
|
|
|
opencascadeSupport ? false, opencascade-occt,
|
2021-05-03 20:48:10 +00:00
|
|
|
ffmpegSupport ? false, ffmpeg,
|
2020-04-24 23:36:52 +00:00
|
|
|
nvttSupport ? false, nvidia-texture-tools,
|
|
|
|
freetypeSupport ? true, freetype,
|
|
|
|
svgSupport ? false, librsvg,
|
|
|
|
pdfSupport ? false, poppler,
|
|
|
|
vncSupport ? false, libvncserver,
|
|
|
|
lasSupport ? false, libLAS,
|
|
|
|
luaSupport ? false, lua,
|
|
|
|
sdlSupport ? false, SDL2,
|
2021-12-06 16:07:01 +00:00
|
|
|
restSupport ? false, asio,
|
2020-04-24 23:36:52 +00:00
|
|
|
withApps ? false,
|
2023-03-24 00:07:29 +00:00
|
|
|
withExamples ? false, fltk,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "openscenegraph";
|
2021-03-09 03:18:52 +00:00
|
|
|
version = "3.6.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openscenegraph";
|
|
|
|
repo = "OpenSceneGraph";
|
|
|
|
rev = "OpenSceneGraph-${version}";
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "00i14h82qg3xzcyd8p02wrarnmby3aiwmz0z43l50byc9f8i05n1";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake doxygen ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildInputs = lib.optionals (!stdenv.isDarwin) [
|
2020-04-24 23:36:52 +00:00
|
|
|
libX11 libXinerama libXrandr libGLU libGL
|
2023-07-15 17:15:38 +00:00
|
|
|
] ++ [
|
2024-01-13 08:15:51 +00:00
|
|
|
glib libxml2 pcre zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ lib.optional jpegSupport libjpeg
|
2024-01-13 08:15:51 +00:00
|
|
|
++ lib.optional exrSupport openexr_3
|
2020-04-24 23:36:52 +00:00
|
|
|
++ lib.optional gifSupport giflib
|
|
|
|
++ lib.optional pngSupport libpng
|
|
|
|
++ lib.optional tiffSupport libtiff
|
|
|
|
++ lib.optional gdalSupport gdal
|
|
|
|
++ lib.optional curlSupport curl
|
2024-02-29 20:09:43 +00:00
|
|
|
++ lib.optional colladaSupport opencollada
|
2023-10-09 19:29:22 +00:00
|
|
|
++ lib.optional opencascadeSupport opencascade-occt
|
2021-05-03 20:48:10 +00:00
|
|
|
++ lib.optional ffmpegSupport ffmpeg
|
2020-04-24 23:36:52 +00:00
|
|
|
++ lib.optional nvttSupport nvidia-texture-tools
|
|
|
|
++ lib.optional freetypeSupport freetype
|
|
|
|
++ lib.optional svgSupport librsvg
|
|
|
|
++ lib.optional pdfSupport poppler
|
|
|
|
++ lib.optional vncSupport libvncserver
|
|
|
|
++ lib.optional lasSupport libLAS
|
|
|
|
++ lib.optional luaSupport lua
|
|
|
|
++ lib.optional sdlSupport SDL2
|
2021-12-06 16:07:01 +00:00
|
|
|
++ lib.optional restSupport asio
|
2023-03-24 00:07:29 +00:00
|
|
|
++ lib.optionals withExamples [ fltk ]
|
2023-07-15 17:15:38 +00:00
|
|
|
++ lib.optionals (!stdenv.isDarwin) [ ]
|
2023-04-29 16:46:19 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ AGL Accelerate Carbon Cocoa Foundation ]
|
2021-12-06 16:07:01 +00:00
|
|
|
++ lib.optional (restSupport || colladaSupport) boost
|
2023-10-09 19:29:22 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "opencascade-api-patch";
|
|
|
|
url = "https://github.com/openscenegraph/OpenSceneGraph/commit/bc2daf9b3239c42d7e51ecd7947d31a92a7dc82b.patch";
|
|
|
|
hash = "sha256-VR8YKOV/YihB5eEGZOGaIfJNrig1EPS/PJmpKsK284c=";
|
|
|
|
})
|
2024-01-13 08:15:51 +00:00
|
|
|
# OpenEXR 3 support: https://github.com/openscenegraph/OpenSceneGraph/issues/1075
|
|
|
|
(fetchurl {
|
|
|
|
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-games/openscenegraph/files/openscenegraph-3.6.5-openexr3.patch?id=0f642d8f09b589166f0e0c0fc84df7673990bf3f";
|
|
|
|
hash = "sha256-fdNbkg6Vp7DeDBTe5Zso8qJ5v9uPSXHpQ5XlGkvputk=";
|
|
|
|
})
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeFlags = lib.optional (!withApps) "-DBUILD_OSG_APPLICATIONS=OFF" ++ lib.optional withExamples "-DBUILD_OSG_EXAMPLES=ON";
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "3D graphics toolkit";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.openscenegraph.org/";
|
|
|
|
maintainers = with maintainers; [ aanderse raskin ];
|
2020-10-27 00:29:36 +00:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
license = "OpenSceneGraph Public License - free LGPL-based license";
|
|
|
|
};
|
|
|
|
}
|