Advertisement
Guest User

IfcOpenShell PKGBUILD

a guest
Sep 21st, 2018
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. # Maintainer: mickele <mimocciola[at]yahoo[dot]com>
  2. pkgname=ifcopenshell-git
  3. pkgver=0.5.0.preview2.r293.g92f4d76
  4. pkgrel=1
  5. pkgdesc="Open source IFC library and geometry engine. Provides static libraries, python3 wrapper and blender addon. GIT version."
  6. url="http://ifcopenshell.org/"
  7. arch=('x86_64' 'i686')
  8. license=('GPL3')
  9. depends=('opencascade' 'opencollada' 'boost-libs>=1.58.0' 'python')
  10. optdepends=()
  11. makedepends=('cmake' 'boost>=1.58.0' 'swig')
  12. conflicts=('ifcopenshell')
  13. replaces=()
  14. backup=()
  15. source=('IfcOpenShell::git://github.com/IfcOpenShell/IfcOpenShell.git')
  16. _blenderver=2.76
  17.  
  18. pkgver() {
  19. cd IfcOpenShell
  20.  
  21. if GITTAG="$(git describe --abbrev=0 --tags 2>/dev/null)"; then
  22. echo "$(sed -e "s/^${pkgname%%-git}//" -e 's/^[-_/a-zA-Z]\+//' -e 's/[-_+]/./g' <<< ${GITTAG}).r$(git rev-list --count ${GITTAG}..).g$(git log -1 --format="%h")"
  23. else
  24. echo "0.r$(git rev-list --count master).g$(git log -1 --format="%h")"
  25. fi
  26. }
  27.  
  28. prepare(){
  29. cd "${srcdir}/IfcOpenShell"
  30.  
  31. sed -e 's|#include "SvgSerializer.h"|#include "SvgSerializer.h"\n#include <Standard_Version.hxx>|' -i src/ifcconvert/SvgSerializer.cpp
  32.  
  33. sed -e 's|\t#include "../ifcgeom/IfcGeom.h"|\t// #include "../ifcgeom/IfcGeom.h"|' -i src/ifcwrap/IfcPython.i
  34. sed -e 's|\t#include "../ifcgeom/IfcGeomIterator.h"|\t#include "../ifcgeom/IfcGeomIterator.h"\n\t#include "../ifcgeom/IfcGeom.h"|' -i src/ifcwrap/IfcPython.i
  35.  
  36. sed -e "s|FIND_PACKAGE(Boost REQUIRED COMPONENTS system program_options regex thread date_time)|FIND_PACKAGE(Boost REQUIRED COMPONENTS system program_options regex thread date_time)\nADD_DEFINITIONS(-DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE)|" -i cmake/CMakeLists.txt
  37.  
  38. sed -e "s|boost::shared_ptr<Representation::Triangulation<P>>|boost::shared_ptr<Representation::Triangulation<P> >|" -i src/ifcgeom/IfcGeomElement.h
  39.  
  40. sed -e "s|#include <iomanip>|#include <iomanip>\n#include <unicode/unistr.h>|" -i src/ifcparse/IfcCharacterDecoder.cpp
  41.  
  42. find src -type f -exec sed -i -e "s|UnicodeString|icu::UnicodeString|g" {} \;
  43. }
  44.  
  45. build() {
  46. cd "${srcdir}/IfcOpenShell"
  47. if [ -d "build" ]; then
  48. rm -rf build
  49. fi
  50. mkdir -p build
  51. cd build
  52. local _pythonver=$(python --version >&1)
  53. # -DBUILD_IFCPYTHON=OFF \
  54. cmake -DCMAKE_INSTALL_PREFIX=/usr \
  55. -DCMAKE_CXX_STANDARD=11 \
  56. -DOCC_INCLUDE_DIR=/usr/include/opencascade \
  57. -DOCC_LIBRARY_DIR=/usr/lib \
  58. -DOPENCOLLADA_INCLUDE_DIR=/usr/include/opencollada \
  59. -DOPENCOLLADA_LIBRARY_DIR=/usr/lib/opencollada \
  60. -DICU_INCLUDE_DIR=/usr/include/unicode \
  61. -DICU_LIBRARY_DIR=/usr/lib \
  62. -DPYTHON_INCLUDE_DIR=/usr/include/python${_pythonver:7:3}m \
  63. -DPYTHON_LIBRARY=/usr/lib64/libpython${_pythonver:7:3}m.so \
  64. -DSWIG_EXECUTABLE=/usr/bin/swig \
  65. ../cmake
  66. make
  67. }
  68.  
  69. package() {
  70. cd "${srcdir}/IfcOpenShell/build"
  71. make DESTDIR="${pkgdir}" install
  72.  
  73. cd "${srcdir}/IfcOpenShell"
  74. install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  75.  
  76. mkdir -p "${pkgdir}"/usr/share/blender/${_blenderver}/scripts/addons_contrib
  77. cp -rf "${srcdir}"/IfcOpenShell/src/ifcblender/* "${pkgdir}"/usr/share/blender/${_blenderver}/scripts/addons_contrib
  78. cp -rf "${srcdir}"/IfcOpenShell/src/ifcopenshell-python/* "${pkgdir}"/usr/share/blender/${_blenderver}/scripts/addons_contrib/io_import_scene_ifc
  79. cp -f "${srcdir}"/IfcOpenShell/build/ifcwrap/*ifcopenshell_wrapper* "${pkgdir}"/usr/share/blender/${_blenderver}/scripts/addons_contrib/io_import_scene_ifc/ifcopenshell
  80. }
  81.  
  82. md5sums=('SKIP')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement