Guest User

Untitled

a guest
Sep 21st, 2018
90
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Maintainer: mickele <mimocciola[at]yahoo[dot]com>
  2. pkgname=python2-ifcopenshell-git
  3. pkgver=0.5.0.preview2.r293.g92f4d76
  4. pkgrel=1
  5. pkgdesc="Open source IFC library and geometry engine. Provides only wrapper for python2. GIT version."
  6. url="http://ifcopenshell.org/"
  7. arch=('x86_64' 'i686')
  8. license=('GPL3')
  9. depends=('opencascade' 'opencollada' 'boost-libs>=1.58.0' 'python2')
  10. optdepends=()
  11. makedepends=('cmake' 'boost>=1.58.0' 'swig')
  12. conflicts=()
  13. replaces=()
  14. backup=()
  15. source=('IfcOpenShell::git://github.com/IfcOpenShell/IfcOpenShell.git')
  16.  
  17. pkgver() {
  18. cd IfcOpenShell
  19.  
  20. if GITTAG="$(git describe --abbrev=0 --tags 2>/dev/null)"; then
  21. 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")"
  22. else
  23. echo "0.r$(git rev-list --count master).g$(git log -1 --format="%h")"
  24. fi
  25. }
  26.  
  27. prepare(){
  28. cd "${srcdir}/IfcOpenShell"
  29.  
  30. for _FILE in `grep -Rl "COMMAND python" *`; do
  31. sed -e "s|COMMAND python|COMMAND python2|" -i ${_FILE}
  32. done
  33.  
  34. sed -e 's|#include "SvgSerializer.h"|#include "SvgSerializer.h"\n#include <Standard_Version.hxx>|' -i src/ifcconvert/SvgSerializer.cpp
  35.  
  36. sed -e 's|\t#include "../ifcgeom/IfcGeom.h"|\t// #include "../ifcgeom/IfcGeom.h"|' -i src/ifcwrap/IfcPython.i
  37. sed -e 's|\t#include "../ifcgeom/IfcGeomIterator.h"|\t#include "../ifcgeom/IfcGeomIterator.h"\n\t#include "../ifcgeom/IfcGeom.h"|' -i src/ifcwrap/IfcPython.i
  38.  
  39. 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
  40.  
  41. sed -e "s|boost::shared_ptr<Representation::Triangulation<P>>|boost::shared_ptr<Representation::Triangulation<P> >|" -i src/ifcgeom/IfcGeomElement.h
  42.  
  43. sed -e "s|#include <iomanip>|#include <iomanip>\n#include <unicode/unistr.h>|" -i src/ifcparse/IfcCharacterDecoder.cpp
  44. find src -type f -exec sed -i -e "s|UnicodeString|icu::UnicodeString|g" {} \;
  45. }
  46.  
  47. build() {
  48. cd "${srcdir}/IfcOpenShell"
  49.  
  50. mkdir -p build
  51. cd "${srcdir}/IfcOpenShell/build"
  52. local _pythonver=$(python2 --version 2>&1)
  53. cmake -DCMAKE_INSTALL_PREFIX=/usr \
  54. -DCMAKE_CXX_STANDARD=11 \
  55. -DOCC_INCLUDE_DIR=/usr/include/opencascade \
  56. -DOCC_LIBRARY_DIR=/usr/lib \
  57. -DOPENCOLLADA_INCLUDE_DIR=/usr/include/opencollada \
  58. -DOPENCOLLADA_LIBRARY_DIR=/usr/lib/opencollada \
  59. -DICU_INCLUDE_DIR=/usr/include/unicode \
  60. -DICU_LIBRARY_DIR=/usr/lib \
  61. -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python${_pythonver:7:3} \
  62. -DPYTHON_LIBRARY:FILEPATH=/usr/lib64/libpython${_pythonver:7:3}.so \
  63. -DSWIG_EXECUTABLE=/usr/bin/swig \
  64. ../cmake
  65. make
  66. }
  67.  
  68. package() {
  69. cd "${srcdir}/IfcOpenShell/build"
  70. make DESTDIR="${pkgdir}" install
  71.  
  72. cd "${srcdir}/IfcOpenShell"
  73. install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  74.  
  75. # file already provided by ifcopenshell/ifcopenshell-git
  76. rm -f "${pkgdir}"/usr/lib/libIfc*.a
  77. rm -rf "${pkgdir}/usr/bin"
  78. rm -rf "${pkgdir}/usr/include"
  79. }
  80.  
  81. md5sums=('SKIP')
RAW Paste Data