Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / python-modules / ifcopenshell / default.nix
blob2eedaaece690b5ec2bad975ebf2da30fc7e3ee1f
1 { lib, stdenv
2 , buildPythonPackage
3 , fetchFromGitHub
4 , python
5 , gcc10
6 , cmake
7 , boost17x
8 , icu
9 , swig
10 , pcre
11 , opencascade-occt
12 , opencollada
13 , libxml2
16 buildPythonPackage rec {
17   pname = "ifcopenshell";
18   version = "210410";
19   format = "other";
21   src = fetchFromGitHub {
22     owner  = "IfcOpenShell";
23     repo   = "IfcOpenShell";
24     rev    = "blenderbim-${version}";
25     fetchSubmodules = true;
26     sha256 = "1g52asxrqcfj01iqvf03k3bb6rg3v04hh1wc3nmn329a2lwjbxpw";
27   };
29   nativeBuildInputs = [ gcc10 cmake ];
31   buildInputs = [
32     boost17x
33     icu
34     pcre
35     libxml2
36   ];
38   preConfigure = ''
39     cd cmake
40   '';
42   PYTHONUSERBASE=".";
43   cmakeFlags = [
44     "-DUSERSPACE_PYTHON_PREFIX=ON"
45     "-DOCC_INCLUDE_DIR=${opencascade-occt}/include/opencascade"
46     "-DOCC_LIBRARY_DIR=${opencascade-occt}/lib"
47     "-DOPENCOLLADA_INCLUDE_DIR=${opencollada}/include/opencollada"
48     "-DOPENCOLLADA_LIBRARY_DIR=${opencollada}/lib/opencollada"
49     "-DSWIG_EXECUTABLE=${swig}/bin/swig"
50     "-DLIBXML2_INCLUDE_DIR=${libxml2.dev}/include/libxml2"
51     "-DLIBXML2_LIBRARIES=${libxml2.out}/lib/${if stdenv.isDarwin then "libxml2.dylib" else "libxml2.so"}"
52   ];
54   meta = with lib; {
55     description = "Open source IFC library and geometry engine";
56     homepage    = http://ifcopenshell.org/;
57     license     = licenses.lgpl3;
58     maintainers = with maintainers; [ fehnomenal ];
59   };