* [gentoo-commits] repo/gentoo:master commit in: dev-tcltk/tclpython/files/, dev-tcltk/tclpython/
@ 2020-05-31 18:35 Alfredo Tupone
0 siblings, 0 replies; 2+ messages in thread
From: Alfredo Tupone @ 2020-05-31 18:35 UTC (permalink / raw
To: gentoo-commits
commit: 34b6d46037338456d13f1db41549b678fc32f32a
Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Sun May 31 18:34:46 2020 +0000
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Sun May 31 18:34:46 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34b6d460
dev-tcltk/tclpython: CFLAGS/LDFLAGS/strip
Closes: https://bugs.gentoo.org/724062
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
.../tclpython/files/tclpython-5.0-gentoo.patch | 14 ++++++++++
dev-tcltk/tclpython/tclpython-5.0.ebuild | 32 ++++++++++------------
2 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/dev-tcltk/tclpython/files/tclpython-5.0-gentoo.patch b/dev-tcltk/tclpython/files/tclpython-5.0-gentoo.patch
index 7f4aa0bf5a2..965fe3d8d72 100644
--- a/dev-tcltk/tclpython/files/tclpython-5.0-gentoo.patch
+++ b/dev-tcltk/tclpython/files/tclpython-5.0-gentoo.patch
@@ -1,5 +1,19 @@
--- a/Makefile 2018-10-28 17:21:20.274137396 +0100
+++ b/Makefile 2018-10-28 17:21:47.696694473 +0100
+@@ -16,11 +16,11 @@
+ LIBRARY:= $(PKG_NAME).so.$(PKG_VERSION)
+
+ TCL_VERSION=$(shell echo 'puts $\$$tcl_version' | tclsh)
+-CFLAGS:= -O2 -Wall -fPIC -DUSE_TCL_STUBS
++CFLAGS:= @CFLAGS@ -fPIC -DUSE_TCL_STUBS
+ CFLAGS+= $(shell $(PYTHON_CONFIG) --includes)
+ CFLAGS+= -I/usr/include/tcl$(TCL_VERSION)
+ CFLAGS+= -DTCLPYTHON_VERSION=$(PKG_VERSION)
+-LDFLAGS:= -shared -s
++LDFLAGS:= @LDFLAGS@ -shared
+ LDFLAGS+= $(shell $(PYTHON_CONFIG) --libs)
+ LDFLAGS+= -ltclstub$(TCL_VERSION)
+
@@ -62,7 +62,8 @@
$(OUTPUT_DIR)/pkgIndex.tcl:pkg/pkgIndex.tcl
cp -t $(dir $@) $^
diff --git a/dev-tcltk/tclpython/tclpython-5.0.ebuild b/dev-tcltk/tclpython/tclpython-5.0.ebuild
index 92786421ee1..90df040a57a 100644
--- a/dev-tcltk/tclpython/tclpython-5.0.ebuild
+++ b/dev-tcltk/tclpython/tclpython-5.0.ebuild
@@ -24,31 +24,27 @@ RDEPEND="${DEPEND}"
PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )
+src_prepare() {
+ default
+ sed -i \
+ -e "s:@CFLAGS@:${CFLAGS}:g" \
+ -e "s:@LDFLAGS@:${LDFLAGS}:g" \
+ Makefile || die
+}
+
src_compile() {
- if python_is_python3; then
- PKG_NAME=tclpython3
- else
- PKG_NAME=tclpython
- fi
- emake PKG_NAME=${PKG_NAME} CC=$(tc-getCC)
+ emake PKG_NAME=tclpython3 CC=$(tc-getCC)
}
src_test() {
- emake PKG_NAME=${PKG_NAME} CC=$(tc-getCC) test
+ emake PKG_NAME=tclpython3 CC=$(tc-getCC) test
}
src_install() {
- if python_is_python3; then
- insinto /usr/$(get_libdir)
- doins -r build/tclpython3/tclpython3
- fperms 775 /usr/$(get_libdir)/tclpython3/tclpython3.so.${PV}
- dosym tclpython3.so.${PV} /usr/$(get_libdir)/tclpython3/tclpython3.so
- else
- insinto /usr/$(get_libdir)
- doins -r build/tclpython/tclpython
- fperms 775 /usr/$(get_libdir)/tclpython/tclpython.so.${PV}
- dosym tclpython.so.${PV} /usr/$(get_libdir)/tclpython/tclpython3.so
- fi
+ insinto /usr/$(get_libdir)
+ doins -r build/tclpython3/tclpython3
+ fperms 775 /usr/$(get_libdir)/tclpython3/tclpython3.so.${PV}
+ dosym tclpython3.so.${PV} /usr/$(get_libdir)/tclpython3/tclpython3.so
dodoc README.md VERSION.md
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-tcltk/tclpython/files/, dev-tcltk/tclpython/
@ 2020-09-06 16:39 Alfredo Tupone
0 siblings, 0 replies; 2+ messages in thread
From: Alfredo Tupone @ 2020-09-06 16:39 UTC (permalink / raw
To: gentoo-commits
commit: f9a8111ff4ea565e114080f3db15b582823dd062
Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 6 16:39:19 2020 +0000
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Sun Sep 6 16:39:19 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9a8111f
dev-tcltk/tclpython: remove old version
Package-Manager: Portage-3.0.4, Repoman-2.3.23
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
dev-tcltk/tclpython/Manifest | 1 -
.../tclpython/files/tclpython-4.1-python-3.patch | 229 ---------------------
dev-tcltk/tclpython/tclpython-4.1-r6.ebuild | 55 -----
3 files changed, 285 deletions(-)
diff --git a/dev-tcltk/tclpython/Manifest b/dev-tcltk/tclpython/Manifest
index 9bd7a795d51..68cb6e9da97 100644
--- a/dev-tcltk/tclpython/Manifest
+++ b/dev-tcltk/tclpython/Manifest
@@ -1,2 +1 @@
-DIST tclpython-4.1.tar.bz2 10580 BLAKE2B 98d4783cc52bc907c21d50ee393e25ee084b449db7c393c16b0b1f0420469bd0904d16dc2a6806b776dad7dabd521e5f2e8cc942c720d9e69750385302355608 SHA512 5f08e7129a7d9afeb1ac6bf1ab1c83ad3bb481593c9516c0653c7b4ba0dfb1b3129a336e64b998cec8ef2d2377a6a366b73c640d25839ab280d5079c0b220d54
DIST tclpython-5.0.tar.gz 19327 BLAKE2B bad25a6eb04dbcd9ca3e9bc81d44f098f31f2acf367ecc32307596d5da3ed95752b3c60d9ee74fc04e21669e0361f0790edad3ad5793c78ece4904beacd92900 SHA512 fe15218fe00e921384dbd9611685b86cb6dfacb515a95545079550aeadaaafc3964e6ef0594a268a3fd900f40d178659e8b7f6f2a6d9aa507b59a8be0bd116af
diff --git a/dev-tcltk/tclpython/files/tclpython-4.1-python-3.patch b/dev-tcltk/tclpython/files/tclpython-4.1-python-3.patch
deleted file mode 100644
index 2a26f647c10..00000000000
--- a/dev-tcltk/tclpython/files/tclpython-4.1-python-3.patch
+++ /dev/null
@@ -1,229 +0,0 @@
---- 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-r6.ebuild b/dev-tcltk/tclpython/tclpython-4.1-r6.ebuild
deleted file mode 100644
index e6896c3a015..00000000000
--- a/dev-tcltk/tclpython/tclpython-4.1-r6.ebuild
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-PYTHON_COMPAT=( python3_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
-}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-06 16:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-31 18:35 [gentoo-commits] repo/gentoo:master commit in: dev-tcltk/tclpython/files/, dev-tcltk/tclpython/ Alfredo Tupone
-- strict thread matches above, loose matches on Subject: below --
2020-09-06 16:39 Alfredo Tupone
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox