1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-text/noweb/noweb-2.11b-r2.ebuild,v 1.1 2010/10/30 22:23:22 aballier Exp $
5 inherit eutils toolchain-funcs elisp-common
7 DESCRIPTION="a literate programming tool, lighter than web"
8 HOMEPAGE="http://www.eecs.harvard.edu/~nr/noweb/"
9 SRC_URI="http://www.eecs.harvard.edu/~nr/noweb/dist/${P}.tgz"
11 LICENSE="freedist emacs? ( GPL-2 )"
13 KEYWORDS="~amd64-linux"
16 DEPEND="virtual/tex-base
19 emacs? ( virtual/emacs )"
24 SITEFILE=50${PN}-gentoo.el
30 # glibc2.10 compat (bug 270757)
31 # mkdir d && cp -r c/* d/
32 sed "s:getline (:getline_nonlibc (:" -i c/getline.{c,h} || die
33 sed "s:getline(:getline_nonlibc(:" -i c/{notangle.c,getline.c,finduses.c} || die
36 epatch "${FILESDIR}"/${PN}-2.9-security.patch
38 sed -i -e "s/texhash/true/" Makefile
40 sed -i -e "s/strip/true/" Makefile
43 epatch "${FILESDIR}"/${P}-recmake.patch
44 epatch "${FILESDIR}"/${P}-ldflags.patch
48 # noweb tries to use notangle and noweb; see bug #50429
49 ( cd c; emake ICONC="icont" CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LIBSRC="icon" ) || die
50 export PATH="${PATH}:${T}"
51 emake ICONC="icont" CC="$(tc-getCC)" BIN="${T}" LIB="${T}" LIBSRC="icon" install-code \
52 || die "make temporal install failed."
54 emake ICONC="icont" CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LIBSRC="icon" || die "make failed"
55 # Set awk to awk not nawk
59 elisp-compile elisp/noweb-mode.el || die "elisp-compile failed"
64 # It needs the directories to exist first...
66 dodir /usr/libexec/${PN}
68 dodir /usr/share/texmf/tex/inputs
72 LIBNAME="${EPREFIX}/usr/libexec/${PN}" \
73 LIB="${ED}/usr/libexec/${PN}" \
74 MAN="${ED}/usr/share/man" \
75 TEXNAME="${EPREFIX}/usr/share/texmf/tex/inputs" \
76 TEXINPUTS="${ED}/usr/share/texmf/tex/inputs" \
77 install || die "make install failed"
80 insinto /usr/share/doc/${PF}/examples
86 elisp-install ${PN} src/elisp/noweb-mode.{el,elc} \
87 || die "elisp-install failed"
88 elisp-site-file-install "${FILESDIR}/${SITEFILE}" \
89 || die "elisp-site-file-install failed"
94 use emacs && elisp-site-regen
95 einfo "Running texhash to complete installation.."
100 use emacs && elisp-site-regen