Gentoo Archives: gentoo-commits

From: Stefan Strogin <steils@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/libressl:master commit in: net-libs/serf/files/, net-libs/serf/
Date: Sat, 20 Jul 2019 00:20:02
Message-Id: 1558369710.82ec52025ddd5471fbe3c8c0e0fa2a5524f43164.steils@gentoo
1 commit: 82ec52025ddd5471fbe3c8c0e0fa2a5524f43164
2 Author: callmetango <callmetango <AT> users <DOT> noreply <DOT> github <DOT> com>
3 AuthorDate: Sat May 18 09:00:35 2019 +0000
4 Commit: Stefan Strogin <steils <AT> gentoo <DOT> org>
5 CommitDate: Mon May 20 16:28:30 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=82ec5202
7
8 net-libs/serf: fix OPENSSL_malloc_init not found
9
10 * added libressl patch of Alpine Linux to fix 'OPENSSL_malloc_init not found' in subversion
11
12 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
13
14 net-libs/serf/Manifest | 1 +
15 net-libs/serf/files/serf-1.3.8-openssl.patch | 28 ++++++++++
16 net-libs/serf/files/serf-1.3.8-static-lib.patch | 49 +++++++++++++++++
17 net-libs/serf/files/serf-1.3.9-libressl.patch | 11 ++++
18 net-libs/serf/metadata.xml | 11 ++++
19 net-libs/serf/serf-1.3.9.ebuild | 72 +++++++++++++++++++++++++
20 6 files changed, 172 insertions(+)
21
22 diff --git a/net-libs/serf/Manifest b/net-libs/serf/Manifest
23 new file mode 100644
24 index 0000000..28e866e
25 --- /dev/null
26 +++ b/net-libs/serf/Manifest
27 @@ -0,0 +1 @@
28 +DIST serf-1.3.9.tar.bz2 145132 BLAKE2B 59776f85b409b2eaea81f3e07b0301515e20cbd2aa0ef05c1c38aa8152a6d5627e526e4bc160abb1fd438e9fa46f97096c639860729d2ea8e0b2fcfcf8222002 SHA512 9f5418d991840a08d293d1ecba70cd9534a207696d002f22dbe62354e7b005955112a0d144a76c89c7f7ad3b4c882e54974441fafa0c09c4aa25c49c021ca75d
29
30 diff --git a/net-libs/serf/files/serf-1.3.8-openssl.patch b/net-libs/serf/files/serf-1.3.8-openssl.patch
31 new file mode 100644
32 index 0000000..4cc3719
33 --- /dev/null
34 +++ b/net-libs/serf/files/serf-1.3.8-openssl.patch
35 @@ -0,0 +1,28 @@
36 +the build doesn't actually use the openssl var for anything useful.
37 +it blindly adds it to the -I/-L paths which causes problems when you
38 +cross-compile and when you link (it also adds it to -rpath). punt
39 +the setting and forget about it.
40 +
41 +--- a/SConstruct
42 ++++ b/SConstruct
43 +@@ -354,8 +354,6 @@ else:
44 + apr_libs = ''
45 + apu_libs = ''
46 +
47 +- env.Append(CPPPATH=['$OPENSSL/include'])
48 +- env.Append(LIBPATH=['$OPENSSL/lib'])
49 +
50 +
51 + # If build with gssapi, get its information and define SERF_HAVE_GSSAPI
52 +@@ -369,8 +369,9 @@ if sys.platform == 'win32':
53 + # On some systems, the -R values that APR describes never make it into actual
54 + # RPATH flags. We'll manually map all directories in LIBPATH into new
55 + # flags to set RPATH values.
56 +-for d in env['LIBPATH']:
57 +- env.Append(RPATH=':'+d)
58 ++if env.get('LIBPATH', None):
59 ++ for d in env['LIBPATH']:
60 ++ env.Append(RPATH=':'+d)
61 +
62 + # Set up the construction of serf-*.pc
63 + pkgconfig = env.Textfile('serf-%d.pc' % (MAJOR,),
64
65 diff --git a/net-libs/serf/files/serf-1.3.8-static-lib.patch b/net-libs/serf/files/serf-1.3.8-static-lib.patch
66 new file mode 100644
67 index 0000000..1538328
68 --- /dev/null
69 +++ b/net-libs/serf/files/serf-1.3.8-static-lib.patch
70 @@ -0,0 +1,49 @@
71 +respect the active archiver tool instead of using `ar` all the time.
72 +same for `ranlib`.
73 +
74 +also add support for BUILD_STATIC bool for controlling the libserf.a.
75 +
76 +--- a/SConstruct
77 ++++ b/SConstruct
78 +@@ -103,6 +103,9 @@
79 + BoolVariable('APR_STATIC',
80 + "Enable using a static compiled APR",
81 + False),
82 ++ RawListVariable('AR', "Command name or path of the archiver", None),
83 ++ RawListVariable('RANLIB', "Command name or path of the archiver indexer", None),
84 ++ BoolVariable('BUILD_STATIC', 'Build libserf static library', True),
85 + RawListVariable('CC', "Command name or path of the C compiler", None),
86 + RawListVariable('CFLAGS', "Extra flags for the C compiler (space-separated)",
87 + None),
88 +@@ -193,6 +196,7 @@ if gssapi and os.path.isdir(gssapi):
89 +
90 + debug = env.get('DEBUG', None)
91 + aprstatic = env.get('APR_STATIC', None)
92 ++build_static = env.get('BUILD_STATIC', True)
93 +
94 + Help(opts.GenerateHelpText(env))
95 + opts.Save(SAVED_CONFIG, env)
96 +@@ -384,7 +388,9 @@ pkgconfig = env.Textfile('serf-%d.pc' % (MAJOR,),
97 + env.get('GSSAPI_LIBS', '')),
98 + })
99 +
100 +-env.Default(lib_static, lib_shared, pkgconfig)
101 ++env.Default(lib_shared, pkgconfig)
102 ++if build_static:
103 ++ env.Default(lib_static)
104 +
105 + if CALLOUT_OKAY:
106 + conf = Configure(env)
107 +@@ -420,8 +420,10 @@ if sys.platform == 'darwin':
108 + % (target_install_shared_path,
109 + install_shared_path)))
110 +
111 +-env.Alias('install-lib', [install_static, install_shared,
112 +- ])
113 ++install_libs = [install_shared]
114 ++if build_static:
115 ++ install_libs.append(install_static)
116 ++env.Alias('install-lib', install_libs)
117 + env.Alias('install-inc', env.Install(incdir, HEADER_FILES))
118 + env.Alias('install-pc', env.Install(os.path.join(libdir, 'pkgconfig'),
119 + pkgconfig))
120
121 diff --git a/net-libs/serf/files/serf-1.3.9-libressl.patch b/net-libs/serf/files/serf-1.3.9-libressl.patch
122 new file mode 100644
123 index 0000000..7a89cea
124 --- /dev/null
125 +++ b/net-libs/serf/files/serf-1.3.9-libressl.patch
126 @@ -0,0 +1,11 @@
127 +--- ./buckets/ssl_buckets.c.orig
128 ++++ ./buckets/ssl_buckets.c
129 +@@ -52,7 +52,7 @@
130 + #define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary)))
131 + #endif
132 +
133 +-#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
134 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
135 + #define USE_OPENSSL_1_1_API
136 + #endif
137 +
138
139 diff --git a/net-libs/serf/metadata.xml b/net-libs/serf/metadata.xml
140 new file mode 100644
141 index 0000000..9e50e18
142 --- /dev/null
143 +++ b/net-libs/serf/metadata.xml
144 @@ -0,0 +1,11 @@
145 +<?xml version="1.0" encoding="UTF-8"?>
146 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
147 +<pkgmetadata>
148 + <maintainer type="person">
149 + <email>arfrever.fta@×××××.com</email>
150 + </maintainer>
151 + <maintainer type="project">
152 + <email>proxy-maint@g.o</email>
153 + <name>Proxy Maintainers</name>
154 + </maintainer>
155 +</pkgmetadata>
156
157 diff --git a/net-libs/serf/serf-1.3.9.ebuild b/net-libs/serf/serf-1.3.9.ebuild
158 new file mode 100644
159 index 0000000..6e00bb2
160 --- /dev/null
161 +++ b/net-libs/serf/serf-1.3.9.ebuild
162 @@ -0,0 +1,72 @@
163 +# Copyright 2008-2018 Arfrever Frehtes Taifersar Arahesis and others
164 +# Distributed under the terms of the GNU General Public License v2
165 +
166 +EAPI="5"
167 +
168 +inherit eutils scons-utils toolchain-funcs flag-o-matic
169 +
170 +DESCRIPTION="HTTP client library"
171 +HOMEPAGE="https://serf.apache.org/"
172 +SRC_URI="mirror://apache/${PN}/${P}.tar.bz2"
173 +
174 +LICENSE="Apache-2.0"
175 +SLOT="1"
176 +KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
177 +IUSE="kerberos static-libs libressl"
178 +RESTRICT="test"
179 +
180 +RDEPEND="dev-libs/apr:1=
181 + dev-libs/apr-util:1=
182 + !libressl? ( dev-libs/openssl:0= ) libressl? ( dev-libs/libressl:0= )
183 + sys-libs/zlib:0=
184 + kerberos? ( virtual/krb5 )"
185 +DEPEND="${RDEPEND}
186 + >=dev-util/scons-2.3.0"
187 +
188 +src_prepare() {
189 + epatch "${FILESDIR}/${PN}-1.3.8-static-lib.patch"
190 + epatch "${FILESDIR}/${PN}-1.3.8-openssl.patch"
191 +
192 + if use libressl; then
193 + epatch "${FILESDIR}/${PN}-1.3.9-libressl.patch"
194 + fi
195 +
196 + # https://code.google.com/p/serf/issues/detail?id=133
197 + sed -e "/env.Append(CCFLAGS=\['-O2'\])/d" -i SConstruct
198 +
199 + # need limits.h for PATH_MAX (only when EXTENSIONS is enabled)
200 + [[ ${CHOST} == *-solaris* ]] && append-cppflags -D__EXTENSIONS__
201 +}
202 +
203 +src_compile() {
204 + myesconsargs=(
205 + PREFIX="${EPREFIX}/usr"
206 + LIBDIR="${EPREFIX}/usr/$(get_libdir)"
207 + # These config scripts are sent through a shell with an empty env
208 + # which breaks the SYSROOT usage in them. Set the vars inline to
209 + # avoid that.
210 + APR="SYSROOT='${SYSROOT}' ${SYSROOT}${EPREFIX}/usr/bin/apr-1-config"
211 + APU="SYSROOT='${SYSROOT}' ${SYSROOT}${EPREFIX}/usr/bin/apu-1-config"
212 + BUILD_STATIC=$(usex static-libs)
213 + AR="$(tc-getAR)"
214 + RANLIB="$(tc-getRANLIB)"
215 + CC="$(tc-getCC)"
216 + CPPFLAGS="${CPPFLAGS}"
217 + CFLAGS="${CFLAGS}"
218 + LINKFLAGS="${LDFLAGS}"
219 + )
220 +
221 + if use kerberos; then
222 + myesconsargs+=( GSSAPI="${SYSROOT}${EPREFIX}/usr/bin/krb5-config" )
223 + fi
224 +
225 + escons
226 +}
227 +
228 +src_test() {
229 + escons check
230 +}
231 +
232 +src_install() {
233 + escons install --install-sandbox="${D}"
234 +}