From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-864866-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 651AD1388C0
	for <garchives@archives.gentoo.org>; Mon, 22 Feb 2016 08:38:14 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id DF51D21C009;
	Mon, 22 Feb 2016 08:38:12 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id BF18821C001
	for <gentoo-commits@lists.gentoo.org>; Mon, 22 Feb 2016 08:38:11 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id C7079340B37
	for <gentoo-commits@lists.gentoo.org>; Mon, 22 Feb 2016 08:38:10 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 8E18014CD
	for <gentoo-commits@lists.gentoo.org>; Mon, 22 Feb 2016 08:38:07 +0000 (UTC)
From: "Justin Lecher" <jlec@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Justin Lecher" <jlec@gentoo.org>
Message-ID: <1456130191.5ec3233859aac528082c693381300f5b237c4a91.jlec@gentoo>
Subject: [gentoo-commits] proj/sci:master commit in: sci-mathematics/netgen/, sci-mathematics/netgen/files/
X-VCS-Repository: proj/sci
X-VCS-Files: sci-mathematics/netgen/files/netgen-5.x-metis-numflag.patch sci-mathematics/netgen/netgen-5.3.1.ebuild
X-VCS-Directories: sci-mathematics/netgen/files/ sci-mathematics/netgen/
X-VCS-Committer: jlec
X-VCS-Committer-Name: Justin Lecher
X-VCS-Revision: 5ec3233859aac528082c693381300f5b237c4a91
X-VCS-Branch: master
Date: Mon, 22 Feb 2016 08:38:07 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 2ad53f19-54a2-4751-b685-3a28a09ac071
X-Archives-Hash: 61ced6b4f44d202ed56c9753f0a41c75

commit:     5ec3233859aac528082c693381300f5b237c4a91
Author:     Grégory Salvan <apieum <AT> gmail <DOT> com>
AuthorDate: Thu Feb 11 18:24:57 2016 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Mon Feb 22 08:36:31 2016 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=5ec32338

added netgen-5.3.1 ebuild and patch for metis

 .../netgen/files/netgen-5.x-metis-numflag.patch    | 21 +++++
 sci-mathematics/netgen/netgen-5.3.1.ebuild         | 89 ++++++++++++++++++++++
 2 files changed, 110 insertions(+)

diff --git a/sci-mathematics/netgen/files/netgen-5.x-metis-numflag.patch b/sci-mathematics/netgen/files/netgen-5.x-metis-numflag.patch
new file mode 100644
index 0000000..4c32304
--- /dev/null
+++ b/sci-mathematics/netgen/files/netgen-5.x-metis-numflag.patch
@@ -0,0 +1,21 @@
+diff -uwrN ./netgen-5.3.1/libsrc/meshing/parallelmesh.cpp netgen-5.3.1.ORIG/libsrc/meshing/parallelmesh.cpp
+--- ./netgen-5.3.1/libsrc/meshing/parallelmesh.cpp	2016-02-11 19:12:14.474185736 +0100
++++ netgen-5.3.1.ORIG/libsrc/meshing/parallelmesh.cpp	2014-08-29 11:54:05.000000000 +0200
+@@ -1318,7 +1318,7 @@
+     idxtype  *xadj, * adjacency, *v_weights = NULL, *e_weights = NULL;
+ 
+     int weightflag = 0;
+-    int numflag = 0;
++    // int numflag = 0;
+     int nparts = ntasks - 1;
+ 
+     int options[5];
+@@ -1485,7 +1485,7 @@
+     idxtype *v_weights = NULL, *e_weights = NULL;
+ 
+     int weightflag = 0;
+-    int numflag = 0;
++    // int numflag = 0;
+     int nparts = ntasks - 1;
+ 
+     int edgecut;

diff --git a/sci-mathematics/netgen/netgen-5.3.1.ebuild b/sci-mathematics/netgen/netgen-5.3.1.ebuild
new file mode 100644
index 0000000..8a2f60b
--- /dev/null
+++ b/sci-mathematics/netgen/netgen-5.3.1.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools eutils flag-o-matic multilib versionator
+
+MY_PN=${PN}-mesher
+MY_PV=$(get_version_component_range 1-2)
+DESCRIPTION="NETGEN is an automatic 3d tetrahedral mesh generator"
+HOMEPAGE="http://www.hpfem.jku.at/netgen/"
+SRC_URI="mirror://sourceforge/project/${MY_PN}/${MY_PN}/${MY_PV}/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="LGPL-2.1"
+KEYWORDS="~amd64 ~x86"
+IUSE="-ffmpeg jpeg -mpi opencascade"
+
+DEPEND="
+	dev-tcltk/tix
+	dev-tcltk/togl:1.7
+	virtual/opengl
+	x11-libs/libXmu
+	opencascade? ( sci-libs/opencascade:* )
+	ffmpeg? ( media-video/ffmpeg )
+	jpeg? ( virtual/jpeg:0= )
+	mpi? ( virtual/mpi ( || ( sci-libs/parmetis sci-libs/metis ) ) ) "
+RDEPEND="${DEPEND}"
+# Note, MPI has not be tested.
+
+src_prepare() {
+	# Adapted from http://sourceforge.net/projects/netgen-mesher/forums/forum/905307/topic/5422824
+	epatch "${FILESDIR}/${PN}-5.x-missing-define.patch"
+	epatch "${FILESDIR}/${PN}-5.x-metis-numflag.patch"
+	eautoreconf
+}
+
+src_configure() {
+	# This is not the most clever way to deal with these flags
+	# but --disable-xxx does not seem to work correcly, so...
+	sed -i -e 's:-lTogl:-lTogl1.7:' ng/Makefile.am || die
+	local myconf="--with-togl=/usr/$(get_libdir)/Togl1.7"
+
+	if use opencascade; then
+		myconf="${myconf} --enable-occ --with-occ=$CASROOT"
+		append-ldflags -L$CASROOT/lin/$(get_libdir)
+	fi
+	if use mpi; then
+		myconf="${myconf} --enable-parallel"
+		append-cppflags -I/usr/include/metis
+	fi
+	use ffmpeg && myconf="${myconf} --enable-ffmpeg"
+	use jpeg && myconf="${myconf} --enable-jpeglib"
+	append-cppflags -I/usr/include/togl-1.7
+
+	econf \
+		${myconf}
+
+	# This would be the more elegant way:
+# 	econf \
+# 		$(use_enable opencascade occ) \
+# 		$(use_with opencascade "occ=$CASROOT") \
+# 		$(use_enable mpi parallel) \
+# 		$(use_enable ffmpeg) \
+# 		$(use_enable jpeg jpeglib)
+}
+
+src_install() {
+	local NETGENDIR="/usr/share/netgen"
+
+	echo -e "NETGENDIR=${NETGENDIR} \nLDPATH=/usr/$(get_libdir)/Togl1.7" > ./99netgen
+	doenvd 99netgen
+
+	default
+	mv "${D}"/usr/bin/{*.tcl,*.ocf} "${D}${NETGENDIR}" || die
+
+	# Install icon and .desktop for menu entry
+	doicon "${FILESDIR}"/${PN}.png
+	domenu "${FILESDIR}"/${PN}.desktop
+}
+
+pkg_postinst() {
+	elog "Please make sure to update your environment variables:"
+	elog "env-update && source /etc/profile"
+	elog "Netgen ebuild is still under development."
+	elog "Help us improve the ebuild in:"
+	elog "http://bugs.gentoo.org/show_bug.cgi?id=155424"
+}