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
 }

Reply via email to