opencascade: enable macOS build and add features
enable/fix macOS build and add options for TBB and GL2PS dependencies VTK integration needed a patch because implicit conversions in initializer lists are an error in C++11, which is the default in clang 7 used by nix.
This commit is contained in:
parent
1d60af7722
commit
80a6743c37
@ -1,6 +1,9 @@
|
|||||||
{ stdenv, fetchFromGitHub, fetchpatch, libGL, libGLU, libXmu, cmake, ninja,
|
{ stdenv, fetchFromGitHub, fetchpatch, libGL, libGLU, libXmu, cmake, ninja,
|
||||||
pkgconfig, fontconfig, freetype, expat, freeimage, vtk }:
|
pkgconfig, fontconfig, freetype, expat, freeimage, vtk, gl2ps, tbb,
|
||||||
|
OpenCL, Cocoa
|
||||||
|
}:
|
||||||
|
|
||||||
|
with stdenv.lib;
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "opencascade-oce";
|
pname = "opencascade-oce";
|
||||||
version = "0.18.3";
|
version = "0.18.3";
|
||||||
@ -13,13 +16,21 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ninja pkgconfig ];
|
nativeBuildInputs = [ cmake ninja pkgconfig ];
|
||||||
buildInputs = [ libGL libGLU libXmu freetype fontconfig expat freeimage vtk ];
|
buildInputs = [
|
||||||
|
libGL libGLU libXmu freetype fontconfig expat freeimage vtk
|
||||||
|
gl2ps tbb
|
||||||
|
]
|
||||||
|
++ optionals stdenv.isDarwin [OpenCL Cocoa]
|
||||||
|
;
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DOCE_INSTALL_PREFIX=${placeholder "out"}"
|
"-DOCE_INSTALL_PREFIX=${placeholder "out"}"
|
||||||
"-DOCE_WITH_FREEIMAGE=ON"
|
"-DOCE_WITH_FREEIMAGE=ON"
|
||||||
"-DOCE_WITH_VTK=ON"
|
"-DOCE_WITH_VTK=ON"
|
||||||
];
|
"-DOCE_WITH_GL2PS=ON"
|
||||||
|
"-DOCE_MULTITHREAD_LIBRARY=TBB"
|
||||||
|
]
|
||||||
|
++ optionals stdenv.isDarwin ["-DOCE_OSX_USE_COCOA=ON" "-DOCE_WITH_OPENCL=ON"];
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
# Use fontconfig instead of hardcoded directory list
|
# Use fontconfig instead of hardcoded directory list
|
||||||
@ -33,6 +44,10 @@ stdenv.mkDerivation rec {
|
|||||||
url = "https://github.com/tpaviot/oce/commit/3b44656e93270d782009b06ec4be84d2a13f8126.patch";
|
url = "https://github.com/tpaviot/oce/commit/3b44656e93270d782009b06ec4be84d2a13f8126.patch";
|
||||||
sha256 = "1ccakkcwy5g0184m23x0mnh22i0lk45xm8kgiv5z3pl7nh35dh8k";
|
sha256 = "1ccakkcwy5g0184m23x0mnh22i0lk45xm8kgiv5z3pl7nh35dh8k";
|
||||||
})
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://github.com/tpaviot/oce/commit/cf50d078cd5fac03a48fd204938bd240930a08dc.patch";
|
||||||
|
sha256 = "1xv94hcvggmb1c8vqwic1aiw9jw1sxk8mqbaak9xs9ycfqdvgdyc";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
@ -41,11 +56,11 @@ stdenv.mkDerivation rec {
|
|||||||
--replace FONTCONFIG_LIBRARIES FONTCONFIG_LINK_LIBRARIES
|
--replace FONTCONFIG_LIBRARIES FONTCONFIG_LINK_LIBRARIES
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = {
|
||||||
description = "Open CASCADE Technology, libraries for 3D modeling and numerical simulation";
|
description = "Open CASCADE Technology, libraries for 3D modeling and numerical simulation";
|
||||||
homepage = "https://github.com/tpaviot/oce";
|
homepage = "https://github.com/tpaviot/oce";
|
||||||
maintainers = [ maintainers.viric ];
|
maintainers = [ maintainers.viric ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.unix;
|
||||||
license = licenses.lgpl21;
|
license = licenses.lgpl21;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -14533,7 +14533,9 @@ in
|
|||||||
|
|
||||||
openbabel = callPackage ../development/libraries/openbabel { };
|
openbabel = callPackage ../development/libraries/openbabel { };
|
||||||
|
|
||||||
opencascade = callPackage ../development/libraries/opencascade { };
|
opencascade = callPackage ../development/libraries/opencascade {
|
||||||
|
inherit (darwin.apple_sdk.frameworks) OpenCL Cocoa;
|
||||||
|
};
|
||||||
opencascade-occt = callPackage ../development/libraries/opencascade-occt { };
|
opencascade-occt = callPackage ../development/libraries/opencascade-occt { };
|
||||||
|
|
||||||
opencl-headers = callPackage ../development/libraries/opencl-headers { };
|
opencl-headers = callPackage ../development/libraries/opencl-headers { };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user