summaryrefslogtreecommitdiff
path: root/dev-tcltk/tclreadline
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-tcltk/tclreadline
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-tcltk/tclreadline')
-rw-r--r--dev-tcltk/tclreadline/Manifest11
-rw-r--r--dev-tcltk/tclreadline/files/tclreadline-2.1.0-alloc-free.patch121
-rw-r--r--dev-tcltk/tclreadline/files/tclreadline-2.1.0-gold.patch15
-rw-r--r--dev-tcltk/tclreadline/files/tclreadline-2.1.0-rl-executing-macro.patch128
-rw-r--r--dev-tcltk/tclreadline/files/tclreadline-2.1.0-rl-history-expand.patch35
-rw-r--r--dev-tcltk/tclreadline/files/tclreadline-2.1.0-rl-prompt.patch12
-rw-r--r--dev-tcltk/tclreadline/metadata.xml11
-rw-r--r--dev-tcltk/tclreadline/tclreadline-2.1.0-r4.ebuild68
8 files changed, 401 insertions, 0 deletions
diff --git a/dev-tcltk/tclreadline/Manifest b/dev-tcltk/tclreadline/Manifest
new file mode 100644
index 000000000000..4beb0e9a555c
--- /dev/null
+++ b/dev-tcltk/tclreadline/Manifest
@@ -0,0 +1,11 @@
+AUX tclreadline-2.1.0-alloc-free.patch 3421 SHA256 41e52a17ab8869dafcb3be290611300853946d5475a8a0ab1ab19698acfa7ed2 SHA512 52456ed9de43f7a6e646ded04a814e895d40db53ec3c7ce28a9be0eba16d52ebdc7e8eaff76ffc6b7db1db29b8bb0d58908c188fdcf2b2689e28db40046d3517 WHIRLPOOL 10b84b79ceb2c42c60e7436ab7fc4d94e1b4c31d73507309ca9c2d0aea72aa7246a5d89871a0e5b530ed12232b8d52ec9555698e7defe2ebfbd316f988ab0d07
+AUX tclreadline-2.1.0-gold.patch 458 SHA256 c36f826c374dfdbe6411d5e13fbd9d90d42f18c0e72f3032ae23bd5348188598 SHA512 91bbf2eb167c33faa02e998bd83da06e3b1e28832700ff79458a2bbc1620920e749985ec6780254a7016e931cca094205224aa3ea3a95effb12dafc1fe9fca45 WHIRLPOOL 09d616f692fd0c9deafc5c6f2508a32d8dfe9169dae4a48474a6301b9ad408305a87204b1785682747a7a8204aaa45330a11833585fce3f95a09dbfa33f4d366
+AUX tclreadline-2.1.0-rl-executing-macro.patch 3788 SHA256 b27758352df46d77829e9aa97883e18f36f548f162ae8ef30266f78b66da8280 SHA512 f7ba38320c7095b4a8450e24a3ed1a75af6dcd7791c17b5546b36faeb5391b00f389a353838f8ea2b81b25f5d9c5ca1b6ccf7db5e6a30d2e304691db42da67dc WHIRLPOOL cd2f78f9987d5c5dba0999861c2d3242f6a43557bc00ad0bf47d7b63b491c057d0823198dc663f868920b9b1fbd2658b9b5a4bd42adb1b6ac38d5616e8aab6b6
+AUX tclreadline-2.1.0-rl-history-expand.patch 969 SHA256 ba37a9354f8ea8f5562d279989248bd6bfa33482b8aeff253fad3d37b360ccb0 SHA512 a015a56413c683e2a41e912891138494f43fd12b5383f9514314d87c9cc353cd95a2ea515978b4d1b0c60d4ab1cc0d1d16d982825949e338c0ac69e84e114304 WHIRLPOOL fd49666ced0c28da88ea80841e9b6f45f6bb719c9c92eed2662a3951a2e2ad27e8146618c90fc44dbeba4d7716e34c84ae2d7ff9bf7fe06827abe36ad7e6e2fc
+AUX tclreadline-2.1.0-rl-prompt.patch 463 SHA256 7dda1f9eebb9be2cf88f141a10d64e91d8dc7a21184d93813e209b77c3f1cd10 SHA512 b547e2077861d39701ed53b485f9758c8e0a636ecba7abfc25aa3fabeaa1337c6e48a08ba51425b95a55bae4021c2aa17e66686ee3836eb31cb6b4d115508073 WHIRLPOOL 1d038a2d5df457cc317bfe6b7f498734d55905b41e6eacb2792dc0fa6f256b855394d5a634048db52ed4c5ab1383588ef5014f21baad8a170a5b110330b005b3
+DIST tclreadline-2.1.0.tar.gz 160541 SHA256 def2325e45e2b7f30b04ad5078481740596599622c253043c503c2285f5672e7 SHA512 bd67a65fe2ec708834fb67fabf2e36e778a6aeeb7a7b69cda298f9e18acc9e03f3a379f81ff7d2d289bfbf1093bc86fecbf96fe5d04a2ca954899cc7df6fe4bf WHIRLPOOL 89680ffcfea123d2032e4948788164d57e7fa90c05b16d838edbd0fd8916b34f934acd785ae8bc5313f4391779f3b15b31924ef8c4e925f6443a3022b00de036
+DIST tclreadline_2.1.0-12.debian.tar.gz 9636 SHA256 3a9144fc6b46834cc7d555b5f05cf29f00132594b137d23a0dc4f8cde976daf4 SHA512 293e9ad14a469891f68b25caa78a99874de87df4c44af4ada7528cf74e898be42b7846fbb6eeabb2dec34995a9ccd9707c61f406b90b90dbca2c24df05f451eb WHIRLPOOL dfb7f739ea9edd98cf01166e38d759eb97d83da554737d5f908025661823eb0ed68beef6b038a2bc4fe14377abcdff7d69d1343c08e7bb1f62a1fdaa4ecb09c7
+EBUILD tclreadline-2.1.0-r4.ebuild 1848 SHA256 7875855d2d8e16a6ef52c012261ae04b1d8b0fe7962c56618554ae0b9e8ab836 SHA512 456559f0eea55eb24fcda7dee42b5fc153ed229869ab846350898cdf2da92c3e3c8776db20f5064665240d1720277b78619b8670bc590da9f25e0f9f4da4bbc0 WHIRLPOOL 537516e574fb778700ccebb142f2d105a2a864eff9819a0d083ef19d990516f8568af5dc7f90fe09b5a69cc3cdfc3e842c265d2afd5e8acc5342666c790df790
+MISC ChangeLog 2679 SHA256 d2c04ed68cdf70e9faf747877a147d1ae59ce8d65498143f3e1bcf270bc48f1e SHA512 1f9048658c834795ae6458a3609e867fc635bbba9352b6c8c464b84a2bb6c3ff4f578ab5fc2aef29ffbda575118de3809d1562c83453af39bdc9bceeb5e70289 WHIRLPOOL 87bdb2e40c7c43b68ab574600bed67e02a54b9d58c41b8d907cf1f467ed208276c56d9abf6bd47a61b29eed7021aaf1af191d1117a170bd527f63ea9e91ec4ae
+MISC ChangeLog-2015 4551 SHA256 ddb1f4dbb017d0188b521eae8224e32320857255a5f282e988f5eb119d16980a SHA512 f85a0a36c3c25960f62b2055f57f7af16ecf626c6d738b3e65a0b50482db421899a4d18e8aa824d629786a2edf461a7c6e8b932185a1c6a602d5de194e86d260 WHIRLPOOL 26e3d64afbc62c8de77f86464c66b7d933078250a24a0c9999005b89bc8be4981b3b34d0d72e925d3188d61c42996458c44e2f64081945f9645c3a2b70dcf4f5
+MISC metadata.xml 334 SHA256 b908cc51f6586a24648b0029eb03dd4784fe521e780e1050ac80c33f4f77ef65 SHA512 23517fbebe1eedf4558ec1c04e10774229762eb7279d0bda99f602fac526afd817968bbff0ba23a1ef433684afda85f830ed7f5643b7c9cca22e7d2f66f71691 WHIRLPOOL ba211c3420da6f22ffb41f68d79da72061b3d2cfc9f2e271d850ffcf5e29f48c7aaa77bb9d0bb01ac4657fba6e32061d92b88c27da5d9c0c4cfc263e1d33c7b6
diff --git a/dev-tcltk/tclreadline/files/tclreadline-2.1.0-alloc-free.patch b/dev-tcltk/tclreadline/files/tclreadline-2.1.0-alloc-free.patch
new file mode 100644
index 000000000000..6694c29f6042
--- /dev/null
+++ b/dev-tcltk/tclreadline/files/tclreadline-2.1.0-alloc-free.patch
@@ -0,0 +1,121 @@
+diff -ur a/tclreadline.c b/tclreadline.c
+--- a/tclreadline.c 2000-09-20 19:44:34.000000000 +0200
++++ b/tclreadline.c 2013-11-18 10:35:13.889610060 +0100
+@@ -343,7 +343,9 @@
+ return TCL_ERROR;
+ } else if (3 == objc) {
+- if (tclrl_custom_completer)
++ if (tclrl_custom_completer) {
+- FREE(tclrl_custom_completer);
++ free(tclrl_custom_completer);
++ tclrl_custom_completer = NULL;
++ }
+ if (!blank_line(Tcl_GetStringFromObj(objv[2], 0)))
+ tclrl_custom_completer =
+ stripwhite(strdup(Tcl_GetStringFromObj(objv[2], 0)));
+@@ -378,7 +380,9 @@
+ return TCL_ERROR;
+ } else if (3 == objc) {
+- if (tclrl_eof_string)
++ if (tclrl_eof_string) {
+- FREE(tclrl_eof_string);
++ free(tclrl_eof_string);
++ tclrl_eof_string = NULL;
++ }
+ if (!blank_line(Tcl_GetStringFromObj(objv[2], 0)))
+ tclrl_eof_string =
+ stripwhite(strdup(Tcl_GetStringFromObj(objv[2], 0)));
+@@ -506,10 +510,16 @@
+ if (status >= 1) {
+ /* TODO: make this a valid tcl output */
+ printf("%s\n", expansion);
++ free(ptr);
++ free(expansion);
++ return;
+ } else if (-1 == status) {
+ Tcl_AppendResult
+ (tclrl_interp, "error in history expansion\n", (char*) NULL);
+ TclReadlineTerminate(TCL_ERROR);
++ free(ptr);
++ free(expansion);
++ return;
+ }
+ /**
+ * TODO: status == 2 ...
+@@ -544,8 +554,8 @@
+ * tell the calling routines to terminate.
+ */
+ TclReadlineTerminate(LINE_COMPLETE);
+- FREE(ptr);
+- FREE(expansion);
++ free(ptr);
++ free(expansion);
+ }
+ }
+
+@@ -673,7 +683,7 @@
+ strcpy(rl_line_buffer, expansion);
+ rl_end = strlen(expansion);
+ rl_point += strlen(expansion) - oldlen;
+- FREE(expansion);
++ free(expansion);
+ /*
+ * TODO:
+ * because we return 0 == matches,
+@@ -682,7 +690,8 @@
+ */
+ return matches;
+ }
+- FREE(expansion);
++ free(expansion);
++ expansion = NULL;
+ }
+
+ if (tclrl_custom_completer) {
+@@ -699,15 +710,19 @@
+ state = Tcl_VarEval(tclrl_interp, tclrl_custom_completer,
+ " \"", quoted_text, "\" ", start_s, " ", end_s,
+ " \"", quoted_rl_line_buffer, "\"", (char*) NULL);
+- FREE(quoted_text);
+- FREE(quoted_rl_line_buffer);
+ if (TCL_OK != state) {
+ Tcl_AppendResult (tclrl_interp, " `", tclrl_custom_completer,
+ " \"", quoted_text, "\" ", start_s, " ", end_s,
+ " \"", quoted_rl_line_buffer, "\"' failed.", (char*) NULL);
+ TclReadlineTerminate(state);
++ free(quoted_text);
++ free(quoted_rl_line_buffer);
+ return matches;
+ }
++ free(quoted_text);
++ quoted_text = NULL;
++ free(quoted_rl_line_buffer);
++ quoted_rl_line_buffer = NULL;
+ obj = Tcl_GetObjResult(tclrl_interp);
+ status = Tcl_ListObjGetElements(tclrl_interp, obj, &objc, &objv);
+ if (TCL_OK != status)
+@@ -715,12 +732,12 @@
+
+ if (objc) {
+ int i, length;
+- matches = (char**) MALLOC(sizeof(char*) * (objc + 1));
++ matches = (char**) malloc(sizeof(char*) * (objc + 1));
+ for (i = 0; i < objc; i++) {
+ matches[i] = strdup(Tcl_GetStringFromObj(objv[i], &length));
+ if (1 == objc && !strlen(matches[i])) {
+- FREE(matches[i]);
++ free(matches[i]);
+- FREE(matches);
++ free(matches);
+ Tcl_ResetResult(tclrl_interp); /* clear result space */
+ return (char**) NULL;
+ }
+@@ -735,7 +752,7 @@
+ */
+ if (2 == objc && !strlen(matches[1])) {
+ i--;
+- FREE(matches[1]);
++ free(matches[1]);
+ rl_completion_append_character = '\0';
+ }
+
diff --git a/dev-tcltk/tclreadline/files/tclreadline-2.1.0-gold.patch b/dev-tcltk/tclreadline/files/tclreadline-2.1.0-gold.patch
new file mode 100644
index 000000000000..5550c89879c8
--- /dev/null
+++ b/dev-tcltk/tclreadline/files/tclreadline-2.1.0-gold.patch
@@ -0,0 +1,15 @@
+ Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index 68d78f1..03dbf06 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -20,6 +20,7 @@ include_HEADERS = tclreadline.h
+ INCLUDES = -I$(TCL_INCLUDE_DIR) -I$(READLINE_INCLUDE_DIR)
+
+ ## libtclreadline_la_LIBADD = $(LIBS)
++libtclreadline_la_LIBADD = $(TCL_LIB_SPEC) -lreadline
+ libtclreadline_la_LDFLAGS = -release $(MAJOR).$(MINOR).$(PATCHLEVEL)
+
+ tclrldir = @TCLRL_DIR@
diff --git a/dev-tcltk/tclreadline/files/tclreadline-2.1.0-rl-executing-macro.patch b/dev-tcltk/tclreadline/files/tclreadline-2.1.0-rl-executing-macro.patch
new file mode 100644
index 000000000000..683622e0d54c
--- /dev/null
+++ b/dev-tcltk/tclreadline/files/tclreadline-2.1.0-rl-executing-macro.patch
@@ -0,0 +1,128 @@
+diff -ur a/configure.ac b/configure.ac
+--- a/configure.ac 2000-12-08 01:45:45.000000000 +0100
++++ b/configure.ac 2013-11-15 13:37:36.490520853 +0100
+@@ -182,29 +182,36 @@
+ [ --with-readline-library=DIR
+ lib spec to readline (e.g. '-L/usr/local/lib -lreadline')],
+ LIBS="$LIBS $withval",
+- AC_CHECK_LIB(readline, rl_callback_read_char, ,
+- AC_MSG_RESULT([
+- Your readline version does not support readline's alternate interface.
+- Please upgrade to readline >= 2.2 and retry.
+- ])
+- exit
++ AC_SEARCH_LIBS(rl_callback_read_char, readline, ,
++ AC_MSG_RESULT([
++ Your readline version does not support readline's alternate interface.
++ Please upgrade to readline >= 2.2 and retry.
++ ])
++ exit
+ )
+ )
+
+
+
+-# check for readline's (macro.c) private variable
+-# _rl_executing_macro.
++# check for readline's rl_executing_macro
++# (could be macro.c's private variable _rl_executing_macro).
+
+-AC_MSG_CHECKING([for _rl_executing_macro in -lreadline])
+-AC_TRY_LINK(,[
++AC_CHECK_DECL(rl_executing_macro
++, AC_DEFINE(EXECUTING_MACRO_NAME, rl_executing_macro,
++ [ Define the name of the executing macro variable in libreadline. ])
++, AC_MSG_CHECKING([for _rl_executing_macro in -lreadline])
++ AC_TRY_LINK(,[
+ extern char* _rl_executing_macro;
+ _rl_executing_macro = (char*) 0;
+-],
+- AC_MSG_RESULT(yes);
++ ]
++ , AC_MSG_RESULT(yes)
+ AC_DEFINE(EXECUTING_MACRO_HACK, 1,
+- [ Define if _rl_executing_macro is resolved in libreadline. ]),
+- AC_MSG_RESULT(no))
++ [ Define if EXECUTING_MACRO_NAME is resolved in libreadline. ])
++ AC_DEFINE(EXECUTING_MACRO_NAME, _rl_executing_macro,
++ [ Define the name of the executing macro variable in libreadline. ])
++ , AC_MSG_RESULT(no))
++, [AC_INCLUDES_DEFAULT
++#include "$READLINE_INCLUDE_DIR/readline.h"])
+
+ # check for readline's rl_cleanup_after_signal
+
+diff -ur a/tclreadline.c b/tclreadline.c
+--- a/tclreadline.c 2000-09-20 19:44:34.000000000 +0200
++++ b/tclreadline.c 2013-11-15 11:09:42.269771129 +0100
+@@ -41,7 +41,7 @@
+ * We need it here to decide, if we should read more
+ * characters from a macro. Dirty, but it should work.
+ */
+-extern char* _rl_executing_macro;
++extern char* EXECUTING_MACRO_NAME;
+ #endif
+
+ #include "tclreadline.h"
+@@ -249,14 +249,14 @@
+ tclrl_state = LINE_PENDING;
+
+ while (!TclReadlineLineComplete()) {
+-#ifdef EXECUTING_MACRO_HACK
++#ifdef EXECUTING_MACRO_NAME
+ /**
+ * check first, if more characters are
+ * available from _rl_executing_macro,
+ * because Tcl_DoOneEvent() will (naturally)
+ * not detect this `event'.
+ */
+- if (_rl_executing_macro)
++ if (EXECUTING_MACRO_NAME)
+ TclReadlineReadHandler((ClientData) NULL, TCL_READABLE);
+ else
+ #endif
+@@ -468,17 +468,17 @@
+ TclReadlineReadHandler(ClientData clientData, int mask)
+ {
+ if (mask & TCL_READABLE) {
+-#ifdef EXECUTING_MACRO_HACK
++#ifdef EXECUTING_MACRO_NAME
+ do {
+ #endif
+ rl_callback_read_char();
+-#ifdef EXECUTING_MACRO_HACK
++#ifdef EXECUTING_MACRO_NAME
+ /**
+ * check, if we're inside a macro and
+ * if so, read all macro characters
+ * until the next eol.
+ */
+- } while (_rl_executing_macro && !TclReadlineLineComplete());
++ } while (EXECUTING_MACRO_NAME && !TclReadlineLineComplete());
+ #endif
+ }
+ }
+@@ -517,12 +517,12 @@
+
+ Tcl_AppendResult(tclrl_interp, expansion, (char*) NULL);
+
+-#ifdef EXECUTING_MACRO_HACK
++#ifdef EXECUTING_MACRO_NAME
+ /**
+ * don't stuff macro lines
+ * into readline's history.
+ */
+- if(!_rl_executing_macro) {
++ if(!EXECUTING_MACRO_NAME) {
+ #endif
+ /**
+ * don't stuff empty lines
+@@ -537,7 +537,7 @@
+ if (tclrl_last_line)
+ free(tclrl_last_line);
+ tclrl_last_line = strdup(expansion);
+-#ifdef EXECUTING_MACRO_HACK
++#ifdef EXECUTING_MACRO_NAME
+ }
+ #endif
+ /**
diff --git a/dev-tcltk/tclreadline/files/tclreadline-2.1.0-rl-history-expand.patch b/dev-tcltk/tclreadline/files/tclreadline-2.1.0-rl-history-expand.patch
new file mode 100644
index 000000000000..6e4d5270e41a
--- /dev/null
+++ b/dev-tcltk/tclreadline/files/tclreadline-2.1.0-rl-history-expand.patch
@@ -0,0 +1,35 @@
+diff -ur a/tclreadline.c b/tclreadline.c
+--- a/tclreadline.c 2013-11-16 20:14:28.876272386 +0100
++++ b/tclreadline.c 2013-11-16 20:14:24.191390550 +0100
+@@ -503,25 +503,22 @@
+ char* expansion = (char*) NULL;
+ int status = history_expand(ptr, &expansion);
+
+- if (status >= 1) {
++ if (status >= 2) {
+ /* TODO: make this a valid tcl output */
+ printf("%s\n", expansion);
+ free(ptr);
+ free(expansion);
+ return;
+- } else if (-1 == status) {
++ } else if (status <= -1) {
+ Tcl_AppendResult
+- (tclrl_interp, "error in history expansion\n", (char*) NULL);
++ (tclrl_interp, "error in history expansion: ", expansion, "\n", (char*) NULL);
+ TclReadlineTerminate(TCL_ERROR);
+ free(ptr);
+ free(expansion);
+ return;
+- }
+- /**
+- * TODO: status == 2 ...
+- */
+-
+- Tcl_AppendResult(tclrl_interp, expansion, (char*) NULL);
++ } else {
++ Tcl_AppendResult(tclrl_interp, expansion, (char*) NULL);
++ }
+
+ #ifdef EXECUTING_MACRO_HACK
+ /**
diff --git a/dev-tcltk/tclreadline/files/tclreadline-2.1.0-rl-prompt.patch b/dev-tcltk/tclreadline/files/tclreadline-2.1.0-rl-prompt.patch
new file mode 100644
index 000000000000..a10a404100d3
--- /dev/null
+++ b/dev-tcltk/tclreadline/files/tclreadline-2.1.0-rl-prompt.patch
@@ -0,0 +1,12 @@
+diff -ur a/tclreadline.c b/tclreadline.c
+--- a/tclreadline.c 2013-11-16 20:14:28.876272386 +0100
++++ b/tclreadline.c 2013-11-16 20:37:47.455986902 +0100
+@@ -234,7 +234,7 @@
+
+ rl_callback_handler_install(
+ objc == 3 ? Tcl_GetStringFromObj(objv[2], 0)
+- : "%", TclReadlineLineCompleteHandler);
++ : "% ", TclReadlineLineCompleteHandler);
+
+ Tcl_CreateFileHandler(0, TCL_READABLE,
+ TclReadlineReadHandler, (ClientData) NULL);
diff --git a/dev-tcltk/tclreadline/metadata.xml b/dev-tcltk/tclreadline/metadata.xml
new file mode 100644
index 000000000000..4d4cdbb530ea
--- /dev/null
+++ b/dev-tcltk/tclreadline/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>tcltk@gentoo.org</email>
+ <name>Gentoo Tcltk Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">tclreadline</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-tcltk/tclreadline/tclreadline-2.1.0-r4.ebuild b/dev-tcltk/tclreadline/tclreadline-2.1.0-r4.ebuild
new file mode 100644
index 000000000000..e668266ef24e
--- /dev/null
+++ b/dev-tcltk/tclreadline/tclreadline-2.1.0-r4.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+
+inherit autotools-utils multilib toolchain-funcs
+
+DEBIAN_PATCH=12
+
+DESCRIPTION="Readline extension to TCL"
+HOMEPAGE="http://tclreadline.sf.net/"
+SRC_URI="
+ mirror://sourceforge/${PN}/${P}.tar.gz
+ mirror://debian/pool/main/t/${PN}/${PN}_${PV}-${DEBIAN_PATCH}.debian.tar.gz"
+
+SLOT="0"
+LICENSE="BSD"
+KEYWORDS="alpha amd64 ppc ~sparc x86 ~amd64-linux ~x86-linux"
+IUSE="static-libs"
+
+DEPEND="
+ dev-lang/tcl:0=
+ sys-libs/readline:0="
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-gold.patch
+ "${FILESDIR}"/${P}-alloc-free.patch
+ "${FILESDIR}"/${P}-rl-executing-macro.patch
+ "${FILESDIR}"/${P}-rl-history-expand.patch
+ "${FILESDIR}"/${P}-rl-prompt.patch
+ "${WORKDIR}"/debian/patches/complete_nontcl.patch
+ "${WORKDIR}"/debian/patches/completion_matches.patch
+ "${WORKDIR}"/debian/patches/completion_pbug.patch
+ "${WORKDIR}"/debian/patches/kfreebsd.patch
+ "${WORKDIR}"/debian/patches/link.patch
+ "${WORKDIR}"/debian/patches/manpage.patch
+ "${WORKDIR}"/debian/patches/memuse.patch
+# "${WORKDIR}"/debian/patches/tclrldir.patch
+ "${WORKDIR}"/debian/patches/tclshpath.patch
+ "${WORKDIR}"/debian/patches/tinfo.patch
+ "${WORKDIR}"/debian/patches/varnames.patch
+
+ )
+
+src_prepare() {
+ sed \
+ -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" \
+ -e "/^TCLRL_LIBDIR/s:lib:$(get_libdir):g" \
+ -i configure.in || die
+ mv configure.{in,ac} || die
+ sed \
+ -e 's:configure.in:configure.ac:g' \
+ -i "${WORKDIR}"/debian/patches/* || die
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ --with-tcl="${EPREFIX}/usr/$(get_libdir)"
+ --with-tcl-includes="${EPREFIX}/usr/include"
+ --with-readline-includes="${EPREFIX}/usr/include"
+ --with-readline-library="-lreadline"
+ )
+ autotools-utils_src_configure
+}