aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-misc/elmer-gui')
-rw-r--r--sci-misc/elmer-gui/elmer-gui-9999.ebuild153
-rw-r--r--sci-misc/elmer-gui/files/elmer-gui-netgen-fixes.patch11
-rw-r--r--sci-misc/elmer-gui/metadata.xml18
3 files changed, 182 insertions, 0 deletions
diff --git a/sci-misc/elmer-gui/elmer-gui-9999.ebuild b/sci-misc/elmer-gui/elmer-gui-9999.ebuild
new file mode 100644
index 000000000..2d006c9ff
--- /dev/null
+++ b/sci-misc/elmer-gui/elmer-gui-9999.ebuild
@@ -0,0 +1,153 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="4"
+
+inherit autotools eutils qt4-r2 subversion python versionator
+
+ELMER_ROOT="elmerfem"
+MY_PN=ElmerGUI
+
+DESCRIPTION="Elmer is a collection of finite element programs, libraries, and visualization tools, New Elmer pre-processor"
+HOMEPAGE="http://www.csc.fi/english/pages/elmer"
+#SRC_URI="http://elmerfem.svn.sourceforge.net/viewvc/${ELMER_ROOT}/release/${PV}/${MY_PN}/?view=tar -> ${P}.tar.gz"
+SRC_URI=""
+RESTRICT="mirror"
+ESVN_REPO_URI="https://elmerfem.svn.sourceforge.net/svnroot/elmerfem/trunk/${MY_PN}"
+ESVN_PROJECT="${MY_PN}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug bundled_netgen matc opencascade python qwt vtk"
+
+REQUIRED_USE="opencascade? ( vtk )"
+
+DEPEND="=sci-libs/elmer-eio-${PV}
+ !bundled_netgen? ( sci-mathematics/netgen )
+ virtual/glu
+ || ( =sci-misc/elmer-post-${PV}
+ >=sci-libs/vtk-5.0.0[qt4,python?]
+ )
+ matc? ( =sci-libs/matc-${PV} )
+ vtk? ( >=sci-libs/vtk-5.0.0[qt4,python?] )
+ opencascade? ( >=sci-libs/opencascade-6.3 )
+ python? ( <=dev-python/pythonqt-1.1 )
+ x11-libs/qwt:5
+ || ( >=x11-libs/qt-core-4.3:4
+ ( x11-libs/qt-core:5
+ x11-libs/qt-xml:5
+ )
+ )
+ >=x11-libs/qt-opengl-4.3
+ >=x11-libs/qt-script-4.3"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Do not build bundled matc and PythonQt
+ sed -i \
+ -e 's/matc//' \
+ -e 's/PythonQt//' \
+ ${MY_PN}.pro || die
+
+ # Ideally we would avoid buildling thirdparty code
+ # and use a separate package but this currently fails
+ # to build. ElmerGui provides its own patched version of
+ # NetGen. Currently considering backporting them to
+ # sci-mathematics/netgen
+ if use !bundled_netgen; then
+ sed -i 's/netgen//' ${MY_PN}.pro || die
+ sed -i \
+ -e "s:INCLUDEPATH += ../netgen/libsrc/interface:INCLUDEPATH += ${EPREFIX}/usr/include:g" \
+ -e "s:LIBPATH += ../netgen/ngcore:LIBPATH += ${EPREFIX}/usr/$(get_libdir):g" \
+ -e "s:LIBS += -lng:LIBS += -lnglib:g" \
+ Application/Application.pro || die
+
+ eerror "${PN} currently fails to build against sci-mathematics/netgen."
+ fi
+
+ # Fix install path
+ sed -i \
+ -e 's|unix: ELMER_HOME = /usr/local|unix: ELMER_HOME = /usr|g' \
+ ${MY_PN}.pri || die
+
+ if use amd64; then
+ sed -i 's/32/64/' ${MY_PN}.pri || die
+ fi
+
+ if use !qwt; then
+ # QWT is activated by default, disable
+ sed -i 's/DEFINES += EG_QWT//' ${MY_PN}.pri || die
+ else
+ # Detect x11-libs/qwt version and fix paths
+ local QWT_VER=`echo $(best_version "x11-libs/qwt") | sed 's:x11-libs/qwt-::'`
+ local QWT_MAJOR=$(get_major_version ${QWT_VER})
+ local QWT_MAJOR=5
+
+ if [[ ${QWT_MAJOR} -lt 6 ]]; then
+ local QWT_LIBS=-lqwt
+ else
+ local QWT_LIBS=-lqwt${QWT_MAJOR}
+ fi
+
+ local QWT_INCLUDEPATH=${EPREFIX}/usr/include/qwt${QWT_MAJOR}
+ local QWT_LIBPATH=${EPREFIX}/usr/$(get_libdir)
+
+ sed -i \
+ -e "s:QWT_INCLUDEPATH.*:QWT_INCLUDEPATH = ${QWT_INCLUDEPATH}:g" \
+ -e "s:QWT_LIBPATH.*:QWT_LIBPATH = ${QWT_LIBPATH}:g" \
+ -e "s:QWT_LIBS.*:QWT_LIBS = ${QWT_LIBS}:g" \
+ ${MY_PN}.pri || die
+ fi
+
+ if use !vtk; then
+ # VTK is activated by default, disable
+ sed -i 's/DEFINES += EG_VTK//' ${MY_PN}.pri || die
+ else
+ # Fix paths
+ local VTK_VER=`echo ${VTK_DIR} | cut -d/ -f4`
+ sed -i \
+ -e "s:VTK_INCLUDEPATH.*:VTK_INCLUDEPATH = ${EPREFIX}/usr/include/${VTK_VER}:g" \
+ -e "s:VTK_LIBPATH.*:VTK_LIBPATH = ${VTK_DIR}:g" \
+ ${MY_PN}.pri || die
+ fi
+
+ if use !matc; then
+ sed -i 's/DEFINES += EG_MATC//' ${MY_PN}.pri || die
+ else
+ sed -i "s:LIBPATH += ../matc/lib:LIBPATH += ${EPREFIX}/usr/$(get_libdir):g" Application/Application.pro || die
+ fi
+
+ if use !opencascade; then
+ # Opencascade is activated by default, disable
+ sed -i 's/DEFINES += EG_OCC//' ${MY_PN}.pri || die
+ else
+ # Fix paths, depend on portage version of opencascade
+ sed -i \
+ -e "s:OCC_INCLUDEPATH.*:OCC_INCLUDEPATH = ${CASROOT}/inc:g" \
+ -e "s:OCC_LIBPATH.*:OCC_LIBPATH = ${CASROOT}/$(get_libdir):g" \
+ ${MY_PN}.pri || die
+ fi
+
+ if use python; then
+ # Fix paths
+ sed -i \
+ -e 's/DEFINES -= EG_PYTHON/DEFINES += EG_PYTHON/g' \
+ -e "s:PY_INCLUDEPATH.*:PY_INCLUDEPATH = $(python_get_includedir):g" \
+ -e "s:PY_LIBPATH.*:PY_LIBPATH = $(python_get_libdir):g" \
+ -e "s:PY_LIBS.*:PY_LIBS = $(python_get_library -l):g" \
+ ${MY_PN}.pri || die
+
+ # Fix paths and invert Python(Qt) linking order to work with --Wl,--as-needed
+ sed -i \
+ -e "s:INCLUDEPATH += $${PY_INCLUDEPATH} ../PythonQt/src:${EPREFIX}/usr/include/PythonQt:g" \
+ -e "s:LIBPATH += $${PY_LIBPATH} ../PythonQt/lib:${EPREFIX}/usr/$(get_libdir):g" \
+ -e "s:LIBS += $${PY_LIBS} -lPythonQt:LIBS += -lPythonQt $${PY_LIBS}:" \
+ Application/Application.pro || die
+ fi
+}
+
+src_configure() {
+ eqmake4 "${S}" ./${MY_PN}.pro
+}
diff --git a/sci-misc/elmer-gui/files/elmer-gui-netgen-fixes.patch b/sci-misc/elmer-gui/files/elmer-gui-netgen-fixes.patch
new file mode 100644
index 000000000..0918c8ea9
--- /dev/null
+++ b/sci-misc/elmer-gui/files/elmer-gui-netgen-fixes.patch
@@ -0,0 +1,11 @@
+--- /var/tmp/portage/sci-misc/elmer-gui-9999/work/elmer-gui-9999/Application/src/mainwindow.cpp.auto-diff-temp 2012-11-15 17:16:40.602279216 +0100
++++ /var/tmp/portage/sci-misc/elmer-gui-9999/work/elmer-gui-9999/Application/src/mainwindow.cpp 2012-11-15 17:16:52.226288133 +0100
+@@ -4778,7 +4778,7 @@
+
+ mp.maxh = meshControl->nglibMaxH.toDouble();
+ mp.fineness = meshControl->nglibFineness.toDouble();
+- mp.secondorder = 0;
++ mp.second_order = 0;
+ mp.meshsize_filename = backgroundmesh;
+
+ if(ngDim == 3) {
diff --git a/sci-misc/elmer-gui/metadata.xml b/sci-misc/elmer-gui/metadata.xml
new file mode 100644
index 000000000..0a4f88ac7
--- /dev/null
+++ b/sci-misc/elmer-gui/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <upstream>
+ <bugs-to>mailto:chr.paccolat@mycable.ch</bugs-to>
+ <changelog></changelog>
+ <doc>http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3</doc>
+ </upstream>
+ <maintainer><email>chr.paccolat@mycable.ch</email></maintainer>
+ <use>
+ <flag name="matc">Add support to evaluate mathematical expression in input files / postprocessor </flag>
+ <flag name="opencascade">Use OpenCASCADE to import CAD files</flag>
+ <flag name="python">Add support for python scripting in the pre-processor</flag>
+ <flag name="qwt">Pull-in QWT to enable the convergence monitor</flag>
+ <flag name="vtk">Add support for the VTK post-processor backend (visualization)</flag>
+ </use>
+</pkgmetadata>
+