1 |
commit: f50e31a1de22f65272d98b092b777c641cd36707 |
2 |
Author: Christophe Paccolat <chr.paccolat <AT> mycable <DOT> ch> |
3 |
AuthorDate: Mon Dec 3 13:20:18 2012 +0000 |
4 |
Commit: Justin Lecher <jlec <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 3 07:25:45 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=f50e31a1 |
7 |
|
8 |
sci-mathematics/netgen: Version bump |
9 |
|
10 |
--- |
11 |
.../netgen-5.x-compile-against-occ-6.5.x.patch | 28 +++++++ |
12 |
.../netgen/files/netgen-5.x-missing-define.patch | 38 ++++++++++ |
13 |
sci-mathematics/netgen/files/netgen.desktop | 5 +- |
14 |
sci-mathematics/netgen/netgen-5.0.0.ebuild | 88 ++++++++++++++++++++++ |
15 |
4 files changed, 156 insertions(+), 3 deletions(-) |
16 |
|
17 |
diff --git a/sci-mathematics/netgen/files/netgen-5.x-compile-against-occ-6.5.x.patch b/sci-mathematics/netgen/files/netgen-5.x-compile-against-occ-6.5.x.patch |
18 |
new file mode 100644 |
19 |
index 0000000..ce581ce |
20 |
--- /dev/null |
21 |
+++ b/sci-mathematics/netgen/files/netgen-5.x-compile-against-occ-6.5.x.patch |
22 |
@@ -0,0 +1,28 @@ |
23 |
+--- libsrc/occ/Partition_Spliter.cxx.old 2012-11-14 16:14:39.440625195 +0100 |
24 |
++++ libsrc/occ/Partition_Spliter.cxx 2012-11-14 16:15:20.035646075 +0100 |
25 |
+@@ -1169,8 +1169,8 @@ |
26 |
+ for (; j<=nbj && ok; ++j) { |
27 |
+ if (Extrema.IsMin(j)) { |
28 |
+ hasMin = Standard_True; |
29 |
+- ok = Extrema.Value(j) <= tol; // V6.3 |
30 |
+- // ok = Extrema.SquareDistance(j) <= tol; // V6.5 |
31 |
++ // ok = Extrema.Value(j) <= tol; // V6.3 |
32 |
++ ok = Extrema.SquareDistance(j) <= tol; // V6.5 |
33 |
+ } |
34 |
+ } |
35 |
+ } |
36 |
+--- libsrc/occ/Partition_Inter3d.cxx.old 2012-11-14 16:13:11.149581085 +0100 |
37 |
++++ libsrc/occ/Partition_Inter3d.cxx 2012-11-14 16:14:20.017615214 +0100 |
38 |
+@@ -243,9 +243,9 @@ |
39 |
+ Standard_Integer i, nbExt = anExtPS.NbExt(); |
40 |
+ Extrema_POnSurf aPOnSurf; |
41 |
+ for (i = 1; i <= nbExt; ++i ) |
42 |
+- if (anExtPS.Value( i ) <= TolE) // V6.3 |
43 |
+- // if (anExtPS.SquareDistance( i ) <= TolE) // V6.5 |
44 |
+- { |
45 |
++ // if (anExtPS.Value( i ) <= TolE) // V6.3 |
46 |
++ if (anExtPS.SquareDistance( i ) <= TolE) // V6.5 |
47 |
++ { |
48 |
+ aPOnSurf = anExtPS.Point( i ); |
49 |
+ break; |
50 |
+ } |
51 |
|
52 |
diff --git a/sci-mathematics/netgen/files/netgen-5.x-missing-define.patch b/sci-mathematics/netgen/files/netgen-5.x-missing-define.patch |
53 |
new file mode 100644 |
54 |
index 0000000..4ad5c52 |
55 |
--- /dev/null |
56 |
+++ b/sci-mathematics/netgen/files/netgen-5.x-missing-define.patch |
57 |
@@ -0,0 +1,38 @@ |
58 |
+--- libsrc/occ/Partition_Loop2d.cxx.orig 2012-11-14 21:16:22.876287910 +0100 |
59 |
++++ libsrc/occ/Partition_Loop2d.cxx 2012-11-14 21:22:30.909650554 +0100 |
60 |
+@@ -13,6 +13,7 @@ |
61 |
+ |
62 |
+ //using namespace std; |
63 |
+ #include <climits> |
64 |
++#include <cmath> |
65 |
+ #include "Partition_Loop2d.ixx" |
66 |
+ |
67 |
+ #include "utilities.h" |
68 |
+@@ -210,7 +211,7 @@ |
69 |
+ Cc->D1(uc, PC, CTg1); |
70 |
+ if (!isForward) CTg1.Reverse(); |
71 |
+ |
72 |
+- Standard_Real anglemin = 3 * PI, tolAng = 1.e-8; |
73 |
++ Standard_Real anglemin = 3 * M_PI, tolAng = 1.e-8; |
74 |
+ |
75 |
+ // select an edge whose first derivative is most left of CTg1 |
76 |
+ // ie an angle between Tg1 and CTg1 is least |
77 |
+@@ -234,7 +235,7 @@ |
78 |
+ // -PI < angle < PI |
79 |
+ Standard_Real angle = Tg1.Angle(CTg1); |
80 |
+ |
81 |
+- if (PI - Abs(angle) <= tolAng) |
82 |
++ if (M_PI - Abs(angle) <= tolAng) |
83 |
+ { |
84 |
+ // an angle is too close to PI; assure that an angle sign really |
85 |
+ // reflects an edge position: +PI - an edge is worst, |
86 |
+--- configure.ac.orig 2012-11-15 14:55:45.048938870 +0100 |
87 |
++++ configure.ac 2012-11-15 14:55:12.545923777 +0100 |
88 |
+@@ -14,6 +14,7 @@ |
89 |
+ AC_DISABLE_STATIC |
90 |
+ |
91 |
+ AC_LANG([C++]) |
92 |
++AM_PROG_AR |
93 |
+ AC_PROG_CXX |
94 |
+ AC_PROG_LIBTOOL |
95 |
+ LT_INIT |
96 |
|
97 |
diff --git a/sci-mathematics/netgen/files/netgen.desktop b/sci-mathematics/netgen/files/netgen.desktop |
98 |
index 9b48d69..714ba53 100644 |
99 |
--- a/sci-mathematics/netgen/files/netgen.desktop |
100 |
+++ b/sci-mathematics/netgen/files/netgen.desktop |
101 |
@@ -1,9 +1,8 @@ |
102 |
[Desktop Entry] |
103 |
-Encoding=UTF-8 |
104 |
Name=Netgen |
105 |
Comment=3D modeling, Mesh generation. |
106 |
Exec=/usr/bin/netgen |
107 |
Icon=netgen |
108 |
-Terminal=0 |
109 |
+Terminal=false |
110 |
Type=Application |
111 |
-Categories=Graphics;Application; |
112 |
+Categories=Graphics; |
113 |
|
114 |
diff --git a/sci-mathematics/netgen/netgen-5.0.0.ebuild b/sci-mathematics/netgen/netgen-5.0.0.ebuild |
115 |
new file mode 100644 |
116 |
index 0000000..f0588d5 |
117 |
--- /dev/null |
118 |
+++ b/sci-mathematics/netgen/netgen-5.0.0.ebuild |
119 |
@@ -0,0 +1,88 @@ |
120 |
+# Copyright 1999-2011 Gentoo Foundation |
121 |
+# Distributed under the terms of the GNU General Public License v2 |
122 |
+# $Header: $ |
123 |
+ |
124 |
+EAPI="2" |
125 |
+ |
126 |
+inherit autotools eutils flag-o-matic multilib versionator |
127 |
+ |
128 |
+MY_PN=${PN}-mesher |
129 |
+MY_PV=$(get_version_component_range 1-2) |
130 |
+DESCRIPTION="NETGEN is an automatic 3d tetrahedral mesh generator" |
131 |
+HOMEPAGE="http://www.hpfem.jku.at/netgen/" |
132 |
+SRC_URI="mirror://sourceforge/project/${MY_PN}/${MY_PN}/${MY_PV}/${P}.tar.gz" |
133 |
+ |
134 |
+LICENSE="LGPL-2.1" |
135 |
+KEYWORDS="~amd64 ~x86" |
136 |
+IUSE="-ffmpeg jpeg -mpi opencascade" |
137 |
+SLOT="0" |
138 |
+ |
139 |
+DEPEND="dev-tcltk/tix |
140 |
+ dev-tcltk/togl:1.7 |
141 |
+ virtual/opengl |
142 |
+ x11-libs/libXmu |
143 |
+ opencascade? ( sci-libs/opencascade ) |
144 |
+ ffmpeg? ( media-video/ffmpeg ) |
145 |
+ jpeg? ( virtual/jpeg ) |
146 |
+ mpi? ( virtual/mpi ) " |
147 |
+RDEPEND="${DEPEND}" |
148 |
+# Note, MPI has not be tested. |
149 |
+ |
150 |
+src_prepare() |
151 |
+{ |
152 |
+ # Adapted from http://sourceforge.net/projects/netgen-mesher/forums/forum/905307/topic/5422824 |
153 |
+ epatch "${FILESDIR}/${PN}-5.x-compile-against-occ-6.5.x.patch" |
154 |
+ epatch "${FILESDIR}/${PN}-5.x-missing-define.patch" |
155 |
+ eautoreconf |
156 |
+} |
157 |
+ |
158 |
+src_configure() { |
159 |
+ # This is not the most clever way to deal with these flags |
160 |
+ # but --disable-xxx does not seem to work correcly, so... |
161 |
+ sed -i -e 's:-lTogl:-lTogl1.7:' ng/Makefile.am || die |
162 |
+ local myconf="--with-togl=/usr/$(get_libdir)/Togl1.7" |
163 |
+ |
164 |
+ if use opencascade; then |
165 |
+ myconf="${myconf} --enable-occ --with-occ=$CASROOT" |
166 |
+ append-ldflags -L$CASROOT/lin/$(get_libdir) |
167 |
+ fi |
168 |
+ |
169 |
+ use mpi && myconf="${myconf} --enable-parallel" |
170 |
+ use ffmpeg && myconf="${myconf} --enable-ffmpeg" |
171 |
+ use jpeg && myconf="${myconf} --enable-jpeglib" |
172 |
+ |
173 |
+ append-cppflags -I/usr/include/togl-1.7 |
174 |
+ |
175 |
+ econf \ |
176 |
+ ${myconf} |
177 |
+ |
178 |
+ # This would be the more elegant way: |
179 |
+# econf \ |
180 |
+# $(use_enable opencascade occ) \ |
181 |
+# $(use_with opencascade "occ=$CASROOT") \ |
182 |
+# $(use_enable mpi parallel) \ |
183 |
+# $(use_enable ffmpeg) \ |
184 |
+# $(use_enable jpeg jpeglib) |
185 |
+} |
186 |
+ |
187 |
+src_install() { |
188 |
+ local NETGENDIR="/usr/share/netgen" |
189 |
+ |
190 |
+ echo -e "NETGENDIR=${NETGENDIR} \nLDPATH=/usr/$(get_libdir)/Togl1.7" > ./99netgen |
191 |
+ doenvd 99netgen |
192 |
+ |
193 |
+ emake DESTDIR="${D}" install || die "make install failed" |
194 |
+ mv "${D}"/usr/bin/{*.tcl,*.ocf} "${D}${NETGENDIR}" |
195 |
+ |
196 |
+ # Install icon and .desktop for menu entry |
197 |
+ doicon "${FILESDIR}"/${PN}.png || die "doicon failed" |
198 |
+ domenu "${FILESDIR}"/${PN}.desktop || die "domenu failed" |
199 |
+} |
200 |
+ |
201 |
+pkg_postinst() { |
202 |
+ elog "Please make sure to update your environment variables:" |
203 |
+ elog "env-update && source /etc/profile" |
204 |
+ elog "Netgen ebuild is still under development." |
205 |
+ elog "Help us improve the ebuild in:" |
206 |
+ elog "http://bugs.gentoo.org/show_bug.cgi?id=155424" |
207 |
+} |