2019-05-11 11:34:09 +01:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch, libGL, libGLU, libXmu, cmake, ninja,
|
2020-09-10 14:21:06 +01:00
|
|
|
pkgconfig, fontconfig, freetype, expat, freeimage, vtk, gl2ps, tbb,
|
|
|
|
OpenCL, Cocoa
|
|
|
|
}:
|
2009-01-27 08:14:27 +00:00
|
|
|
|
2020-09-10 14:21:06 +01:00
|
|
|
with stdenv.lib;
|
2010-01-27 18:27:55 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-05-11 11:34:09 +01:00
|
|
|
pname = "opencascade-oce";
|
|
|
|
version = "0.18.3";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tpaviot";
|
|
|
|
repo = "oce";
|
|
|
|
rev = "OCE-${version}";
|
|
|
|
sha256 = "17wy8dcf44vqisishv1jjf3cmcxyygqq29y9c3wjdj983qi2hsig";
|
2009-01-27 08:14:27 +00:00
|
|
|
};
|
|
|
|
|
2019-05-11 11:34:09 +01:00
|
|
|
nativeBuildInputs = [ cmake ninja pkgconfig ];
|
2020-09-10 14:21:06 +01:00
|
|
|
buildInputs = [
|
|
|
|
libGL libGLU libXmu freetype fontconfig expat freeimage vtk
|
|
|
|
gl2ps tbb
|
|
|
|
]
|
|
|
|
++ optionals stdenv.isDarwin [OpenCL Cocoa]
|
|
|
|
;
|
2016-02-12 16:10:06 +00:00
|
|
|
|
2019-05-11 11:34:09 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DOCE_INSTALL_PREFIX=${placeholder "out"}"
|
|
|
|
"-DOCE_WITH_FREEIMAGE=ON"
|
|
|
|
"-DOCE_WITH_VTK=ON"
|
2020-09-10 14:21:06 +01:00
|
|
|
"-DOCE_WITH_GL2PS=ON"
|
|
|
|
"-DOCE_MULTITHREAD_LIBRARY=TBB"
|
|
|
|
]
|
|
|
|
++ optionals stdenv.isDarwin ["-DOCE_OSX_USE_COCOA=ON" "-DOCE_WITH_OPENCL=ON"];
|
2017-11-13 08:44:04 +00:00
|
|
|
|
2019-05-11 11:34:09 +01:00
|
|
|
patches = [
|
|
|
|
# Use fontconfig instead of hardcoded directory list
|
|
|
|
# https://github.com/tpaviot/oce/pull/714
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/tpaviot/oce/commit/9643432b27fec8974ca0ee15c3c372f5fe8fc069.patch";
|
|
|
|
sha256 = "1wd940rszmh5apcpk5fv6126h8mcjcy4rjifrql5d4ac90v06v4c";
|
|
|
|
})
|
|
|
|
# Fix for glibc 2.26
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/tpaviot/oce/commit/3b44656e93270d782009b06ec4be84d2a13f8126.patch";
|
|
|
|
sha256 = "1ccakkcwy5g0184m23x0mnh22i0lk45xm8kgiv5z3pl7nh35dh8k";
|
|
|
|
})
|
2020-09-10 14:21:06 +01:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/tpaviot/oce/commit/cf50d078cd5fac03a48fd204938bd240930a08dc.patch";
|
|
|
|
sha256 = "1xv94hcvggmb1c8vqwic1aiw9jw1sxk8mqbaak9xs9ycfqdvgdyc";
|
|
|
|
})
|
2019-05-11 11:34:09 +01:00
|
|
|
];
|
2016-09-05 20:52:04 +01:00
|
|
|
|
2019-05-11 11:34:09 +01:00
|
|
|
postPatch = ''
|
|
|
|
# make sure the installed cmake file uses absolute paths for fontconfig
|
|
|
|
substituteInPlace adm/cmake/TKService/CMakeLists.txt \
|
|
|
|
--replace FONTCONFIG_LIBRARIES FONTCONFIG_LINK_LIBRARIES
|
|
|
|
'';
|
2012-03-02 13:47:37 +00:00
|
|
|
|
2020-09-10 14:21:06 +01:00
|
|
|
meta = {
|
2009-01-27 08:14:27 +00:00
|
|
|
description = "Open CASCADE Technology, libraries for 3D modeling and numerical simulation";
|
2019-05-11 11:34:09 +01:00
|
|
|
homepage = "https://github.com/tpaviot/oce";
|
2018-10-25 20:56:50 +01:00
|
|
|
maintainers = [ maintainers.viric ];
|
2020-09-10 14:21:06 +01:00
|
|
|
platforms = platforms.unix;
|
2018-10-25 20:56:50 +01:00
|
|
|
license = licenses.lgpl21;
|
2009-01-27 08:14:27 +00:00
|
|
|
};
|
|
|
|
}
|