Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pycurl/files/, dev-python/pycurl/
Date: Mon, 11 May 2020 09:04:11
Message-Id: 1589187836.13ef44bf3be7c4117825edde0add989c3aae86eb.mgorny@gentoo
1 commit: 13ef44bf3be7c4117825edde0add989c3aae86eb
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 11 08:46:51 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon May 11 09:03:56 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13ef44bf
7
8 dev-python/pycurl: Respect CC/*FLAGS in fake-curl
9
10 Bug: https://bugs.gentoo.org/721270
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 .../pycurl/files/pycurl-7.43.0.5-cc-cflags.patch | 34 ++++++++++++++++++++++
14 dev-python/pycurl/pycurl-7.43.0.5.ebuild | 5 ++--
15 2 files changed, 37 insertions(+), 2 deletions(-)
16
17 diff --git a/dev-python/pycurl/files/pycurl-7.43.0.5-cc-cflags.patch b/dev-python/pycurl/files/pycurl-7.43.0.5-cc-cflags.patch
18 new file mode 100644
19 index 00000000000..b1e66e0942d
20 --- /dev/null
21 +++ b/dev-python/pycurl/files/pycurl-7.43.0.5-cc-cflags.patch
22 @@ -0,0 +1,34 @@
23 +From 861ba3143001caf2623ce5d84a1d04a69b502339 Mon Sep 17 00:00:00 2001
24 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
25 +Date: Mon, 11 May 2020 08:52:04 +0200
26 +Subject: [PATCH 1/2] Support overriding CC, respect *FLAGS in fake-curl
27 +
28 +The shipped libraries (obviously) do not work on non-amd64 platforms,
29 +and rebuilding without the correct compiler and flags does not work
30 +on more complex setups such as ppc64 with 32-bit userland. Make
31 +the Makefile permit CC override while preserving the current default,
32 +and use user-provided CFLAGS, CPPFLAGS and LDFLAGS.
33 +---
34 + tests/fake-curl/libcurl/Makefile | 5 ++++-
35 + 1 file changed, 4 insertions(+), 1 deletion(-)
36 +
37 +diff --git a/tests/fake-curl/libcurl/Makefile b/tests/fake-curl/libcurl/Makefile
38 +index b05bc89..8ece206 100644
39 +--- a/tests/fake-curl/libcurl/Makefile
40 ++++ b/tests/fake-curl/libcurl/Makefile
41 +@@ -7,8 +7,11 @@ all: \
42 +
43 + .SUFFIXES: .c .so
44 +
45 ++CC = `curl-config --cc`
46 ++CFLAGS += `curl-config --cflags`
47 ++
48 + .c.so:
49 +- `curl-config --cc` `curl-config --cflags` -shared -fPIC \
50 ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fPIC \
51 + -Wl,-soname,$@ -o $@ $<
52 +
53 + show-targets:
54 +--
55 +2.26.2
56 +
57
58 diff --git a/dev-python/pycurl/pycurl-7.43.0.5.ebuild b/dev-python/pycurl/pycurl-7.43.0.5.ebuild
59 index 476a879faea..b80f699735d 100644
60 --- a/dev-python/pycurl/pycurl-7.43.0.5.ebuild
61 +++ b/dev-python/pycurl/pycurl-7.43.0.5.ebuild
62 @@ -6,7 +6,7 @@ EAPI=7
63 # The selftests fail with pypy, and urlgrabber segfaults for me.
64 PYTHON_COMPAT=( python2_7 python3_{6,7,8} )
65
66 -inherit distutils-r1
67 +inherit distutils-r1 toolchain-funcs
68
69 DESCRIPTION="python binding for curl/libcurl"
70 HOMEPAGE="
71 @@ -51,6 +51,7 @@ DISTUTILS_IN_SOURCE_BUILD=1
72
73 PATCHES=(
74 "${FILESDIR}"/pycurl-7.43.0.5-telnet-test.patch
75 + "${FILESDIR}"/pycurl-7.43.0.5-cc-cflags.patch
76 )
77
78 python_prepare_all() {
79 @@ -66,7 +67,7 @@ python_configure_all() {
80 src_test() {
81 # upstream bundles precompiled amd64 libs
82 rm tests/fake-curl/libcurl/*.so || die
83 - emake -C tests/fake-curl/libcurl
84 + emake -C tests/fake-curl/libcurl CC="$(tc-getCC)"
85
86 distutils-r1_src_test
87 }