summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sping@gentoo.org>2015-08-13 01:42:34 +0200
committerSebastian Pipping <sping@gentoo.org>2015-08-13 02:20:45 +0200
commit9c34dca35ccf59e09deec020d3113a2f1b7b6bbc (patch)
tree3ab5bdb610b0dca9f771c706390570a70aab737a /dev-scheme
parentdev-scheme/slib: Add default checksums (diff)
downloadgentoo-9c34dca35ccf59e09deec020d3113a2f1b7b6bbc.tar.gz
gentoo-9c34dca35ccf59e09deec020d3113a2f1b7b6bbc.tar.bz2
gentoo-9c34dca35ccf59e09deec020d3113a2f1b7b6bbc.zip
dev-scheme/slib: Fix compilation with >=sys-apps/texinfo-5 (bug #465348)
Signed-off-by: Sebastian Pipping <sping@gentoo.org>
Diffstat (limited to 'dev-scheme')
-rw-r--r--dev-scheme/slib/files/slib-3.2.2-fix-texinfo.awk123
-rw-r--r--dev-scheme/slib/slib-3.2.2.ebuild12
2 files changed, 135 insertions, 0 deletions
diff --git a/dev-scheme/slib/files/slib-3.2.2-fix-texinfo.awk b/dev-scheme/slib/files/slib-3.2.2-fix-texinfo.awk
new file mode 100644
index 00000000000..6bc3ce8e177
--- /dev/null
+++ b/dev-scheme/slib/files/slib-3.2.2-fix-texinfo.awk
@@ -0,0 +1,123 @@
+# Fixes Texinfo input to compile with Texinfo 5 or later
+#
+# Written by Sebastian Pipping <sebastian@pipping.org>
+# Licensed under CC0 1.0 Universal Public Domain Dedication
+# https://creativecommons.org/publicdomain/zero/1.0/
+#
+# Version 0_p20150813_p0418
+
+BEGIN {
+ inside_deffn = 0
+ inside_defmac = 0
+ inside_defop = 0
+ inside_deftp = 0
+ inside_defun = 0
+}
+
+/^@deffn / {
+ if (inside_deffn) {
+ print "@end deffn"
+ }
+ inside_deffn = 1
+}
+
+/^@deffnx / {
+ if (inside_deffn) {
+ print "@end deffn"
+ }
+ sub(/^@deffnx/, "@deffn")
+ inside_deffn = 1
+}
+
+/^@defmac / {
+ if (inside_defmac) {
+ print "@end defmac"
+ }
+ inside_defmac = 1
+}
+
+/^@defmacx / {
+ if (inside_defmac) {
+ print "@end defmac"
+ }
+ sub(/^@defmacx/, "@defmac")
+ inside_defmac = 1
+}
+
+/^@defop / {
+ if (inside_defop) {
+ print "@end defop"
+ }
+ inside_defop = 1
+}
+
+/^@defopx / {
+ if (inside_defop) {
+ print "@end defop"
+ }
+ sub(/^@defopx/, "@defop")
+ inside_defop = 1
+}
+
+/^@deftp / {
+ if (inside_deftp) {
+ print "@end deftp"
+ }
+ inside_deftp = 1
+}
+
+/^@deftpx / {
+ if (inside_deftp) {
+ print "@end deftp"
+ }
+ sub(/^@deftpx/, "@deftp")
+ inside_deftp = 1
+}
+
+/^@defun / {
+ if (inside_defun) {
+ print "@end defun"
+ }
+ inside_defun = 1
+}
+
+/^@defunx / {
+ if (inside_defun) {
+ print "@end defun"
+ }
+ sub(/^@defunx/, "@defun")
+ inside_defun = 1
+}
+
+/^@end deffn/ {
+ inside_deffn = 0
+}
+
+/^@end defmac/ {
+ inside_defmac = 0
+}
+
+/^@end defop/ {
+ inside_defop = 0
+}
+
+/^@end deftp/ {
+ inside_deftp = 0
+}
+
+/^@end defun/ {
+ inside_defun = 0
+}
+
+/^@subsubsection/ {
+ if (inside_deffn) {
+ print "@end deffn"
+ print $0
+ print "@deffn {Dummy} Dummy"
+ next
+ }
+}
+
+{
+ print
+}
diff --git a/dev-scheme/slib/slib-3.2.2.ebuild b/dev-scheme/slib/slib-3.2.2.ebuild
index f821d58bab4..a418aa1a7b9 100644
--- a/dev-scheme/slib/slib-3.2.2.ebuild
+++ b/dev-scheme/slib/slib-3.2.2.ebuild
@@ -29,6 +29,13 @@ DEPEND="app-arch/unzip"
INSTALL_DIR="/usr/share/slib/"
+_fix_txi_file() {
+ local inplace_filename="${1}"
+ local tempfile="$(mktemp)"
+ awk -f "${FILESDIR}"/slib-3.2.2-fix-texinfo.awk < "${inplace_filename}" > "${tempfile}"
+ mv "${tempfile}" "${inplace_filename}" || die
+}
+
src_prepare() {
sed "s:prefix = /usr/local/:prefix = ${ED}/usr/:" -i Makefile || die
sed 's:libdir = $(exec_prefix)lib/:libdir = $(exec_prefix)share/:' -i Makefile || die
@@ -40,6 +47,11 @@ src_prepare() {
# diff -u Makefile.old Makefile
sed 's:(lambda () "/usr/local/share/gambc/")):(lambda () "'"${EPREFIX}"'/usr/share/gambit")):' -i gambit.init || die
+
+ einfo "Fixing Texinfo files..."
+ for i in *.txi *.texi ; do
+ _fix_txi_file "${i}" || die
+ done
}
src_compile() {