# 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 pyconsole glviewer plot2dviewer supervgraphviewer occviewer vtkviewer salomeobject opengl openpbs mpi X debug" RESTRICT="fetch" RDEPEND="doc? ( app-doc/doxygen media-gfx/graphviz ) opengl? ( virtual/opengl ) mpi? ( sys-cluster/mpich2 ) openpbs? ( sys-cluster/openpbs ) debug? ( dev-util/cppunit )" DEPEND="${RDEPEND} sys-devel/bison sys-devel/flex sci-libs/hdf5 >=dev-python/PyQt-3.13 >=dev-python/sip-4.1.3 >=dev-lang/python-2.3 dev-python/omniorbpy dev-python/numeric dev-python/docutils dev-lang/swig dev-libs/boost x11-libs/qwt >=x11-libs/qt-3.3.3 dev-lang/tk dev-lang/tcl sci-libs/vtk net-misc/omniORB >=sci-libs/opencascade-6.1 sys-devel/autoconf sys-devel/automake sys-devel/libtool >=sci-misc/salome-kernel-3.2.6" MODULE_NAME="GUI" MY_S="${WORKDIR}/src${PV}/GUI_SRC_${PV}" INSTALL_DIR="/opt/salome-${PV}/${MODULE_NAME}" GUI_ROOT_DIR="/opt/salome-${PV}/${MODULE_NAME}" 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} cd ${WORKDIR}/src${PV} epatch ${FILESDIR}/salome-gui-3.2.6.patch epatch ${FILESDIR}/salome-gui-3.2.6_sip-4.1.7.patch # 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 epatch ${FILESDIR}/salome-gui-vtk-5.0.patch else einfo "vtk version 4 or prior detected"; fi } src_compile() { local myconf cd "${MY_S}" rm -r -f autom4te.cache ewarn "The 'threads' flag MUST be ON and boost (at least) must be rebuild with this flag on" ./build_configure # 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 # Compiler and linker flags if use amd64 ; then append-flags -m64 fi # Fix a bug # # Fix a bug concerning a missing header append-flags -I${MY_S}/../KERNEL_SRC_${PV}/src/Basics/Test # # 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}" if use X; then myconf="${myconf} --with-x" if use opengl; then myconf="${myconf} --with-opengl" else myconf="${myconf} --without-opengl" fi else myconf="${myconf} --without-x" fi if use !openpbs; then myconf="${myconf} --without-openpbs" fi if use !corba; then myconf="${myconf} --disable-corba-gen" fi if use !pyconsole; then myconf="${myconf} --disable-pyConsole" fi if use !glviewer; then myconf="${myconf} --disable-glViewer" fi if use !plot2dviewer; then myconf="${myconf} --disable-plot2dViewer" fi if use !supervgraphviewer; then myconf="${myconf} --disable-supervGraphViewer" fi if use !occviewer; then myconf="${myconf} --disable-occViewer" fi if use !vtkviewer; then myconf="${myconf} --disable-vtkViewer" fi if use !salomeobject; then myconf="${myconf} --disable-salomeObject" fi if use !debug; then myconf="${myconf} --enable-production --without-cppunit" else myconf="${myconf} --enable-debug" fi if use mpi; then myconf="${myconf} --with-mpich" fi econf --prefix=${INSTALL_DIR} --datadir=${INSTALL_DIR}/share --docdir=${INSTALL_DIR}/share/doc/salome --infodir=${INSTALL_DIR}/share/info ${myconf} || die "configuration failed" MAKEOPTS="-j1" emake || die "Compilation failed" } src_install() { cd ${MY_S} emake prefix="${D}/${INSTALL_DIR}" docdir="${D}/${INSTALL_DIR}/share/doc/salome" infodir="${D}/${INSTALL_DIR}/share/info" datadir="${D}/${INSTALL_DIR}/share" install || die "emake install failed" echo "${MODULE_NAME}_ROOT_DIR=${INSTALL_DIR}" > ./90${P} echo "LDPATH=${INSTALL_DIR}/lib/salome" >> ./90${P} echo "PATH=${INSTALL_DIR}/bin/salome" >> ./90${P} dodir /etc/env.d insinto /etc/env.d doins 90${P} rm adm_local/Makefile adm_local/unix/make_commence adm_local/unix/make_conclude adm_local/unix/make_omniorb insinto "${INSTALL_DIR}" doins -r adm_local }