opencascade-6.9.0-r1.ebuild 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools eutils check-reqs multilib java-pkg-opt-2 flag-o-matic
  5. DESCRIPTION="Development platform for CAD/CAE, 3D surface/solid modeling and data exchange"
  6. HOMEPAGE="http://www.opencascade.org/"
  7. SRC_URI="http://files.opencascade.com/OCCT/OCC_${PV}_release/opencascade-${PV}.tgz"
  8. LICENSE="|| ( Open-CASCADE-LGPL-2.1-Exception-1.0 LGPL-2.1 )"
  9. SLOT="${PV}"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="debug doc examples freeimage gl2ps java qt4 +tbb +vtk"
  12. MY_VTK="vtk-6.1"
  13. DEPEND="app-eselect/eselect-opencascade
  14. dev-lang/tcl:0=
  15. dev-lang/tk:0=
  16. dev-tcltk/itcl
  17. dev-tcltk/itk
  18. dev-tcltk/tix
  19. media-libs/ftgl
  20. virtual/glu
  21. virtual/opengl
  22. x11-libs/libXmu
  23. freeimage? ( media-libs/freeimage )
  24. gl2ps? ( x11-libs/gl2ps )
  25. java? ( >=virtual/jdk-0:= )
  26. tbb? ( dev-cpp/tbb )
  27. vtk? ( || ( =sci-libs/${MY_VTK}*[imaging] =sci-libs/${MY_VTK}*[qt4] =sci-libs/${MY_VTK}*[rendering] =sci-libs/${MY_VTK}*[views] =sci-libs/${MY_VTK}*[all-modules] ) )"
  28. RDEPEND="${DEPEND}"
  29. # https://bugs.gentoo.org/show_bug.cgi?id=600514
  30. RESTRICT="fetch"
  31. CHECKREQS_MEMORY="256M"
  32. CHECKREQS_DISK_BUILD="3584M"
  33. pkg_setup() {
  34. check-reqs_pkg_setup
  35. java-pkg-opt-2_pkg_setup
  36. }
  37. src_prepare() {
  38. java-pkg-opt-2_src_prepare
  39. epatch \
  40. "${FILESDIR}"/${PN}-6.8.0-fixed-DESTDIR.patch
  41. # Feed environment variables used by Opencascade compilation
  42. my_install_dir=${EROOT}usr/$(get_libdir)/${P}/ros
  43. local my_env_install="#!/bin/sh -f
  44. if [ -z \"\$PATH\" ]; then
  45. export PATH=VAR_CASROOT/Linux/bin
  46. else
  47. export PATH=VAR_CASROOT/Linux/bin:\$PATH
  48. fi
  49. if [ -z \"\$LD_LIBRARY_PATH\" ]; then
  50. export LD_LIBRARY_PATH=VAR_CASROOT/Linux/lib
  51. else
  52. export LD_LIBRARY_PATH=VAR_CASROOT/Linux/lib:\$LD_LIBRARY_PATH
  53. fi"
  54. local my_sys_lib=${EROOT}usr/$(get_libdir)
  55. local my_env="CASROOT=VAR_CASROOT
  56. CSF_MDTVFontDirectory=VAR_CASROOT/src/FontMFT
  57. CSF_LANGUAGE=us
  58. MMGT_CLEAR=1
  59. CSF_EXCEPTION_PROMPT=1
  60. CSF_SHMessage=VAR_CASROOT/src/SHMessage
  61. CSF_MDTVTexturesDirectory=VAR_CASROOT/src/Textures
  62. CSF_XSMessage=VAR_CASROOT/src/XSMessage
  63. CSF_StandardDefaults=VAR_CASROOT/src/StdResource
  64. CSF_PluginDefaults=VAR_CASROOT/src/StdResource
  65. CSF_XCAFDefaults=VAR_CASROOT/src/StdResource
  66. CSF_StandardLiteDefaults=VAR_CASROOT/src/StdResource
  67. CSF_GraphicShr=VAR_CASROOT/Linux/lib/libTKOpenGl.so
  68. CSF_UnitsLexicon=VAR_CASROOT/src/UnitsAPI/Lexi_Expr.dat
  69. CSF_UnitsDefinition=VAR_CASROOT/src/UnitsAPI/Units.dat
  70. CSF_IGESDefaults=VAR_CASROOT/src/XSTEPResource
  71. CSF_STEPDefaults=VAR_CASROOT/src/XSTEPResource
  72. CSF_XmlOcafResource=VAR_CASROOT/src/XmlOcafResource
  73. CSF_MIGRATION_TYPES=VAR_CASROOT/src/StdResource/MigrationSheet.txt
  74. TCLHOME=${EROOT}usr/bin
  75. TCLLIBPATH=${my_sys_lib}
  76. ITK_LIBRARY=${my_sys_lib}/itk$(grep ITK_VER /usr/include/itk.h | sed 's/^.*"\(.*\)".*/\1/')
  77. ITCL_LIBRARY=${my_sys_lib}/itcl$(grep ITCL_VER /usr/include/itcl.h | sed 's/^.*"\(.*\)".*/\1/')
  78. TIX_LIBRARY=${my_sys_lib}/tix$(grep TIX_VER /usr/include/tix.h | sed 's/^.*"\(.*\)".*/\1/')
  79. TK_LIBRARY=${my_sys_lib}/tk$(grep TK_VER /usr/include/tk.h | sed 's/^.*"\(.*\)".*/\1/')
  80. TCL_LIBRARY=${my_sys_lib}/tcl$(grep TCL_VER /usr/include/tcl.h | sed 's/^.*"\(.*\)".*/\1/')"
  81. ( echo "${my_env_install}"
  82. echo "${my_env}" | sed -e "s:^:export :" ) \
  83. | sed -e "s:VAR_CASROOT:${S}:g" > env.sh || die
  84. source env.sh
  85. ( echo "PATH=${my_install_dir}/lin/bin"
  86. echo "LDPATH=${my_install_dir}/lin/$(get_libdir)"
  87. echo "${my_env}" | sed \
  88. -e "s:VAR_CASROOT:${my_install_dir}/lin:g" \
  89. -e "s:/Linux/lib/:/$(get_libdir)/:g" || die
  90. ) > 50${PN}
  91. append-cxxflags "-fpermissive"
  92. sed -e "/^AM_C_PROTOTYPES$/d" \
  93. -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" \
  94. -e "s:\$qt/include:\$qt/include/qt4:g"\
  95. -e "s:\$qt/lib:\$qt/$(get_libdir)/qt4:g"\
  96. -e "/CSF_VTK_LIB=/s:-${MY_VTK/vtk-}::g" \
  97. -i configure.ac || die
  98. eautoreconf
  99. }
  100. src_configure() {
  101. econf \
  102. --prefix=${my_install_dir}/lin --exec-prefix=${my_install_dir}/lin \
  103. --with-tcl="${EROOT}usr/$(get_libdir)" --with-tk="${EROOT}usr/$(get_libdir)" \
  104. --with-freetype="${EROOT}usr" \
  105. --with-ftgl="${EROOT}usr" \
  106. $(usex freeimage "--with-freeimage=${EROOT}usr" "") \
  107. $(usex gl2ps "--with-gl2ps=${EROOT}usr" "") \
  108. $(usex qt4 "--with-qt=${EROOT}usr" "") \
  109. $(usex tbb "--with-tbb-include=${EROOT}usr" "") \
  110. $(usex tbb "--with-tbb-library=${EROOT}usr" "") \
  111. $(use java && echo "--with-java-include=$(java-config -O)/include" || echo "--without-java-include") \
  112. $(usex vtk "--with-vtk-include=${EROOT}usr/include/${MY_VTK}" "") \
  113. $(usex vtk "--with-vtk-library=${EROOT}usr/$(get_libdir)" "") \
  114. $(use_enable debug) \
  115. $(use_enable !debug production)
  116. }
  117. src_install() {
  118. emake DESTDIR="${D}" install
  119. prune_libtool_files
  120. # Symlinks for keeping original OpenCascade folder structure and
  121. # add a link lib to $(get_libdir) if we are e.g. on amd64 multilib
  122. if [ "$(get_libdir)" != "lib" ]; then
  123. dosym "$(get_libdir)" "${my_install_dir}/lin/lib"
  124. fi
  125. insinto /etc/env.d/${PN}
  126. newins 50${PN} ${PV}
  127. if use examples ; then
  128. insinto /usr/share/doc/${PF}/examples
  129. doins -r data
  130. doins -r samples
  131. fi
  132. if use doc; then
  133. insinto /usr/share/doc/${PF}
  134. doins -r doc/{overview,pdf,refman}
  135. fi
  136. }
  137. pkg_postinst() {
  138. eselect ${PN} set ${PV}
  139. einfo
  140. elog "After upgrading OpenCASCADE you may have to rebuild packages depending on it."
  141. elog "You get a list by running \"equery depends sci-libs/opencascade\""
  142. elog "revdep-rebuild does NOT suffice."
  143. einfo
  144. }