Gentoo Archives: gentoo-commits

From: Nicolas Bock <nicolasbock@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sys-cluster/charm/, sys-cluster/charm/files/
Date: Thu, 30 May 2013 18:27:08
Message-Id: 1369938401.55f5e6d4104fb2d81171d709ab53be68e7504c99.nicolasbock@gentoo
1 commit: 55f5e6d4104fb2d81171d709ab53be68e7504c99
2 Author: Nicolas Bock <nicolasbock <AT> gmail <DOT> com>
3 AuthorDate: Thu May 30 18:26:41 2013 +0000
4 Commit: Nicolas Bock <nicolasbock <AT> gmail <DOT> com>
5 CommitDate: Thu May 30 18:26:41 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=55f5e6d4
7
8 Version bump to sys-cluster/charm-6.5.0.
9
10 This ebuild fixes bugs 471740 and 432834.
11
12 Package-Manager: portage-2.2.0_alpha177
13
14 ---
15 sys-cluster/charm/ChangeLog | 10 ++
16 sys-cluster/charm/charm-6.5.0.ebuild | 176 +++++++++++++++++++++
17 .../charm/files/charm-6.5.0-charmc-gentoo.patch | 25 +++
18 sys-cluster/charm/metadata.xml | 10 ++
19 4 files changed, 221 insertions(+)
20
21 diff --git a/sys-cluster/charm/ChangeLog b/sys-cluster/charm/ChangeLog
22 new file mode 100644
23 index 0000000..1c91048
24 --- /dev/null
25 +++ b/sys-cluster/charm/ChangeLog
26 @@ -0,0 +1,10 @@
27 +# ChangeLog for sys-cluster/charm
28 +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
29 +# $Header: $
30 +
31 +*charm-6.5.0 (30 May 2013)
32 +
33 + 30 May 2013; Nicolas Bock <nicolasbock@×××××.com> +charm-6.5.0.ebuild,
34 + +files/charm-6.5.0-charmc-gentoo.patch, +metadata.xml:
35 + Version bump to sys-cluster/charm-6.5.0. This ebuild fixes bugs
36 + 471740 and 432834.
37
38 diff --git a/sys-cluster/charm/charm-6.5.0.ebuild b/sys-cluster/charm/charm-6.5.0.ebuild
39 new file mode 100644
40 index 0000000..a43c91a
41 --- /dev/null
42 +++ b/sys-cluster/charm/charm-6.5.0.ebuild
43 @@ -0,0 +1,176 @@
44 +# Copyright 1999-2013 Gentoo Foundation
45 +# Distributed under the terms of the GNU General Public License v2
46 +# $Header: $
47 +
48 +EAPI=5
49 +
50 +inherit eutils flag-o-matic fortran-2 multilib toolchain-funcs
51 +
52 +DESCRIPTION="Message-passing parallel language and runtime system"
53 +HOMEPAGE="http://charm.cs.uiuc.edu/"
54 +SRC_URI="http://charm.cs.uiuc.edu/distrib/${P}.tar.gz"
55 +
56 +LICENSE="charm"
57 +SLOT="0"
58 +KEYWORDS="~amd64 ~x86"
59 +IUSE="cmkopt charmshared tcp smp doc"
60 +
61 +DEPEND="
62 + doc? (
63 + >=app-text/poppler-0.12.3-r3[utils]
64 + dev-tex/latex2html
65 + virtual/tex-base )"
66 +RDEPEND=""
67 +
68 +case ${ARCH} in
69 + x86)
70 + CHARM_ARCH="net-linux" ;;
71 +
72 + amd64)
73 + CHARM_ARCH="net-linux-amd64" ;;
74 +esac
75 +
76 +FORTRAN_STANDARD="90"
77 +
78 +src_prepare() {
79 + #epatch "${FILESDIR}"/${P}-gcc-4.7.patch
80 +
81 + # For production, disable debugging features.
82 + CHARM_OPTS="--with-production"
83 +
84 + # TCP instead of default UDP for socket comunication
85 + # protocol
86 + if use tcp; then
87 + CHARM_OPTS="${CHARM_OPTS} tcp"
88 + fi
89 +
90 + # enable direct SMP support using shared memory
91 + if use smp; then
92 + CHARM_OPTS="${CHARM_OPTS} smp"
93 + fi
94 +
95 + # CMK optimization
96 + if use cmkopt; then
97 + append-flags -DCMK_OPTIMIZE=1
98 + fi
99 +
100 + sed \
101 + -e "/CMK_CF90/s:f90:${FC}:g" \
102 + -e "/CMK_CXX/s:g++:$(tc-getCXX):g" \
103 + -e "/CMK_CC/s:gcc:$(tc-getCC):g" \
104 + -e '/CMK_F90_MODINC/s:-p:-I:g' \
105 + -e "/CMK_LD/s:\"$: ${LDFLAGS} \":g" \
106 + -i src/arch/net-linux*/*sh
107 +
108 + sed \
109 + -e "s:\(-o conv-cpm\):${LDFLAGS} \1:g" \
110 + -e "s:\(-o charmxi\):${LDFLAGS} \1:g" \
111 + -e "s:\(-o charmrun-silent\):${LDFLAGS} \1:g" \
112 + -e "s:\(-o charmrun-notify\):${LDFLAGS} \1:g" \
113 + -e "s:\(-o charmrun\):${LDFLAGS} \1:g" \
114 + -e "s:\(-o charmd_faceless\):${LDFLAGS} \1:g" \
115 + -e "s:\(-o charmd\):${LDFLAGS} \1:g" \
116 + -i \
117 + src/scripts/Makefile \
118 + src/arch/net/charmrun/Makefile
119 +
120 + append-cflags -DALLOCA_H
121 +
122 + echo "charm opts: ${CHARM_OPTS}"
123 +}
124 +
125 +src_compile() {
126 + # build charmm++ first
127 + ./build charm++ ${CHARM_ARCH} ${CHARM_OPTS} ${MAKEOPTS} ${CFLAGS} || \
128 + die "Failed to build charm++"
129 +
130 + # make charmc play well with gentoo before
131 + # we move it into /usr/bin
132 + epatch "${FILESDIR}/charm-6.5.0-charmc-gentoo.patch"
133 +
134 + # make pdf/html docs
135 + if use doc; then
136 + cd "${S}"/doc
137 + make doc || die "failed to create pdf/html docs"
138 + fi
139 +}
140 +
141 +src_install() {
142 + sed -e "s|gentoo-include|${P}|" \
143 + -e "s|gentoo-libdir|$(get_libdir)|g" \
144 + -e "s|VERSION|${P}/VERSION|" \
145 + -i ./src/scripts/charmc || die "failed patching charmc script"
146 +
147 + # In the following, some of the files are symlinks to ../tmp which we need
148 + # to dereference first (see bug 432834).
149 +
150 + # Install binaries.
151 + for i in bin/*; do
152 + if [ -L $i ]; then
153 + i=$( readlink -e $i )
154 + else
155 + i=$i
156 + fi
157 + dobin $i
158 + done
159 +
160 + # Install headers.
161 + insinto /usr/include/${P}
162 + for i in include/*; do
163 + if [ -L $i ]; then
164 + i=$( readlink -e $i )
165 + else
166 + i=$i
167 + fi
168 + doins $i
169 + done
170 +
171 + # Install static libs. Charm has a lot of .o "libs" that it requires at
172 + # runtime.
173 + for i in lib/*.{a,o}; do
174 + if [ -L $i ]; then
175 + i=$( readlink -e $i )
176 + else
177 + i=$i
178 + fi
179 + dolib $i
180 + done
181 +
182 + # Install shared libs.
183 + if use charmshared; then
184 + cd "${S}"/lib_so
185 + dolib.so *.so*
186 + fi
187 +
188 + # Basic docs.
189 + dodoc CHANGES README
190 +
191 + # Install examples.
192 + find examples/ -name 'Makefile' | xargs sed \
193 + -r "s:(../)+bin/charmc:/usr/bin/charmc:" -i || \
194 + die "Failed to fix examples"
195 + find examples/ -name 'Makefile' | xargs sed \
196 + -r "s:./charmrun:./charmrun ++local:" -i || \
197 + die "Failed to fix examples"
198 + insinto /usr/share/doc/${PF}/examples
199 + doins -r examples/charm++/*
200 +
201 + # Install pdf/html docs
202 + if use doc; then
203 + cd "${S}"/doc
204 + # Install pdfs.
205 + insinto /usr/share/doc/${PF}/pdf
206 + doins doc/pdf/*
207 + # Install html.
208 + docinto html
209 + dohtml -r doc/html/*
210 + fi
211 +}
212 +
213 +pkg_postinst() {
214 + echo
215 + einfo "Please test your charm installation by copying the"
216 + einfo "content of /usr/share/doc/${PF}/examples to a"
217 + einfo "temporary location and run 'make test'."
218 + echo
219 +}
220
221 diff --git a/sys-cluster/charm/files/charm-6.5.0-charmc-gentoo.patch b/sys-cluster/charm/files/charm-6.5.0-charmc-gentoo.patch
222 new file mode 100644
223 index 0000000..34923e3
224 --- /dev/null
225 +++ b/sys-cluster/charm/files/charm-6.5.0-charmc-gentoo.patch
226 @@ -0,0 +1,25 @@
227 +--- src/scripts/charmc.old 2013-05-30 10:18:02.261819771 -0600
228 ++++ src/scripts/charmc 2013-05-30 10:19:50.839661634 -0600
229 +@@ -361,19 +361,9 @@
230 + PROG_EXT=".exe"
231 + fi
232 +
233 +-CHARMLIB="$CHARMBIN/../lib"
234 +-CHARMINC="$CHARMBIN/../include"
235 +-CHARMLIBSO=
236 +-if test -d "$CHARMBIN/../lib_so"
237 +-then
238 +- CHARMLIBSO=`cd $CHARMBIN/../lib_so 2>/dev/null && pwd`
239 +- #getting absolute path is harder than thought because of symbolic links and ..
240 +- #ksh needs cd -P to resolve werid symbolic links, however -P is not portable
241 +- #csh is ok too if it exists
242 +- test -z "$CHARMLIBSO" && CHARMLIBSO=`cd -P $CHARMBIN/../lib_so 2>/dev/null && pwd`
243 +- test -z "$CHARMLIBSO" && CHARMLIBSO=`csh -c "cd $CHARMBIN/../lib_so >& /dev/null && pwd"`
244 +- test -z "$CHARMLIBSO" && echo "$CHARMBIN/../lib_so: not found" && exit 1
245 +-fi
246 ++CHARMLIB="/usr/gentoo-libdir"
247 ++CHARMINC="/usr/include/gentoo-include"
248 ++CHARMLIBSO="/usr/gentoo-libdir"
249 +
250 + ##############################################################################
251 + #
252
253 diff --git a/sys-cluster/charm/metadata.xml b/sys-cluster/charm/metadata.xml
254 new file mode 100644
255 index 0000000..715027f
256 --- /dev/null
257 +++ b/sys-cluster/charm/metadata.xml
258 @@ -0,0 +1,10 @@
259 +<?xml version="1.0" encoding="UTF-8"?>
260 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
261 +<pkgmetadata>
262 + <herd>sci</herd>
263 + <use>
264 + <flag name="cmkopt">Enable CMK optimisation</flag>
265 + <flag name="tcp">Use TCP (instead of UPD) for socket communication</flag>
266 + <flag name="charmshared">Build shared libraries</flag>
267 + </use>
268 +</pkgmetadata>