# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 inherit autotools distutils eutils flag-o-matic toolchain-funcs versionator python DESCRIPTION="SALOME : The Open Source Integration Platform for Numerical Simulation" HOMEPAGE="http://www.salome-platform.org" SRC_URI="salome-3.2.6.tar.gz" LICENSE="GPL-2" KEYWORDS="amd64 x86" SLOT="0" IUSE="doc corba opengl openpbs mpi X debug" RESTRICT="fetch" RDEPEND="doc? ( app-doc/doxygen media-gfx/graphviz ) opengl? ( virtual/opengl ) mpi? ( sys-cluster/mpich ) openpbs? ( sys-cluster/openpbs ) debug? ( dev-util/cppunit )" DEPEND="${RDEPEND} =sci-misc/salome-kernel-3.2.6 =sci-misc/salome-med-3.2.6 =sci-misc/salome-geom-3.2.6 sci-libs/vtk" MODULE_NAME="SMESH" MY_S="${WORKDIR}/src${PV}/${MODULE_NAME}_SRC_${PV}" MY_W="${WORKDIR}/build" pkg_nofetch() { einfo "You have to download manually the source code. You can download it from :" einfo " http://www.salome-platform.org/download/dl326" einfo "" einfo "Put the archive in the \"/usr/portage/distfile\" directory and rename it \"salome-3.2.6.tar.gz\"" } src_unpack() { unpack ${A} mkdir ${MY_W} cd ${MY_S} epatch ${FILESDIR}/salome-smesh-3.2.6.patch epatch ${FILESDIR}/salome-smesh-3.2.6_debug.patch epatch ${FILESDIR}/salome-smesh-3.2.6_GetSource.patch } src_compile() { local myconf cd "${MY_S}" ewarn "The 'threads' flag MUST be ON and boost (at least) must be rebuild with this flag on" ./build_configure # If vtk-5.O is used, include directory is named vtk-5.0 and not vtk if has_version ">=sci-libs/vtk-5.0"; then einfo "vtk version 5 detected" append-flags -I/usr/include/vtk-5.0 else einfo "vtk version 4 or prior detected"; fi # CXXFLAGS are slightly modified to allow the compilation of # salome-gui with OpenCascade and gcc-4.1.x if version_is_at_least "4.1" $(gcc-version) ; then append-flags -ffriend-injection -fpermissive fi # # Configuration # if use opengl && use !X; then ewarn "OpenGL functionnalities imply X support! Check your USE flags configuration." die fi myconf="--with-kernel=${KERNEL_ROOT_DIR}" myconf="${myconf} --prefix=${D}opt/salome-${PV}/${MODULE_NAME}" if use X; then myconf="${myconf} --with-x --with-xmu-include=/usr/include --with-xmu-library=/usr/lib" if use opengl; then myconf="${myconf} --with-gl-include=/usr/include --with-gl-library=/usr/lib" else myconf="${myconf} --without-opengl" fi else myconf="${myconf} --without-x --without-gl --without-xmu" fi if use !debug; then myconf="${myconf} --disable-debug --enable-production --without-cppunit" else myconf="${myconf} --enable-debug" fi # if use !mpi; then # myconf="${myconf} --without-mpi --without-mpich" # fi if use !openpbs; then myconf="${myconf} --without-openpbs" fi cd ${MY_W} ${MY_S}/configure ${myconf} || die "econf failed" make -j1 || die "Compilation failed" } src_install() { cd ${MY_W} mkdir ${D}opt/salome-${PV}/${MODULE_NAME} -p make install || dies "install failed" echo "${MODULE_NAME}_ROOT_DIR=/opt/salome-${PV}/${MODULE_NAME}" > ${D}/etc/env.d/90salome-${MODULE_NAME_LOWER} # # Checking for relocation # cd ${D}opt/salome-${PV}/${MODULE_NAME} FileList="lib/salome/libMEFISTO2D.la lib/salome/libMeshDriverDAT.la lib/salome/libMeshDriver.la lib/salome/libMeshDriverMED.la lib/salome/libMeshDriverSTL.la lib/salome/libMeshDriverUNV.la lib/salome/libSMDS.la lib/salome/libSMESHClient.la lib/salome/libSMESHControls.la lib/salome/libSMESHDS.la lib/salome/libSMESHEngine.la lib/salome/libSMESHFiltersSelection.la lib/salome/libSMESHimpl.la lib/salome/libSMESH.la lib/salome/libSMESHObject.la lib/salome/libSMESH_Swigcmodule.la lib/salome/libStdMeshersEngine.la lib/salome/libStdMeshersGUI.la lib/salome/libStdMeshers.la" for i in $FileList do einfo "Relocation : $i" sed -i "s@${D}@@g" $i done }