From a7a00824e44e38734e11c8894018d5327a21692a Mon Sep 17 00:00:00 2001 From: Andreas Fehn Date: Fri, 27 Nov 2020 09:28:35 +0100 Subject: [PATCH 1/2] maintainers: add fehnomenal --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 2838f60ad00..e753fdf8d84 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -2885,6 +2885,12 @@ githubId = 541748; name = "Felipe Espinoza"; }; + fehnomenal = { + email = "fehnomenal@fehn.systems"; + github = "fehnomenal"; + githubId = 9959940; + name = "Andreas Fehn"; + }; felschr = { email = "dev@felschr.com"; github = "felschr"; From 68a379e36456b20629ed0edf2ce82c021c260548 Mon Sep 17 00:00:00 2001 From: Andreas Fehn Date: Fri, 27 Nov 2020 09:48:32 +0100 Subject: [PATCH 2/2] pythonPackages.ifcopenshell: init at 0.6.0b --- .../python-modules/ifcopenshell/default.nix | 67 +++++++++++++++++++ .../ifcopenshell/site-packages.patch | 32 +++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 101 insertions(+) create mode 100644 pkgs/development/python-modules/ifcopenshell/default.nix create mode 100644 pkgs/development/python-modules/ifcopenshell/site-packages.patch diff --git a/pkgs/development/python-modules/ifcopenshell/default.nix b/pkgs/development/python-modules/ifcopenshell/default.nix new file mode 100644 index 00000000000..16ee8dcbace --- /dev/null +++ b/pkgs/development/python-modules/ifcopenshell/default.nix @@ -0,0 +1,67 @@ +{ stdenv +, buildPythonPackage +, fetchFromGitHub +, substituteAll +, python +, gcc10 +, cmake +, boost172 +, icu +, swig +, pcre +, opencascade-occt +, opencollada +, libxml2 +}: + +buildPythonPackage rec { + pname = "ifcopenshell"; + version = "0.6.0b0"; + format = "other"; + + src = fetchFromGitHub { + owner = "IfcOpenShell"; + repo = "IfcOpenShell"; + rev = "v${version}"; + fetchSubmodules = true; + sha256 = "1ad1s9az41z2f46rbi1jnr46mgc0q4h5kz1jm9xdlwifqv9y04g1"; + }; + + patches = [ + (substituteAll { + name = "site-packages.patch"; + src = ./site-packages.patch; + site_packages = "lib/${python.libPrefix}/site-packages"; + }) + ]; + + nativeBuildInputs = [ gcc10 cmake ]; + + buildInputs = [ + boost172 + icu + pcre + libxml2 + ]; + + preConfigure = '' + cd cmake + ''; + + cmakeFlags = [ + "-DOCC_INCLUDE_DIR=${opencascade-occt}/include/opencascade" + "-DOCC_LIBRARY_DIR=${opencascade-occt}/lib" + "-DOPENCOLLADA_INCLUDE_DIR=${opencollada}/include/opencollada" + "-DOPENCOLLADA_LIBRARY_DIR=${opencollada}/lib/opencollada" + "-DSWIG_EXECUTABLE=${swig}/bin/swig" + "-DLIBXML2_INCLUDE_DIR=${libxml2.dev}/include/libxml2" + "-DLIBXML2_LIBRARIES=${libxml2.out}/lib/${if stdenv.isDarwin then "libxml2.dylib" else "libxml2.so"}" + ]; + + meta = with stdenv.lib; { + description = "Open source IFC library and geometry engine"; + homepage = http://ifcopenshell.org/; + license = licenses.lgpl3; + maintainers = with maintainers; [ fehnomenal ]; + }; +} diff --git a/pkgs/development/python-modules/ifcopenshell/site-packages.patch b/pkgs/development/python-modules/ifcopenshell/site-packages.patch new file mode 100644 index 00000000000..e61fe2056f7 --- /dev/null +++ b/pkgs/development/python-modules/ifcopenshell/site-packages.patch @@ -0,0 +1,32 @@ +--- a/src/ifcwrap/CMakeLists.txt ++++ b/src/ifcwrap/CMakeLists.txt +@@ -68,26 +68,17 @@ endif() + # directory in which the wrapper can be installed. + FIND_PACKAGE(PythonInterp) + IF(PYTHONINTERP_FOUND AND NOT "${PYTHON_EXECUTABLE}" STREQUAL "") +- EXECUTE_PROCESS( +- COMMAND ${PYTHON_EXECUTABLE} -c "import sys; from distutils.sysconfig import get_python_lib; sys.stdout.write(get_python_lib(1))" +- OUTPUT_VARIABLE python_package_dir +- ) +- +- IF("${python_package_dir}" STREQUAL "") +- MESSAGE(WARNING "Unable to locate Python site-package directory, unable to install the Python wrapper") +- ELSE() + FILE(GLOB_RECURSE sourcefiles "${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/*.py") + FOREACH(file ${sourcefiles}) + FILE(RELATIVE_PATH relative "${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/" "${file}") + GET_FILENAME_COMPONENT(dir "${relative}" DIRECTORY) + INSTALL(FILES "${file}" +- DESTINATION "${python_package_dir}/ifcopenshell/${dir}") ++ DESTINATION "@site_packages@/ifcopenshell/${dir}") + ENDFOREACH() + INSTALL(FILES "${CMAKE_BINARY_DIR}/ifcwrap/ifcopenshell_wrapper.py" +- DESTINATION "${python_package_dir}/ifcopenshell") ++ DESTINATION "@site_packages@/ifcopenshell") + INSTALL(TARGETS _ifcopenshell_wrapper +- DESTINATION "${python_package_dir}/ifcopenshell") +- ENDIF() ++ DESTINATION "@site_packages@/ifcopenshell") + ELSE() + MESSAGE(WARNING "No Python interpreter found, unable to install the Python wrapper") + ENDIF() diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d84b4c36624..754460dd696 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2879,6 +2879,8 @@ in { ifconfig-parser = callPackage ../development/python-modules/ifconfig-parser { }; + ifcopenshell = callPackage ../development/python-modules/ifcopenshell { }; + ignite = callPackage ../development/python-modules/ignite { }; ihatemoney = callPackage ../development/python-modules/ihatemoney { };