From caf50f70a3bb2ae5cae826ea27381774a1a0aeb9 Mon Sep 17 00:00:00 2001 From: Nicolas Bock Date: Fri, 8 Nov 2013 10:21:40 -0700 Subject: sys-cluster/charm-6.5.1-r3: Added patch to fix doc. When building the documentation, we used to have to force +charm-6.5.1-r3.ebuild, + +files/charm-6.5.1-fix-markupSanitizer.patch: + sys-cluster/charm-6.5.1-r3: Added patch to fix doc. When building the + documentation, we used to have to force -charm-6.5.1-r1.ebuild, -charm-6.5.1.ebuild: remove old diff --git a/sys-cluster/charm/charm-6.5.1-r3.ebuild b/sys-cluster/charm/charm-6.5.1-r3.ebuild new file mode 100644 index 000000000..3f11990e6 --- /dev/null +++ b/sys-cluster/charm/charm-6.5.1-r3.ebuild @@ -0,0 +1,204 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/charm/charm-6.5.0.ebuild,v 1.1 2013/06/26 23:58:38 ottxor Exp $ + +EAPI=5 + +inherit eutils flag-o-matic fortran-2 multilib toolchain-funcs + +DESCRIPTION="Message-passing parallel language and runtime system" +HOMEPAGE="http://charm.cs.uiuc.edu/" +SRC_URI="http://charm.cs.uiuc.edu/distrib/${P}.tar.gz" + +LICENSE="charm" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="charmdebug charmtracing charmproduction cmkopt doc examples mlogft mpi numa smp static-libs syncft tcp" + +RDEPEND="mpi? ( virtual/mpi )" +DEPEND=" + ${RDEPEND} + doc? ( + >=app-text/poppler-0.12.3-r3[utils] + dev-tex/latex2html + virtual/tex-base + >=dev-python/beautifulsoup-4 + dev-python/lxml + media-libs/netpbm + )" + +REQUIRED_USE=" + doc? ( ${PYTHON_REQUIRED_USE} ) + cmkopt? ( !charmdebug !charmtracing ) + charmproduction? ( !charmdebug !charmtracing )" + +FORTRAN_STANDARD="90" + +get_opts() { + local CHARM_OPTS + + # TCP instead of default UDP for socket comunication + # protocol + CHARM_OPTS+="$(usex tcp ' tcp' '')" + + # enable direct SMP support using shared memory + CHARM_OPTS+="$(usex smp ' smp' '')" + + CHARM_OPTS+="$(usex mlogft ' mlogft' '')" + CHARM_OPTS+="$(usex syncft ' syncft' '')" + + # Build shared libraries by default. + CHARM_OPTS+=" --build-shared" + + if use charmproduction; then + CHARM_OPTS+=" --with-production" + else + if use charmdebug; then + CHARM_OPTS+=" --enable-charmdebug" + fi + + if use charmtracing; then + CHARM_OPTS+=" --enable-tracing --enable-tracing-commthread" + fi + fi + + CHARM_OPTS+="$(usex numa ' --with-numa' '')" + echo $CHARM_OPTS +} + +src_prepare() { + sed \ + -e "/CMK_CF90/s:f90:$(usex mpi "mpif90" "$(tc-getFC)"):g" \ + -e "/CMK_CXX/s:g++:$(usex mpi "mpic++" "$(tc-getCXX)"):g" \ + -e "/CMK_CC/s:gcc:$(usex mpi "mpicc" "$(tc-getCC)"):g" \ + -e '/CMK_F90_MODINC/s:-p:-I:g' \ + -e "/CMK_LD/s:\"$: ${LDFLAGS} \":g" \ + -i src/arch/$(usex mpi "mpi" "net")-linux*/*sh || die + + sed \ + -e "s:-o conv-cpm:${LDFLAGS} &:g" \ + -e "s:-o charmxi:${LDFLAGS} &:g" \ + -e "s:-o charmrun-silent:${LDFLAGS} &:g" \ + -e "s:-o charmrun-notify:${LDFLAGS} &:g" \ + -e "s:-o charmrun:${LDFLAGS} &:g" \ + -e "s:-o charmd_faceless:${LDFLAGS} &:g" \ + -e "s:-o charmd:${LDFLAGS} &:g" \ + -i \ + src/scripts/Makefile \ + src/arch/net/charmrun/Makefile || die + + # CMK optimization + use cmkopt && append-cppflags -DCMK_OPTIMIZE=1 + + # Fix QA notice. Filed report with upstream. + append-cflags -DALLOCA_H + + epatch "${FILESDIR}/charm-6.5.1-cleanup-config.patch" + epatch "${FILESDIR}/charm-6.5.1-CkReductionMgr.patch" + epatch "${FILESDIR}/charm-6.5.1-fix-string-parsing.patch" + epatch "${FILESDIR}/charm-6.5.1-fix-navmenuGenerator.patch" + epatch "${FILESDIR}/charm-6.5.1-fix-markupSanitizer.patch" + epatch "${FILESDIR}/charm-6.5.1-static-library-fix.patch" +} + +src_compile() { + local mybuildoptions="$(usex mpi "mpi" "net")-linux$(usex amd64 "-amd64" '') $(get_opts) ${MAKEOPTS} -j1 ${CFLAGS}" + + # Build charmm++ first. + einfo "running ./build charm++ ${mybuildoptions}" + ./build charm++ ${mybuildoptions} || die "Failed to build charm++" + + # make pdf/html docs + if use doc; then + emake -j1 -C doc/charm++ + fi +} + +src_test() { + make -C tests/charm++ test TESTOPTS="++local" || die +} + +src_install() { + # Make charmc play well with gentoo before we move it into /usr/bin. This + # patch cannot be applied during src_prepare() because the charmc wrapper + # is used during building. + epatch "${FILESDIR}/charm-6.5.1-charmc-gentoo.patch" + + sed -e "s|gentoo-include|${P}|" \ + -e "s|gentoo-libdir|$(get_libdir)|g" \ + -e "s|VERSION|${P}/VERSION|" \ + -i ./src/scripts/charmc || die "failed patching charmc script" + + # In the following, some of the files are symlinks to ../tmp which we need + # to dereference first (see bug 432834). + + local i + + # Install binaries. + for i in bin/*; do + if [[ -L ${i} ]]; then + i=$(readlink -e "${i}") || die + fi + dobin "${i}" + done + + # Install headers. + insinto /usr/include/${P} + for i in include/*; do + if [[ -L ${i} ]]; then + i=$(readlink -e "${i}") || die + fi + doins "${i}" + done + + # Install static libs. Charm has a lot of .o "libs" that it requires at + # runtime. + if use static-libs; then + for i in lib/*.{a,o}; do + if [[ -L ${i} ]]; then + i=$(readlink -e "${i}") || die + fi + dolib "${i}" + done + fi + + # Install shared libs. + for i in lib_so/*; do + if [[ -L ${i} ]]; then + i=$(readlink -e "${i}") || die + fi + dolib.so "${i}" + done + + # Basic docs. + dodoc CHANGES README + + # Install examples. + if use examples; then + find examples/ -name 'Makefile' | xargs sed \ + -r "s:(../)+bin/charmc:/usr/bin/charmc:" -i || \ + die "Failed to fix examples" + find examples/ -name 'Makefile' | xargs sed \ + -r "s:./charmrun:./charmrun ++local:" -i || \ + die "Failed to fix examples" + insinto /usr/share/doc/${PF}/examples + doins -r examples/charm++/* + fi + + # Install pdf/html docs + if use doc; then + cd "${S}/doc/charm++" + # Install pdfs. + insinto /usr/share/doc/${PF}/pdf + doins *.pdf + # Install html. + docinto html + dohtml -r manual/* + fi +} + +pkg_postinst() { + einfo "Please test your charm installation by copying the" + einfo "content of /usr/share/doc/${PF}/examples to a" + einfo "temporary location and run 'make test'." +} diff --git a/sys-cluster/charm/files/charm-6.5.1-fix-markupSanitizer.patch b/sys-cluster/charm/files/charm-6.5.1-fix-markupSanitizer.patch new file mode 100644 index 000000000..6ed4c1989 --- /dev/null +++ b/sys-cluster/charm/files/charm-6.5.1-fix-markupSanitizer.patch @@ -0,0 +1,203 @@ +From 88f5739d3f0d34c51f318fc460b843253b4242e0 Mon Sep 17 00:00:00 2001 +From: Nicolas Bock +Date: Fri, 8 Nov 2013 09:58:55 -0700 +Subject: [PATCH 2/2] Make markupSanitizer.py support python 3.1 and 3.2 + +The script only supports PPL Homepage', +- '
  • Other Manuals
  • ']) +- ) ) +- navmenu.append(navmenuTOC) +- +- # Insert navigation symbols to prev and next links +- prevsymbol = soup.new_tag('span') +- prevsymbol['class'] = 'navsymbol' +- prevsymbol.string = u'\xab' +- prv = navmenu.find('li',id='nav-prev') +- if prv: +- prv.find('a').insert(0, prevsymbol) +- +- nextsymbol = soup.new_tag('span') +- nextsymbol['class'] = 'navsymbol' +- nextsymbol.string = u'\xbb' +- nxt = navmenu.find('li',id='nav-next') +- if nxt: +- nxt.find('a').append(nextsymbol) +- +- # Reinsert the navigation bar at the end +- soup.body.append(navmenu) +- +-# Extract the title +-titl = soup.find('title') +- +-# Replace the head section with the user-supplied head markup +-soup.find('head').extract() +-newhead = BeautifulSoup(open("../assets/head.html"), "lxml") +-newhead = newhead.find('head').extract() +-newhead.append(titl) +-soup.html.body.insert_before(newhead) +- +-# Print cleaned up markup to stdout +-print( soup.prettify(formatter="html") ) +- ++def main (): ++ # Accept filename as user input ++ argc = len( sys.argv ) ++ if (argc < 2): raise Exception ++ fileName = sys.argv[1]; ++ ++ # Construct a DOM object ++ soup = BeautifulSoup(open(fileName), "lxml") ++ ++ # Assuming, tt tags are not spewed recklessly by latex2html, ++ # replace them with code tags ++ for t in soup('tt'): ++ t.wrap( soup.new_tag('code') ) ++ t.unwrap() ++ ++ # Rewrap all div class=alltt blocks in pre tags ++ for d in soup('div','alltt'): ++ d.wrap( soup.new_tag('pre') ) ++ d.unwrap() ++ ++ # Remove br and span tags from within pre sections ++ for p in soup('pre'): ++ for b in p('br'): ++ b.extract() ++ for s in p('span'): ++ s.unwrap() ++ ++ # Remove all useless class 'arabic' spans ++ for s in soup('span','arabic'): ++ s.unwrap() ++ ++ # Extract the navigation bar ++ navmenu = soup.find('div', 'navigation') ++ if navmenu: ++ navmenu.extract() ++ ++ # Wrap the remaining contents within a div ++ if not soup.find('div', id='maincontainer'): ++ soup.body['id'] = 'maincontainer' ++ soup.body.name = 'div' ++ soup.find('div', id='maincontainer').wrap( soup.new_tag('body') ) ++ ++ if navmenu: ++ # If this navmenu doesn't already have a TOC, insert one ++ if not navmenu.find('ul','manual-toc'): ++ # Add a toc within the navmenu ++ navmenuTOC = BeautifulSoup(open("tmp-navmenu.html"), "lxml") ++ navmenuTOC = navmenuTOC.find('ul','manual-toc').extract() ++ navmenuTOC.append( BeautifulSoup("".join([ ++ '
  • PPL Homepage
  • ', ++ '
  • Other Manuals
  • ']) ++ ) ) ++ navmenu.append(navmenuTOC) ++ ++ # Insert navigation symbols to prev and next links ++ prevsymbol = soup.new_tag('span') ++ prevsymbol['class'] = 'navsymbol' ++ prevsymbol.string = u('\xab') ++ prv = navmenu.find('li',id='nav-prev') ++ if prv: ++ prv.find('a').insert(0, prevsymbol) ++ ++ nextsymbol = soup.new_tag('span') ++ nextsymbol['class'] = 'navsymbol' ++ nextsymbol.string = u('\xbb') ++ nxt = navmenu.find('li',id='nav-next') ++ if nxt: ++ nxt.find('a').append(nextsymbol) ++ ++ # Reinsert the navigation bar at the end ++ soup.body.append(navmenu) ++ ++ # Extract the title ++ titl = soup.find('title') ++ ++ # Replace the head section with the user-supplied head markup ++ soup.find('head').extract() ++ newhead = BeautifulSoup(open("../assets/head.html"), "lxml") ++ newhead = newhead.find('head').extract() ++ newhead.append(titl) ++ soup.html.body.insert_before(newhead) ++ ++ # Print cleaned up markup to stdout ++ print( soup.prettify(formatter="html") ) ++ ++if sys.version < '3': ++ import codecs ++ def u (x): ++ return codecs.unicode_escape_decode(x)[0] ++else: ++ def u (x): ++ return x ++ ++if __name__ == "__main__": ++ main() +-- +1.8.1.5 + -- cgit v1.2.3-18-g5258