Gentoo Archives: gentoo-commits

From: Benda XU <heroxbd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/serf/files/, net-libs/serf/
Date: Mon, 23 Dec 2019 03:01:34
Message-Id: 1577069992.c8f1ba80a5e0a61ea85a61c8ee69432dbaee20ba.heroxbd@gentoo
1 commit: c8f1ba80a5e0a61ea85a61c8ee69432dbaee20ba
2 Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 2 14:54:23 2019 +0000
4 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 23 02:59:52 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c8f1ba80
7
8 net-libs/serf: inherit python-any-r1 for scons, bump EAPI
9
10 The scons package depends on python, and in this case python-any-r1
11 is needed.
12
13 Reference: https://wiki.gentoo.org/wiki/Project:Python/scons-utils_integration
14 Closes: https://bugs.gentoo.org/701760
15 Package-Manager: Portage-2.3.79, Repoman-2.3.18
16 Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
17
18 net-libs/serf/files/serf-1.3.9-python3.patch | 28 +++++++++
19 net-libs/serf/files/serf-1.3.9-python3_byte.patch | 28 +++++++++
20 net-libs/serf/serf-1.3.9-r1.ebuild | 74 +++++++++++++++++++++++
21 3 files changed, 130 insertions(+)
22
23 diff --git a/net-libs/serf/files/serf-1.3.9-python3.patch b/net-libs/serf/files/serf-1.3.9-python3.patch
24 new file mode 100644
25 index 00000000000..7ba43d91968
26 --- /dev/null
27 +++ b/net-libs/serf/files/serf-1.3.9-python3.patch
28 @@ -0,0 +1,28 @@
29 +From 1c0241847e845a8da265aa89f297d3db6ae483b1 Mon Sep 17 00:00:00 2001
30 +From: Bert Huijben <rhuijben@××××××.org>
31 +Date: Wed, 4 Oct 2017 14:56:22 +0000
32 +Subject: [PATCH] Fix syntax of a print() in the scons file to unbreak building
33 + with most recent scons version.
34 +
35 +* SConstruct
36 + Use Python 3.0 valid syntax to make Scons 3.0.0 happy on both python 3.0
37 + and 2.7.
38 +
39 +git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1811083 13f79535-47bb-0310-9956-ffa450edef68
40 +---
41 + SConstruct | 2 +-
42 + 1 file changed, 1 insertion(+), 1 deletion(-)
43 +
44 +diff --git a/SConstruct b/SConstruct
45 +index e5d407b..fab9828 100644
46 +--- a/SConstruct
47 ++++ b/SConstruct
48 +@@ -199,7 +199,7 @@ CALLOUT_OKAY = not (env.GetOption('clean') or env.GetOption('help'))
49 +
50 + unknown = opts.UnknownVariables()
51 + if unknown:
52 +- print 'Warning: Used unknown variables:', ', '.join(unknown.keys())
53 ++ print('Warning: Used unknown variables:', ', '.join(unknown.keys()))
54 +
55 + apr = str(env['APR'])
56 + apu = str(env['APU'])
57
58 diff --git a/net-libs/serf/files/serf-1.3.9-python3_byte.patch b/net-libs/serf/files/serf-1.3.9-python3_byte.patch
59 new file mode 100644
60 index 00000000000..ab86af2082d
61 --- /dev/null
62 +++ b/net-libs/serf/files/serf-1.3.9-python3_byte.patch
63 @@ -0,0 +1,28 @@
64 +From 9d30108b630b77f732ef94d1642b159066ffd890 Mon Sep 17 00:00:00 2001
65 +From: Andreas Stieger <astieger@××××××.org>
66 +Date: Wed, 8 Nov 2017 17:05:28 +0000
67 +Subject: [PATCH] Follow-up to r1811083, fix building with scons 3.0.0 and
68 + Python3
69 +
70 +* SConstruct: Append decode('utf-8) to FILE.get_contents() to avoid
71 + TypeError: cannot use a string pattern on a bytes-like object
72 +
73 +
74 +git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1814604 13f79535-47bb-0310-9956-ffa450edef68
75 +---
76 + SConstruct | 2 +-
77 + 1 file changed, 1 insertion(+), 1 deletion(-)
78 +
79 +diff --git a/SConstruct b/SConstruct
80 +index 5f5036b..71e5b0a 100644
81 +--- a/SConstruct
82 ++++ b/SConstruct
83 +@@ -182,7 +182,7 @@ env.Append(BUILDERS = {
84 + match = re.search('SERF_MAJOR_VERSION ([0-9]+).*'
85 + 'SERF_MINOR_VERSION ([0-9]+).*'
86 + 'SERF_PATCH_VERSION ([0-9]+)',
87 +- env.File('serf.h').get_contents(),
88 ++ env.File('serf.h').get_contents().decode('utf-8'),
89 + re.DOTALL)
90 + MAJOR, MINOR, PATCH = [int(x) for x in match.groups()]
91 + env.Append(MAJOR=str(MAJOR))
92
93 diff --git a/net-libs/serf/serf-1.3.9-r1.ebuild b/net-libs/serf/serf-1.3.9-r1.ebuild
94 new file mode 100644
95 index 00000000000..f4165ca2e0d
96 --- /dev/null
97 +++ b/net-libs/serf/serf-1.3.9-r1.ebuild
98 @@ -0,0 +1,74 @@
99 +# Copyright 1999-2019 Gentoo Authors
100 +# Distributed under the terms of the GNU General Public License v2
101 +
102 +EAPI="7"
103 +
104 +PYTHON_COMPAT=( python3_6 )
105 +
106 +inherit python-any-r1 scons-utils toolchain-funcs flag-o-matic
107 +
108 +DESCRIPTION="HTTP client library"
109 +HOMEPAGE="https://serf.apache.org/"
110 +SRC_URI="mirror://apache/${PN}/${P}.tar.bz2"
111 +
112 +LICENSE="Apache-2.0"
113 +SLOT="1"
114 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
115 +IUSE="kerberos static-libs libressl"
116 +RESTRICT="test"
117 +
118 +RDEPEND="dev-libs/apr:1=
119 + dev-libs/apr-util:1=
120 + !libressl? ( dev-libs/openssl:0= ) libressl? ( dev-libs/libressl:0= )
121 + sys-libs/zlib:0=
122 + kerberos? ( virtual/krb5 )"
123 +DEPEND="${RDEPEND}
124 + >=dev-util/scons-2.3.0"
125 +
126 +PATCHES=( "${FILESDIR}"/${PN}-1.3.8-static-lib.patch
127 + "${FILESDIR}"/${PN}-1.3.8-openssl.patch
128 + "${FILESDIR}"/${PN}-1.3.9-python3.patch
129 + "${FILESDIR}"/${PN}-1.3.9-python3_byte.patch )
130 +
131 +src_prepare() {
132 + default
133 +
134 + # https://code.google.com/p/serf/issues/detail?id=133
135 + sed -e "/env.Append(CCFLAGS=\['-O2'\])/d" -i SConstruct
136 +
137 + # need limits.h for PATH_MAX (only when EXTENSIONS is enabled)
138 + [[ ${CHOST} == *-solaris* ]] && append-cppflags -D__EXTENSIONS__
139 +}
140 +
141 +src_compile() {
142 + myesconsargs=(
143 + PREFIX="${EPREFIX}/usr"
144 + LIBDIR="${EPREFIX}/usr/$(get_libdir)"
145 + # These config scripts are sent through a shell with an empty env
146 + # which breaks the SYSROOT usage in them. Set the vars inline to
147 + # avoid that.
148 + APR="SYSROOT='${SYSROOT}' ${SYSROOT}${EPREFIX}/usr/bin/apr-1-config"
149 + APU="SYSROOT='${SYSROOT}' ${SYSROOT}${EPREFIX}/usr/bin/apu-1-config"
150 + BUILD_STATIC=$(usex static-libs)
151 + AR="$(tc-getAR)"
152 + RANLIB="$(tc-getRANLIB)"
153 + CC="$(tc-getCC)"
154 + CPPFLAGS="${CPPFLAGS}"
155 + CFLAGS="${CFLAGS}"
156 + LINKFLAGS="${LDFLAGS}"
157 + )
158 +
159 + if use kerberos; then
160 + myesconsargs+=( GSSAPI="${SYSROOT}${EPREFIX}/usr/bin/krb5-config" )
161 + fi
162 +
163 + escons "${myesconsargs[@]}"
164 +}
165 +
166 +src_test() {
167 + escons check
168 +}
169 +
170 +src_install() {
171 + escons install --install-sandbox="${D}"
172 +}