aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Barbieri <lssndrbarbieri@gmail.com>2020-02-25 06:42:35 +0100
committerAlessandro Barbieri <lssndrbarbieri@gmail.com>2020-02-25 06:49:52 +0100
commit64939e25ca5ecd888c86677d57443d8b91f6f0f5 (patch)
treed1d51a3a1c12ffa404579fe7eb7501b8eeed14cb
parentmedia-video/vidify: Version bump 2.1.0 (diff)
downloadguru-64939e25.tar.gz
guru-64939e25.tar.bz2
guru-64939e25.zip
app-text/noweb: new package
Bug: https://bugs.gentoo.org/644258 Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
-rw-r--r--app-text/noweb/Manifest1
-rw-r--r--app-text/noweb/files/50noweb-gentoo.el4
-rw-r--r--app-text/noweb/files/noweb-2.12-ldflags.patch23
-rw-r--r--app-text/noweb/files/noweb-2.12-recmake.patch142
-rw-r--r--app-text/noweb/metadata.xml17
-rw-r--r--app-text/noweb/noweb-2.12.ebuild116
6 files changed, 303 insertions, 0 deletions
diff --git a/app-text/noweb/Manifest b/app-text/noweb/Manifest
new file mode 100644
index 0000000000..2ad9f81df5
--- /dev/null
+++ b/app-text/noweb/Manifest
@@ -0,0 +1 @@
+DIST noweb-2.12.tar.gz 579230 BLAKE2B 2b4b252a79df6b030c2e09dff62c2dbb59d4cdfc6dac76eb9d387b355f940a7431bb69f7200bfe0a2269542430cc00720c4391d3dd15978fc39b36e81a9fb5fe SHA512 b4e45f288b6ae99d2457b69628bb5dfca16f7d1ce1bb06722ae598b5ff50a4ed2819313c5f5991cd3d1062c9d306c1308b0336916b6582dba7a405a343958c2a
diff --git a/app-text/noweb/files/50noweb-gentoo.el b/app-text/noweb/files/50noweb-gentoo.el
new file mode 100644
index 0000000000..90b971d746
--- /dev/null
+++ b/app-text/noweb/files/50noweb-gentoo.el
@@ -0,0 +1,4 @@
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'noweb-mode "noweb-mode"
+ "Minor meta mode for editing noweb files." t)
+(add-to-list 'auto-mode-alist '("\\.nw\\'" . noweb-mode))
diff --git a/app-text/noweb/files/noweb-2.12-ldflags.patch b/app-text/noweb/files/noweb-2.12-ldflags.patch
new file mode 100644
index 0000000000..cc3e0acb86
--- /dev/null
+++ b/app-text/noweb/files/noweb-2.12-ldflags.patch
@@ -0,0 +1,23 @@
+--- a/src/c/Makefile
++++ b/src/c/Makefile
+@@ -41,19 +41,16 @@
+ all: nt markup mnt finduses nwmktemp
+
+ nt: $(TANGLEOBJS)
+- $(CC) $(CFLAGS) -o nt $(TANGLEOBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o nt $(TANGLEOBJS)
+
+ nwmktemp: nwmktemp.o
+ $(CC) $(CFLAGS) -o nwmktemp nwmktemp.o
+
+ finduses: $(FINDUSESOBJS)
+- $(CC) $(CFLAGS) -o finduses $(FINDUSESOBJS)
+
+ markup: $(MARKUPOBJS)
+- $(CC) $(CFLAGS) -o markup $(MARKUPOBJS)
+
+ mnt: $(MNTOBJS)
+- $(CC) $(CFLAGS) -o mnt $(MNTOBJS)
+
+ source: $(SRCS)
+ touch: $(SRCS)
diff --git a/app-text/noweb/files/noweb-2.12-recmake.patch b/app-text/noweb/files/noweb-2.12-recmake.patch
new file mode 100644
index 0000000000..b39f9d1c8e
--- /dev/null
+++ b/app-text/noweb/files/noweb-2.12-recmake.patch
@@ -0,0 +1,142 @@
+diff -ur a/contrib/norman/Makefile b/contrib/norman/Makefile
+--- a/contrib/norman/Makefile 2018-06-28 23:26:32.000000000 +0200
++++ b/contrib/norman/Makefile 2020-02-25 05:26:26.256610626 +0100
+@@ -1,10 +1,10 @@
+ LIB=/dev/null # to be overridden
+ DIRS=numarkup
+
+-all: ; for i in $(DIRS); do (cd $$i; make ICONC=$(ICONC) ICONT=$(ICONT) all); done
+-install: ; for i in $(DIRS); do (cd $$i; make LIB=$(LIB) BIN=$(BIN) install); done
+-source: ; for i in $(DIRS); do (cd $$i; make source); done
+-clean: ; for i in $(DIRS); do (cd $$i; make clean); done
++all: ; for i in $(DIRS); do (cd $$i; $(MAKE) ICONC=$(ICONC) ICONT=$(ICONT) all); done
++install: ; for i in $(DIRS); do (cd $$i; $(MAKE) LIB=$(LIB) BIN=$(BIN) install); done
++source: ; for i in $(DIRS); do (cd $$i; $(MAKE) source); done
++clean: ; for i in $(DIRS); do (cd $$i; $(MAKE) clean); done
+ iconlib: # cheap hack for slackmake
+ true
+
+diff -ur a/contrib/norman/numarkup/Makefile b/contrib/norman/numarkup/Makefile
+--- a/contrib/norman/numarkup/Makefile 2018-06-28 23:26:32.000000000 +0200
++++ b/contrib/norman/numarkup/Makefile 2020-02-25 05:32:02.290882144 +0100
+@@ -11,11 +11,11 @@
+
+ all:
+ noweb -t numarkup.nw
+- make $(TARGET)
++ $(MAKE) $(TARGET)
+
+ install:
+ noweb -t numarkup.nw
+- make $(TARGET)
++ $(MAKE) $(TARGET)
+ strip $(TARGET)
+ cp $(TARGET) $(LIB)
+
+diff -ur a/Makefile b/Makefile
+--- a/Makefile 2018-06-28 23:26:32.000000000 +0200
++++ b/Makefile 2020-02-25 05:24:54.607975694 +0100
+@@ -12,14 +12,14 @@
+ all:
+ @echo "You have no business running 'make' here; please look at the README file"
+ @exit 1
+-source: ; for i in src; do (cd $$i; make source); done
+-www: ; for i in src/xdoc examples; do (cd $$i; make www); done
++source: ; for i in src; do (cd $$i; $(MAKE) source); done
++www: ; for i in src/xdoc examples; do (cd $$i; $(MAKE) www); done
+
+ clean:
+- for i in src examples contrib; do (cd $$i; make clean); done
++ for i in src examples contrib; do (cd $$i; $(MAKE) clean); done
+ rm -f nwsrcfilter *~ */*~
+ clobber: clean
+- for i in src examples contrib; do (cd $$i; make clobber); done
++ for i in src examples contrib; do (cd $$i; $(MAKE) clobber); done
+
+ DATE:
+ (./echo -n "Version $(VERSION) of "; date) > DATE
+@@ -51,7 +51,7 @@
+
+ ctan: clean source nwsrcfilter DATE emacscheck
+ chmod +w src/Makefile
+- (cd src; make boot)
++ (cd src; $(MAKE) boot)
+ rm -f ../noweb-$(VERSION)-ctan.zip
+ find ./* ! -type d -not -name FAQ.old -not -name '.git*' -print | ./nwsrcfilter | sed 's@^@noweb/@' | ( ln -s . noweb; zip ../noweb-$(VERSION)-ctan.zip -@; rm -f noweb )
+ chmod -w src/Makefile
+@@ -61,6 +61,6 @@
+ diff src/elisp/noweb-mode.el $(HOME)/emacs/noweb-mode.el
+
+ checkin:
+- (cd src; make "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" checkin)
++ (cd src; $(MAKE) "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" checkin)
+
+
+diff -ur a/src/Makefile b/src/Makefile
+--- a/src/Makefile 2020-02-25 05:22:55.103146835 +0100
++++ b/src/Makefile 2020-02-25 05:29:26.557836177 +0100
+@@ -41,9 +41,9 @@
+ TEXNAME=$(TEXINPUTS)
+
+ all:
+- cd c; make "CC=$(CC)" "$(CFLAGS)" all
+- for i in shell lib xdoc tex; do (cd $$i; make all); done
+- cd $(LIBSRC); make "ICONT=$(ICONT)" "ICONC=$(ICONC)" all
++ cd c; $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS)" all
++ for i in shell lib xdoc tex; do (cd $$i; $(MAKE) all); done
++ cd $(LIBSRC); $(MAKE) "ICONT=$(ICONT)" "ICONC=$(ICONC)" all
+
+ FAQ: FAQ.html
+ sleep 1; html2ascii FAQ.html > FAQ
+@@ -101,13 +101,13 @@
+ mkdir -p $(BIN) $(LIB)
+ true c/nt c/markup c/mnt c/finduses c/nwmktemp
+ cp c/nt c/markup c/mnt c/finduses c/nwmktemp $(LIB)
+- cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
+- cd lib; make LIB=$(LIB) install
++ cd $(LIBSRC); $(MAKE) ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) install
++ cd lib; $(MAKE) LIB=$(LIB) install
+
+ uninstall-code: uninstall-shell
+ rm -f $(LIB)/nt $(LIB)/markup $(LIB)/mnt $(LIB)/finduses
+- cd $(LIBSRC); make ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) uninstall
+- cd lib; make LIB=$(LIB) uninstall
++ cd $(LIBSRC); $(MAKE) ICONT=$(ICONT) ICONC=$(ICONC) LIB=$(LIB) BIN=$(BIN) uninstall
++ cd lib; $(MAKE) LIB=$(LIB) uninstall
+ install-man:
+ mkdir -p $(MAN) $(MANDIR) $(MAN7DIR)
+ sed -e "s@|LIBDIR|@$(LIBNAME)@" -e "s@|TEXINPUTS|@$(TEXNAME)@" xdoc/cpif.1 > $(MANDIR)/cpif.$(MANEXT)
+@@ -194,26 +194,26 @@
+ uninstall-elisp:
+ rm -f $(ELISP)/noweb-mode.el || true
+ checkin:
+- for i in lib tex xdoc; do (cd $$i; make "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" checkin); done
++ for i in lib tex xdoc; do (cd $$i; $(MAKE) "CINAME=$(CINAME)" "CIMSG=$(CIMSG)" checkin); done
+ for i in c icon awk; do (cd $$i; ci -l $(CINAME) $(CIMSG) *.nw Makefile); done
+ (cd elisp; ci -l $(CINAME) $(CIMSG) *.el)
+ ci -l $(CINAME) $(CIMSG) Makefile.nw INSTALL INSTALL.DOS README FAQ COPYRIGHT nwmake *.nw
+
+ source: FAQ
+- for i in c shell lib xdoc icon awk tex; do (cd $$i; make CPIF=">" source); done
++ for i in c shell lib xdoc icon awk tex; do (cd $$i; $(MAKE) CPIF=">" source); done
+ sleep 1
+- for i in c shell lib xdoc icon awk tex; do (cd $$i; make touch); done
++ for i in c shell lib xdoc icon awk tex; do (cd $$i; $(MAKE) touch); done
+ touch:
+ touch FAQ
+- for i in c shell lib xdoc icon awk tex; do (cd $$i; make touch); done
++ for i in c shell lib xdoc icon awk tex; do (cd $$i; $(MAKE) touch); done
+ boot:
+- for i in c shell lib xdoc icon awk tex; do (cd $$i; make boot); done
++ for i in c shell lib xdoc icon awk tex; do (cd $$i; $(MAKE) boot); done
+ clean:
+- for i in c shell lib xdoc icon awk tex; do (cd $$i; make clean); done
++ for i in c shell lib xdoc icon awk tex; do (cd $$i; $(MAKE) clean); done
+ rm -f nwsrcfilter *~ */*~
+
+ clobber: clean
+- for i in c shell lib xdoc icon awk tex; do (cd $$i; make clobber); done
++ for i in c shell lib xdoc icon awk tex; do (cd $$i; $(MAKE) clobber); done
+
+ Makefile: Makefile.nw
+ chmod +w Makefile
diff --git a/app-text/noweb/metadata.xml b/app-text/noweb/metadata.xml
new file mode 100644
index 0000000000..e2e56fde97
--- /dev/null
+++ b/app-text/noweb/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>lssndrbarbieri@gmail.com</email>
+ <name>Alessandro Barbieri</name>
+ </maintainer>
+ <upstream>
+ <maintainer>
+ <email>nr@cs.tufts.edu</email>
+ <name>Norman Ramsey</name>
+ </maintainer>
+ <remote-id type="github">nrnrnr/noweb</remote-id>
+ </upstream>
+ <longdescription lang="en">noweb is designed to meet the needs of literate programmers while remaining as simple as possible. Its primary advantages are simplicity, extensibility, and language-independence—especially noticeable when compared with other literate-programming tools. noweb uses 5 control sequences to WEB's 27. The noweb manual is only 4 pages; an additional page explains how to customize its LaTeX output. noweb works ``out of the box'' with any programming language, and supports TeX, latex, HTML, and troff back ends. A back end to support full hypertext or indexing takes about 250 lines; a simpler one can be written in 40 lines of awk. The primary sacrifice relative to WEB is that code is seldom prettyprinted.
+ </longdescription>
+</pkgmetadata>
diff --git a/app-text/noweb/noweb-2.12.ebuild b/app-text/noweb/noweb-2.12.ebuild
new file mode 100644
index 0000000000..b361780a25
--- /dev/null
+++ b/app-text/noweb/noweb-2.12.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+inherit eutils toolchain-funcs elisp-common
+
+MYPV="$(ver_rs 1 _)"
+
+DESCRIPTION="a literate programming tool, lighter than web"
+HOMEPAGE="http://www.eecs.harvard.edu/~nr/noweb/"
+SRC_URI="https://github.com/nrnrnr/${PN}/archive/v${MYPV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="
+ || ( BSD-2 noweb )
+ emacs? ( GPL-2 )
+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="emacs examples"
+
+DEPEND="virtual/tex-base
+ dev-lang/icon
+ sys-apps/debianutils
+ emacs? ( app-editors/emacs:= )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}-${MYPV}"
+
+SITEFILE="50${PN}-gentoo.el"
+
+src_prepare() {
+ # glibc2.10 compat (bug 270757)
+# mkdir d && cp -r c/* d/
+ sed "s/getline (/getline_nonlibc (/" -i src/c/getline.{c,h} || die
+ sed "s/getline(/getline_nonlibc(/" -i src/c/{notangle.c,getline.c,finduses.c} || die
+# diff -u d/ c/
+
+ # dont run texhash...
+ sed -i -e "s/texhash/true/" src/Makefile
+ # dont strip...
+ sed -i -e "s/strip/true/" src/Makefile
+
+ sed -i -e "s/CC=gcc -ansi -pedantic -O -Wall -Werror//" src/Makefile
+ sed -i -e "s/CFLAGS=//" src/Makefile
+ sed -i -e "s/CC=gcc -ansi -pedantic -O -Wall -Werror//" src/c/Makefile
+ sed -i -e "s/CFLAGS=//" src/c/Makefile
+
+ eapply "${FILESDIR}/${P}-recmake.patch"
+
+ sed -i -e "s/CC = cc//" contrib/norman/numarkup/Makefile
+ sed -i -e "s/CFLAGS = -O//" contrib/norman/numarkup/Makefile
+
+ eapply "${FILESDIR}/${P}-ldflags.patch"
+ eapply_user
+}
+
+src_compile() {
+ # noweb tries to use notangle and noweb; see bug #50429
+ cd "${S}/src/c"
+ ( emake ICONC="icont" CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LIBSRC="icon" ) || die
+ export PATH="${PATH}:${T}"
+ cd "${S}/src"
+ ( emake ICONC="icont" CC="$(tc-getCC)" BIN="${T}" LIB="${T}" LIBSRC="icon" install-code ) \
+ || die "make temporal install failed."
+
+ ( emake ICONC="icont" CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LIBSRC="icon" ) || die "make failed"
+ # Set awk to awk not nawk
+ ./awkname awk
+
+ if use emacs; then
+ elisp-compile elisp/noweb-mode.el || die "elisp-compile failed"
+ fi
+}
+
+src_install () {
+ cd "${S}/src"
+
+ # It needs the directories to exist first...
+ dodir /usr/bin
+ dodir "/usr/libexec/${PN}"
+ dodir /usr/share/man
+ dodir /usr/share/texmf-site/tex/inputs
+ emake ICONC="icont" \
+ BIN="${ED}/usr/bin" \
+ LIBSRC="icon" \
+ LIBNAME="${EPREFIX}/usr/libexec/${PN}" \
+ LIB="${ED}/usr/libexec/${PN}" \
+ MAN="${ED}/usr/share/man" \
+ TEXNAME="${EPREFIX}/usr/share/texmf-site/tex/inputs" \
+ TEXINPUTS="${ED}/usr/share/texmf-site/tex/inputs" \
+ install || die "make install failed"
+ cd "${S}"
+ if use examples; then
+ insinto "/usr/share/doc/${PF}/examples"
+ doins examples/*
+ fi
+ dodoc CHANGES README
+
+ if use emacs; then
+ elisp-install "${PN}" "${S}"/src/elisp/noweb-mode.{el,elc} \
+ || die "elisp-install failed"
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}" \
+ || die "elisp-site-file-install failed"
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+ einfo "Running texhash to complete installation.."
+ texhash
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}