1 { lib, stdenv, fetchFromGitHub, fetchpatch, libGL, libGLU, libXmu, cmake, ninja,
2 pkg-config, fontconfig, freetype, expat, freeimage, vtk, gl2ps, tbb,
7 stdenv.mkDerivation rec {
8 pname = "opencascade-oce";
11 src = fetchFromGitHub {
14 rev = "OCE-${version}";
15 sha256 = "17wy8dcf44vqisishv1jjf3cmcxyygqq29y9c3wjdj983qi2hsig";
18 nativeBuildInputs = [ cmake ninja pkg-config ];
20 libGL libGLU libXmu freetype fontconfig expat freeimage vtk
23 ++ optionals stdenv.isDarwin [OpenCL Cocoa]
27 "-DOCE_INSTALL_PREFIX=${placeholder "out"}"
28 "-DOCE_WITH_FREEIMAGE=ON"
31 "-DOCE_MULTITHREAD_LIBRARY=TBB"
33 ++ optionals stdenv.isDarwin ["-DOCE_OSX_USE_COCOA=ON" "-DOCE_WITH_OPENCL=ON"];
36 # Use fontconfig instead of hardcoded directory list
37 # https://github.com/tpaviot/oce/pull/714
39 url = "https://github.com/tpaviot/oce/commit/9643432b27fec8974ca0ee15c3c372f5fe8fc069.patch";
40 sha256 = "1wd940rszmh5apcpk5fv6126h8mcjcy4rjifrql5d4ac90v06v4c";
44 url = "https://github.com/tpaviot/oce/commit/3b44656e93270d782009b06ec4be84d2a13f8126.patch";
45 sha256 = "1ccakkcwy5g0184m23x0mnh22i0lk45xm8kgiv5z3pl7nh35dh8k";
48 url = "https://github.com/tpaviot/oce/commit/cf50d078cd5fac03a48fd204938bd240930a08dc.patch";
49 sha256 = "1xv94hcvggmb1c8vqwic1aiw9jw1sxk8mqbaak9xs9ycfqdvgdyc";
54 # make sure the installed cmake file uses absolute paths for fontconfig
55 substituteInPlace adm/cmake/TKService/CMakeLists.txt \
56 --replace FONTCONFIG_LIBRARIES FONTCONFIG_LINK_LIBRARIES
60 description = "Open CASCADE Technology, libraries for 3D modeling and numerical simulation";
61 homepage = "https://github.com/tpaviot/oce";
62 maintainers = [ maintainers.viric ];
63 platforms = platforms.unix;
64 license = licenses.lgpl21;