python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / opencascade / default.nix
blob5c262a3680c54338e2087029f501a2ee12586a0e
1 { lib, stdenv, fetchFromGitHub, fetchpatch, libGL, libGLU, libXmu, cmake, ninja,
2   pkg-config, fontconfig, freetype, expat, freeimage, vtk, gl2ps, tbb,
3   OpenCL, Cocoa
4 }:
6 with lib;
7 stdenv.mkDerivation rec {
8   pname = "opencascade-oce";
9   version = "0.18.3";
11   src = fetchFromGitHub {
12     owner = "tpaviot";
13     repo = "oce";
14     rev = "OCE-${version}";
15     sha256 = "17wy8dcf44vqisishv1jjf3cmcxyygqq29y9c3wjdj983qi2hsig";
16   };
18   nativeBuildInputs = [ cmake ninja pkg-config ];
19   buildInputs = [
20     libGL libGLU libXmu freetype fontconfig expat freeimage vtk
21     gl2ps tbb
22   ]
23     ++ optionals stdenv.isDarwin [OpenCL Cocoa]
24   ;
26   cmakeFlags = [
27     "-DOCE_INSTALL_PREFIX=${placeholder "out"}"
28     "-DOCE_WITH_FREEIMAGE=ON"
29     "-DOCE_WITH_VTK=ON"
30     "-DOCE_WITH_GL2PS=ON"
31     "-DOCE_MULTITHREAD_LIBRARY=TBB"
32   ]
33   ++ optionals stdenv.isDarwin ["-DOCE_OSX_USE_COCOA=ON" "-DOCE_WITH_OPENCL=ON"];
35   patches = [
36     # Use fontconfig instead of hardcoded directory list
37     # https://github.com/tpaviot/oce/pull/714
38     (fetchpatch {
39       url = "https://github.com/tpaviot/oce/commit/9643432b27fec8974ca0ee15c3c372f5fe8fc069.patch";
40       sha256 = "1wd940rszmh5apcpk5fv6126h8mcjcy4rjifrql5d4ac90v06v4c";
41     })
42     # Fix for glibc 2.26
43     (fetchpatch {
44       url = "https://github.com/tpaviot/oce/commit/3b44656e93270d782009b06ec4be84d2a13f8126.patch";
45       sha256 = "1ccakkcwy5g0184m23x0mnh22i0lk45xm8kgiv5z3pl7nh35dh8k";
46     })
47     (fetchpatch {
48       url = "https://github.com/tpaviot/oce/commit/cf50d078cd5fac03a48fd204938bd240930a08dc.patch";
49       sha256 = "1xv94hcvggmb1c8vqwic1aiw9jw1sxk8mqbaak9xs9ycfqdvgdyc";
50     })
51   ];
53   postPatch = ''
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
57   '';
59   meta = {
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;
65   };