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
14}:
15
16buildPythonPackage rec {
17 pname = "ifcopenshell";
18 version = "210410";
19 format = "other";
20
21 src = fetchFromGitHub {
22 owner = "IfcOpenShell";
23 repo = "IfcOpenShell";
24 rev = "blenderbim-${version}";
25 fetchSubmodules = true;
26 sha256 = "1g52asxrqcfj01iqvf03k3bb6rg3v04hh1wc3nmn329a2lwjbxpw";
27 };
28
29 nativeBuildInputs = [ gcc10 cmake ];
30
31 buildInputs = [
32 boost17x
33 icu
34 pcre
35 libxml2
36 ];
37
38 preConfigure = ''
39 cd cmake
40 '';
41
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 ];
53
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 };
60}