From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- dev-tcltk/tclpython/Manifest | 7 + .../tclpython/files/tclpython-4.1-python-3.patch | 229 +++++++++++++++++++++ dev-tcltk/tclpython/metadata.xml | 8 + dev-tcltk/tclpython/tclpython-4.1-r4.ebuild | 54 +++++ dev-tcltk/tclpython/tclpython-4.1-r6.ebuild | 55 +++++ 5 files changed, 353 insertions(+) create mode 100644 dev-tcltk/tclpython/Manifest create mode 100644 dev-tcltk/tclpython/files/tclpython-4.1-python-3.patch create mode 100644 dev-tcltk/tclpython/metadata.xml create mode 100644 dev-tcltk/tclpython/tclpython-4.1-r4.ebuild create mode 100644 dev-tcltk/tclpython/tclpython-4.1-r6.ebuild (limited to 'dev-tcltk/tclpython') diff --git a/dev-tcltk/tclpython/Manifest b/dev-tcltk/tclpython/Manifest new file mode 100644 index 000000000000..c4bac1205bcb --- /dev/null +++ b/dev-tcltk/tclpython/Manifest @@ -0,0 +1,7 @@ +AUX tclpython-4.1-python-3.patch 8863 SHA256 0a709c1677a9a25d2e0d208b5dacbdc3bbea59e1f60dd3f4d136ee6a876b9d73 SHA512 530d057501ef72e7f28cfff1f0af2076b93739085154fc4d20a5b59b26e33d1418bf694093b05e840055734438232dd9414ba0262720fb4bd2e35249769b24e7 WHIRLPOOL c3873f256891466ada9248fc85e806cf213fa0ed85c1a60d973a86260db6063cace03dc28d975926886341be59b8add95213ab3b501815021e668de7a01c9158 +DIST tclpython-4.1.tar.bz2 10580 SHA256 663e0e9e16875fda8e98fd8c74108475062b5e96dcf7145b46142b16c289db50 SHA512 5f08e7129a7d9afeb1ac6bf1ab1c83ad3bb481593c9516c0653c7b4ba0dfb1b3129a336e64b998cec8ef2d2377a6a366b73c640d25839ab280d5079c0b220d54 WHIRLPOOL a3535555eb314dd19f54628135053c4eac0a9cb79cc1be7cca3b8f861c826438765fa98513fc7f7ac3271fd4fef7f9f70e036421a5b7991035b328b63239ba03 +EBUILD tclpython-4.1-r4.ebuild 1264 SHA256 43c679992eb8eb8d2cd3cc18da39eddead32df1300cd2ab98eeebf76524cbc88 SHA512 7041ef994f59b536fca064a5aaf455ba1a7e67b0a96e9e619b7d47f493f875eed5275816b94f56fe3a82f53dbaaf530cca12b16e9eeca6aae704b2b4e1377900 WHIRLPOOL 131381262b8a3646dd9660ad8ccef840ac68028f111baba20dce3d2652dda8a9d5c50a23f5a311336c4c2095e790e7e1efc6268b9916a63991cf6f441da8ee8c +EBUILD tclpython-4.1-r6.ebuild 1296 SHA256 d3da02e0d98f721cc1218eee094d864894995d77514a06e8920a16a0b9a1e0fd SHA512 ea7b582fbc1796eaaf6195868f1c31c2fdef6d7fe1c7df87437fafc0a48e86110dda9a80dd34b40347356d0cfe4ec58d2021bdd396f23ddeac8914f1bf216c5c WHIRLPOOL 9c39e973745acb46d35170859d168a427c33cf55632bb75daa3b2d78baf2b15e75ee566c8e68c2152e82a8e46e875b4617627c617ee91e16b9bce4ba23af9044 +MISC ChangeLog 3452 SHA256 b6b423d01ed885ae381de0b096851ab72c9cd0182efd8d6411cb242f5948d085 SHA512 263ba28c1a2d16f0c4197413a7c1619fb89c8404112cba040884ba70fa85928ed13e96ba20c16dfb82694d7f79c71630c666907b94edad8f3f354a3523e4ef5c WHIRLPOOL 5134afbd933fbba070bc40a8bee13671801055647fb3ca4e29385ccc6f7b0229f2a793f8a2924b25820a32f24f88c3ae4ab8014cff286593c34058b04ca37f7e +MISC ChangeLog-2015 3237 SHA256 196b9fc428edfaeef69d3a9d6a50f51e36b7c2c02084a3f808860df8ff93036c SHA512 7034d0903fb37720b62b0e75b8e13183a0cce6362ded434f395200d526dbd7387114a850907b160f00963cc70fd60d25210abb3fc4fd3296cbcb79a77cee3e99 WHIRLPOOL ed5f4bf9405eb675f773017ba568dae3ab4f47396453d6820d96b54ec17c2799c2c87f47dc31a4f72e7d9c96bfc794d77a53e75bb43a7a412033ab81ca08095f +MISC metadata.xml 259 SHA256 f3ad7890286839b12dc011613c2ba3df199a206c295ba8c433a8fe7f0dcc5815 SHA512 5943f2c9dc9a55862bae4c01be9e1f27304ffc1ce48d67341b4a19793c0bb11fe3d1a419af924ac360aeeafbce28018971602019a559a8a6c5939e05e3567639 WHIRLPOOL f5ad746e91e08e44d2d857057d7203fe515cbdd295f69a2d3ce2cb35343d2dc3f2879b57d00e8782bd416bfd36ce4504a7a91bbcf325eabe71075d0726e2bece diff --git a/dev-tcltk/tclpython/files/tclpython-4.1-python-3.patch b/dev-tcltk/tclpython/files/tclpython-4.1-python-3.patch new file mode 100644 index 000000000000..2a26f647c10e --- /dev/null +++ b/dev-tcltk/tclpython/files/tclpython-4.1-python-3.patch @@ -0,0 +1,229 @@ +--- a/tclpython.c 2006-03-07 16:28:03.000000000 +0300 ++++ b/tclpython.c 2014-05-06 23:33:41.713623943 +0400 +@@ -19,13 +19,83 @@ + $ cc -fpic -I/usr/local/include/tcltk/tcl8.3 -c tclthread.c + $ ld -o tclpython.so -Bshareable -L/usr/X11R6/lib -L/usr/local/lib -L/usr/local/share/python/config tclpython.o tclthread.o -lpython -lutil -lreadline -ltermcap -lcrypt -lgmp -lgdbm -lpq -lz -ltcl83 -ltk83 -lX11 + ++Patched for Python 3 with respect to https://github.com/facebook/fbthrift/blob/master/thrift/lib/py/protocol/fastbinary.c ++ + */ + + #include + #include +-#include ++ ++#if PY_MAJOR_VERSION >= 3 ++ #define PyInt_FromLong PyLong_FromLong ++ #define PyInt_AsLong PyLong_AsLong ++ #define PyString_FromStringAndSize PyBytes_FromStringAndSize ++#else ++ #include ++#endif ++ + #include "tclpython.h" + ++// Mostly copied from cStringIO.c ++#if PY_MAJOR_VERSION >= 3 ++ ++/** io module in python3. */ ++static PyObject* Python3IO; ++ ++typedef struct { ++ PyObject_HEAD ++ char *buf; ++ Py_ssize_t pos, string_size; ++} IOobject; ++ ++#define IOOOBJECT(O) ((IOobject*)(O)) ++ ++static int ++IO__opencheck(IOobject *self) { ++ if (!self->buf) { ++ PyErr_SetString(PyExc_ValueError, ++ "I/O operation on closed file"); ++ return 0; ++ } ++ return 1; ++} ++ ++static PyObject * ++IO_cgetval(PyObject *self) { ++ if (!IO__opencheck(IOOOBJECT(self))) return NULL; ++ assert(IOOOBJECT(self)->pos >= 0); ++ return PyBytes_FromStringAndSize(((IOobject*)self)->buf, ++ ((IOobject*)self)->pos); ++} ++#endif ++ ++/* -- PYTHON MODULE SETUP STUFF --- */ ++ ++static PyObject *pythonTclEvaluate(PyObject *self, PyObject *args); ++ ++static PyMethodDef tclMethods[] = { ++ {"eval", pythonTclEvaluate, METH_VARARGS, "Evaluate a Tcl script."}, ++ {0, 0, 0, 0} /* sentinel */ ++}; ++ ++#if PY_MAJOR_VERSION >= 3 ++struct module_state { ++ PyObject *error; ++}; ++ ++static struct PyModuleDef TclModuleDef = { ++ PyModuleDef_HEAD_INIT, ++ "tcl", ++ NULL, ++ sizeof(struct module_state), ++ tclMethods, ++ NULL, ++ NULL, ++ NULL, ++ NULL ++}; ++#endif ++ + #ifndef WIN32 + /* George Petasis, 21 Feb 2006: + * The following check cannot be handled correctly +@@ -66,13 +136,13 @@ + + static int pythonInterpreter(ClientData clientData, Tcl_Interp *interpreter, int numberOfArguments, Tcl_Obj * CONST arguments[]) + { +- int identifier; ++ intptr_t identifier; + PyObject *output; + PyObject *message; + PyObject *result; + PyObject *globals; + char *string = 0; +- int length; ++ Py_ssize_t length; + Tcl_Obj *object; + struct Tcl_HashEntry *entry; + unsigned evaluate; +@@ -111,12 +181,22 @@ + /* choose start token depending on whether this is an evaluation or an execution: */ + result = PyRun_String(Tcl_GetString(arguments[2]), (evaluate? Py_eval_input: Py_file_input), globals, globals); + if (result == 0) { /* an error occured */ ++#if PY_MAJOR_VERSION >= 3 ++ output = PyObject_CallMethod(Python3IO, "BytesIO", "()"); ++#else + output = PycStringIO->NewOutput(1024); /* use a reasonable initial size but big enough to handle most cases */ +- PySys_SetObject("stderr", output); /* capture all interpreter error output */ ++#endif ++ PySys_SetObject("sys.stderr", output); /* capture all interpreter error output */ + PyErr_Print(); /* so that error is printed on standard error, redirected above */ ++#if PY_MAJOR_VERSION >= 3 ++ message = IO_cgetval(output); ++ string = PyBytes_AsString(message); ++ length = (string == NULL) ? 0 : strlen(string); ++#else + message = PycStringIO->cgetvalue(output); + string = PyString_AsString(message); + length = PyString_Size(message); ++#endif + if ((length > 0) && (string[length - 1] == '\n')) length--; /* eventually remove trailing new line character */ + object = Tcl_NewObj(); + Tcl_AppendStringsToObj(object, Tcl_GetString(arguments[0]), ": ", 0); /* identify interpreter in error */ +@@ -124,7 +204,11 @@ + Py_DECREF(output); + } else { + if (evaluate) { ++#if PY_MAJOR_VERSION >= 3 ++ string = PyUnicode_AsUTF8(PyObject_Str(result)); ++#else + string = PyString_AsString(PyObject_Str(result)); ++#endif + object = Tcl_NewStringObj(string, -1); /* return evaluation result */ + } else /* execute */ + object = Tcl_NewObj(); /* always return an empty result or an error */ +@@ -139,9 +223,9 @@ + + Tcl_Interp *tclInterpreter(CONST char *name) /* public function for use in extensions to this extension */ + { +- int identifier; ++ intptr_t identifier; + +- if ((sscanf(name, "tcl%u", &identifier) == 0) || (identifier != 0)) { ++ if ((sscanf(name, "tcl%lu", &identifier) == 0) || (identifier != 0)) { + return 0; /* invalid name */ + } else { + return mainInterpreter; /* sole available interpreter */ +@@ -188,14 +272,9 @@ + return Py_BuildValue("s", result); + } + +-static PyMethodDef tclMethods[] = { +- {"eval", pythonTclEvaluate, METH_VARARGS, "Evaluate a Tcl script."}, +- {0, 0, 0, 0} /* sentinel */ +-}; +- + static int newInterpreter(Tcl_Interp *interpreter) + { +- int identifier; ++ intptr_t identifier; + Tcl_Obj *object; + int created; + #ifdef WITH_THREAD +@@ -214,19 +293,31 @@ + return TCL_ERROR; + } else { + Py_Initialize(); /* initialize main interpreter */ ++#if PY_MAJOR_VERSION >= 3 ++ Python3IO = PyImport_ImportModule("io"); ++#else + PycString_IMPORT; ++#endif + } + Tcl_SetHashValue(Tcl_CreateHashEntry(&threadStates, (ClientData)identifier, &created), 0); + #else + if (existingInterpreters == 0) { + Py_Initialize(); /* initialize main interpreter */ + PyEval_InitThreads(); /* initialize and acquire the global interpreter lock */ ++#if PY_MAJOR_VERSION >= 3 ++ Python3IO = PyImport_ImportModule("io"); ++#else + PycString_IMPORT; ++#endif + globalState = PyThreadState_Swap(0); /* save the global thread */ + } else { + PyEval_AcquireLock(); /* needed in order to be able to create a new interpreter */ + } ++#if PY_MAJOR_VERSION >= 3 ++ if (Python3IO == 0) { /* make sure string input/output is properly initialized */ ++#else + if (PycStringIO == 0) { /* make sure string input/output is properly initialized */ ++#endif + Tcl_SetResult(interpreter, "fatal error: could not initialize Python string input/output module", TCL_STATIC); + return TCL_ERROR; + } +@@ -250,7 +341,11 @@ + newIdentifier++; + #endif + existingInterpreters++; ++#if PY_MAJOR_VERSION >= 3 ++ tcl = PyModule_Create(&TclModuleDef); ++#else + tcl = Py_InitModule("tcl", tclMethods); /* add a new 'tcl' module to the python interpreter */ ++#endif + Py_INCREF(tcl); + PyModule_AddObject(PyImport_AddModule("__builtin__"), "tcl", tcl); + return TCL_OK; +@@ -260,7 +355,7 @@ + { + int index; + char *name; +- int identifier; ++ intptr_t identifier; + struct Tcl_HashEntry *entry; + Tcl_Obj *object; + #ifdef WITH_THREAD +@@ -270,7 +365,7 @@ + for (index = 0; index < numberOfArguments; index++) { + name = Tcl_GetString(arguments[index]); /* interpreter name is "pythonN" */ + entry = 0; +- if (sscanf(name, "python%u", &identifier) == 1) { ++ if (sscanf(name, "python%lu", &identifier) == 1) { + identifier = atoi(name + 6); + entry = Tcl_FindHashEntry(&threadStates, (ClientData)identifier); + } diff --git a/dev-tcltk/tclpython/metadata.xml b/dev-tcltk/tclpython/metadata.xml new file mode 100644 index 000000000000..227dda5ba584 --- /dev/null +++ b/dev-tcltk/tclpython/metadata.xml @@ -0,0 +1,8 @@ + + + + + tcltk@gentoo.org + Gentoo Tcltk Project + + diff --git a/dev-tcltk/tclpython/tclpython-4.1-r4.ebuild b/dev-tcltk/tclpython/tclpython-4.1-r4.ebuild new file mode 100644 index 000000000000..d76649cf5f20 --- /dev/null +++ b/dev-tcltk/tclpython/tclpython-4.1-r4.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +PYTHON_COMPAT=( python{2_7,3_4} ) + +inherit eutils multilib python-single-r1 toolchain-funcs + +DESCRIPTION="Python package for Tcl" +HOMEPAGE="http://jfontain.free.fr/tclpython.htm" +SRC_URI="http://jfontain.free.fr/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ppc x86" +IUSE="" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +DEPEND="${PYTHON_DEPS} + dev-lang/tcl:0=" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}"/${P}-python-3.patch +) + +src_prepare() { + epatch "${PATCHES[@]}" +} + +src_compile() { + local cfile="tclpython tclthread" + for src in ${cfile}; do + compile="$(tc-getCC) -shared -fPIC ${CFLAGS} -I$(python_get_includedir) -c ${src}.c" + einfo "${compile}" + eval "${compile}" || die + done + + link="$(tc-getCC) -fPIC -shared ${LDFLAGS} -o tclpython.so.${PV} tclpython.o tclthread.o -lpthread -lutil $(python_get_LIBS) -ltcl" + einfo "${link}" + eval "${link}" || die +} + +src_install() { + insinto /usr/$(get_libdir)/tclpython + doins tclpython.so.${PV} pkgIndex.tcl + fperms 775 /usr/$(get_libdir)/tclpython/tclpython.so.${PV} + dosym tclpython.so.${PV} /usr/$(get_libdir)/tclpython/tclpython.so + + dodoc CHANGES INSTALL README + dohtml tclpython.htm +} diff --git a/dev-tcltk/tclpython/tclpython-4.1-r6.ebuild b/dev-tcltk/tclpython/tclpython-4.1-r6.ebuild new file mode 100644 index 000000000000..6359b225c9ff --- /dev/null +++ b/dev-tcltk/tclpython/tclpython-4.1-r6.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} ) + +inherit eutils multilib python-single-r1 toolchain-funcs + +DESCRIPTION="Python package for Tcl" +HOMEPAGE="http://jfontain.free.fr/tclpython.htm" +SRC_URI="http://jfontain.free.fr/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ppc x86" +IUSE="" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +DEPEND="${PYTHON_DEPS} + dev-lang/tcl:0= + sys-libs/binutils-libs" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}"/${P}-python-3.patch +) + +src_prepare() { + epatch "${PATCHES[@]}" +} + +src_compile() { + local cfile="tclpython tclthread" + for src in ${cfile}; do + compile="$(tc-getCC) -shared -fPIC ${CFLAGS} -I$(python_get_includedir) -c ${src}.c" + einfo "${compile}" + eval "${compile}" || die + done + + link="$(tc-getCC) -fPIC -shared ${LDFLAGS} -o tclpython.so.${PV} tclpython.o tclthread.o -lpthread -lutil $(python_get_LIBS) -ltcl" + einfo "${link}" + eval "${link}" || die +} + +src_install() { + insinto /usr/$(get_libdir)/tclpython + doins tclpython.so.${PV} pkgIndex.tcl + fperms 775 /usr/$(get_libdir)/tclpython/tclpython.so.${PV} + dosym tclpython.so.${PV} /usr/$(get_libdir)/tclpython/tclpython.so + + dodoc CHANGES INSTALL README + dohtml tclpython.htm +} -- cgit v1.2.3