diff options
author | Justin Lecher <jlec@gentoo.org> | 2014-10-27 14:22:44 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2014-10-27 14:22:44 +0000 |
commit | bb030d93598e73634067ba25863aeb33fb3b4b90 (patch) | |
tree | 1eae1e8b063000cd669bc7ff3a8b6f887fbd93ee /dev-tcltk | |
parent | Stable for x86, wrt bug #526502 (diff) | |
download | historical-bb030d93598e73634067ba25863aeb33fb3b4b90.tar.gz historical-bb030d93598e73634067ba25863aeb33fb3b4b90.tar.bz2 historical-bb030d93598e73634067ba25863aeb33fb3b4b90.zip |
dev-tcltk/tclpython: Add missing patch, #509738; thanks Alexander Turenko for the backport
Package-Manager: portage-2.2.14/cvs/Linux x86_64
Manifest-Sign-Key: 0xB9D4F231BD1558AB!
Diffstat (limited to 'dev-tcltk')
-rw-r--r-- | dev-tcltk/tclpython/ChangeLog | 8 | ||||
-rw-r--r-- | dev-tcltk/tclpython/Manifest | 33 | ||||
-rw-r--r-- | dev-tcltk/tclpython/files/tclpython-4.1-python-3.patch | 229 | ||||
-rw-r--r-- | dev-tcltk/tclpython/tclpython-4.1-r4.ebuild (renamed from dev-tcltk/tclpython/tclpython-4.1-r3.ebuild) | 12 |
4 files changed, 263 insertions, 19 deletions
diff --git a/dev-tcltk/tclpython/ChangeLog b/dev-tcltk/tclpython/ChangeLog index e2cdf764533e..c0a5c875ad46 100644 --- a/dev-tcltk/tclpython/ChangeLog +++ b/dev-tcltk/tclpython/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-tcltk/tclpython # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-tcltk/tclpython/ChangeLog,v 1.18 2014/10/26 18:45:17 jlec Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-tcltk/tclpython/ChangeLog,v 1.19 2014/10/27 14:22:43 jlec Exp $ + +*tclpython-4.1-r4 (27 Oct 2014) + + 27 Oct 2014; Justin Lecher <jlec@gentoo.org> -tclpython-4.1-r3.ebuild, + +tclpython-4.1-r4.ebuild, +files/tclpython-4.1-python-3.patch: + Add missing patch, #509738; thanks Alexander Turenko for the backport *tclpython-4.1-r3 (26 Oct 2014) diff --git a/dev-tcltk/tclpython/Manifest b/dev-tcltk/tclpython/Manifest index 4a4d09dfb6d7..1f34ceba1527 100644 --- a/dev-tcltk/tclpython/Manifest +++ b/dev-tcltk/tclpython/Manifest @@ -1,29 +1,30 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 +AUX tclpython-4.1-python-3.patch 8863 SHA256 0a709c1677a9a25d2e0d208b5dacbdc3bbea59e1f60dd3f4d136ee6a876b9d73 SHA512 530d057501ef72e7f28cfff1f0af2076b93739085154fc4d20a5b59b26e33d1418bf694093b05e840055734438232dd9414ba0262720fb4bd2e35249769b24e7 WHIRLPOOL c3873f256891466ada9248fc85e806cf213fa0ed85c1a60d973a86260db6063cace03dc28d975926886341be59b8add95213ab3b501815021e668de7a01c9158 DIST tclpython-3.1.tar.gz 6242 SHA256 b1126363be333352e15d65451cacd36be95b479c4b6c80871f32511cd1914bfe SHA512 5478ad43daeae306ceb85e4c264d6b10ead79eca9781cda58f3148c5409b71e58b53c4932e53de82b3a0a6025683be2ed848706e729679599ef55206c44a68ea WHIRLPOOL 67e11b6899b94532a28027d16115d1010d2a49378e0876d75b3f28a50313d58ebc6dab226a43d35925fd0761be1d0cc19590698528f911d06d558fee01c4d619 DIST tclpython-4.1.tar.bz2 10580 SHA256 663e0e9e16875fda8e98fd8c74108475062b5e96dcf7145b46142b16c289db50 SHA512 5f08e7129a7d9afeb1ac6bf1ab1c83ad3bb481593c9516c0653c7b4ba0dfb1b3129a336e64b998cec8ef2d2377a6a366b73c640d25839ab280d5079c0b220d54 WHIRLPOOL a3535555eb314dd19f54628135053c4eac0a9cb79cc1be7cca3b8f861c826438765fa98513fc7f7ac3271fd4fef7f9f70e036421a5b7991035b328b63239ba03 EBUILD tclpython-3.1-r1.ebuild 1281 SHA256 23914377e398e986705d86f2edcbfa9ee1d565549f188a934fe6590a8441e497 SHA512 bac68f9729d1287f73630fece7d63b5a6d4b8ec1675b435518973d1ad2d720fedee8deedd8bf479602d2723166584c29a4ff6144aa18caa957458f8fd497ae85 WHIRLPOOL dbc33ad351d8adec28d32e88d7f867da9f6a01cfef7dc2a222386d7de57489fadfa00c107937ad51b075cc918f4542aa45d9c1e6e72131b0be3a708bfb1d7fac EBUILD tclpython-4.1-r2.ebuild 1299 SHA256 6f14585c74c41c414c6dc8e0bc1218a5bdd3425e77e29e0ea1efdeda0262ab00 SHA512 89a719d41b7f8d17439e5b671d1edc42706ec9cee2006da7ea55c64bba9b44f309b8ea304afa956d9487ae8b09d740ac7d35a5a2aaad8006541170255a09523a WHIRLPOOL c9a9d398cac0744c291afdb879f2941617597e55f2bd183130732503123575d1d240ca0e915f3fb6a4467bc8337dcf2bde8b4d129db943ce758f15ab8c068d55 -EBUILD tclpython-4.1-r3.ebuild 1286 SHA256 4550654da1d8d067cc145543ae43a9b9bc1c69ffc783f0fe648316d81e34ad3f SHA512 2c9f7fae3eb5a56988249737f09de187e3395b7b651a4c00d3c11dfd17ceb3b6480e9253cc249ef26e2d58163f9f8b48bd4049c1783f418839f70c510e3eb831 WHIRLPOOL 817a5a6284b1f445c60dbb1776388e5a8ee6fddb292af519815ddb2ff697eb335116a24ef25d8f05c561cd42d4ca82cbe5e180ba89f1494c0e47c3625cf02682 -MISC ChangeLog 2457 SHA256 92683444d795f240428e05237c63efdc1d0a719462b8a26c00dac3c6e532f34d SHA512 d94fba3c9c58cf44b57ca20bff8b85538091ed9c19d24f8e486bc9baf3c74612bbfbc871b91691a449820dbe34ce47b2199cbbb8fe86c1f7702c50b758a7f3d7 WHIRLPOOL 905aa6dcf7c1738f1f2eec9f01d991001c31c5360d5a94f1c3e724932e06b394471ce75b9f2cfe6da48933ceabb016bbc7b2b0f02fd30f876fb74e74f78584a7 +EBUILD tclpython-4.1-r4.ebuild 1382 SHA256 74e86f4e954d6fbdbd4669794bc725122b2721635517f6cd63e464fe350c19df SHA512 e89e1e04fc2159c783ae6057d2c486f0665aabb278a5de296204425e110db2ae1b941a5b37dd0281007e103779b9880a37580dbde833d78867f91cc4426f66df WHIRLPOOL 86263a823c21c017623f0d45cb01237f62903e5601401371b7a9ceefa2e2211ea329c478179029bbabc1d20a80067cc9f16a4a779c4d422913696e1f9900d1da +MISC ChangeLog 2701 SHA256 371685754c89e9738d2f359e7771802e78b5ff9385b356abb4b0889daf5da45f SHA512 8c1ce7b1286a283e1288cde4155c2d9c52f4791d3a277bc212936a9e3761075c1c96b8e96cb1dac427d997fc6bbe662b96d91433347c040df5366166e49bb962 WHIRLPOOL 2b5e3292bbb137c5d0071a26cee0798bee594af88c8c341bb673a5e3dc447b822cd55dc8e78b4996b9412d6e192405341bd9306b94fd0996e8bed409c8222df9 MISC metadata.xml 160 SHA256 225a6f78d287329cdf2f4ed57468be28bd6565fd9a62207c2cc48e25ac9d3537 SHA512 a50627bda9ed953daf422b5a2e89b5b64e296d1a023d767c8a4ebb2cd51cd0036cecce455762a54e7d669f94d17d9de21052bac94fc08b1365ef42eb2f267742 WHIRLPOOL 61fa22d50aaf2bdecc467e26c9675cf7949ad55a4a8821730c91d1bd73f83fc4c35660851961310efa450e337a7ef572a925e186b8b05984d6315efc509fd365 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 -iQJ8BAEBCgBmBQJUTUFCXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w +iQJ8BAEBCgBmBQJUTlU0XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQyQ0JDQjFGMzBDQ0UxMjFGNENDNDgxMDdC -OUQ0RjIzMUJEMTU1OEFCAAoJELnU8jG9FViraYsP/ilH2rZ51DYVbGcD/0hl3nfo -8QOFMFHVa1W4ngVzxthcar7xJH72vMU6HURT86KP2SzBCt9s+Po872r5+1fivrI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MXAOfH3nxZySyfeCn1vutEOIwOnpXFIwHeJ27qaHv5rO3wp9zr3JHEV5aZllVZ +8hzHpdBfomcGnJhnUodm5ZiPCbUTG4OfS5phhBDzbJkHViGfn2w0ZpusCFHADMoJ +4L/C4yC9vQdw0D5NAa64CjLB2R4QN6ZFEjYV5sfgSFfj3U2TbYtM4KEMNiZ5n9Wj +OXDEaWrxnFrc8HuAbEszGB8P5uIQo+DKiFAyorDmths1oj77jyrVvggpAdwpNVaa +T6rcC170B7eDBqmCG8Ld +=t/T9 -----END PGP SIGNATURE----- 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 <Python.h> + #include <tcl.h> +-#include <cStringIO.h> ++ ++#if PY_MAJOR_VERSION >= 3 ++ #define PyInt_FromLong PyLong_FromLong ++ #define PyInt_AsLong PyLong_AsLong ++ #define PyString_FromStringAndSize PyBytes_FromStringAndSize ++#else ++ #include <cStringIO.h> ++#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/tclpython-4.1-r3.ebuild b/dev-tcltk/tclpython/tclpython-4.1-r4.ebuild index 2007324646af..63ef9a4d1bb2 100644 --- a/dev-tcltk/tclpython/tclpython-4.1-r3.ebuild +++ b/dev-tcltk/tclpython/tclpython-4.1-r4.ebuild @@ -1,12 +1,12 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-tcltk/tclpython/tclpython-4.1-r3.ebuild,v 1.1 2014/10/26 18:45:17 jlec Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-tcltk/tclpython/tclpython-4.1-r4.ebuild,v 1.1 2014/10/27 14:22:43 jlec Exp $ EAPI=5 PYTHON_COMPAT=( python{2_7,3_3,3_4} ) -inherit multilib python-single-r1 toolchain-funcs +inherit eutils multilib python-single-r1 toolchain-funcs DESCRIPTION="Python package for Tcl" HOMEPAGE="http://jfontain.free.fr/tclpython.htm" @@ -23,6 +23,14 @@ DEPEND="${PYTHON_DEPS} dev-lang/tcl" RDEPEND="${DEPEND}" +PATCHES=( + "${FILESDIR}"/${P}-python-3.patch +) + +src_prepare() { + epatch ${PATCHES[@]} +} + src_compile() { local cfile="tclpython tclthread" for src in ${cfile}; do |