Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libzip/, dev-libs/libzip/files/
Date: Sat, 09 Feb 2019 20:58:25
Message-Id: 1549745867.34e6aee94f736c0493e3bffa6abcd261e08a207c.asturm@gentoo
1 commit: 34e6aee94f736c0493e3bffa6abcd261e08a207c
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 9 20:55:40 2019 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 9 20:57:47 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34e6aee9
7
8 dev-libs/libzip: 1.5.1 version bump for testing
9
10 Thanks-to: Hung-Te Lin <hungte <AT> gmail.com>
11 Closes: https://github.com/gentoo/gentoo/pull/10846
12 Closes: https://bugs.gentoo.org/675560
13 Package-Manager: Portage-2.3.59, Repoman-2.3.12
14 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
15
16 dev-libs/libzip/Manifest | 1 +
17 dev-libs/libzip/files/libzip-1.5.1-bzip2.patch | 53 ++++++++++++++
18 dev-libs/libzip/files/libzip-1.5.1-options.patch | 50 +++++++++++++
19 dev-libs/libzip/libzip-1.5.1.ebuild | 89 ++++++++++++++++++++++++
20 4 files changed, 193 insertions(+)
21
22 diff --git a/dev-libs/libzip/Manifest b/dev-libs/libzip/Manifest
23 index c0eb5a5ea60..396290996fd 100644
24 --- a/dev-libs/libzip/Manifest
25 +++ b/dev-libs/libzip/Manifest
26 @@ -1 +1,2 @@
27 DIST libzip-1.3.0.tar.xz 955876 BLAKE2B 9bb59cb34ed7e85e3161770f0eef7ed1f59fb2f7f648cd201fa5dc6c62339481ad72a71024df443c04ef0c7efe6f00838a3ac316da2ef06c0045ab69ade8f71b SHA512 8e12a23fe62b993ff4592e1b9da152533a363b0603fc1f65e6cbb6121d4260c45f98171effbccb76dec4030b0fcdcd273919755a2496ab462431646ac83bb900
28 +DIST libzip-1.5.1.tar.xz 717908 BLAKE2B f2c19d3a8d9d60f3a0a9bc06359104187e75bcb59ab2aa06df611b487f0c91c27cf52f24bcc24e3d4358c5fe11882661b245829e6cdee2b39559f728cd20f899 SHA512 92df9490a9910ebb1da49ecaec96f364fce39a779e1bc739f7796b27b3a864301f5e1ba0108947708dda1d90af7a9e751be54cbb8a0de2a04a48f9f3eb728e3d
29
30 diff --git a/dev-libs/libzip/files/libzip-1.5.1-bzip2.patch b/dev-libs/libzip/files/libzip-1.5.1-bzip2.patch
31 new file mode 100644
32 index 00000000000..9b70eaca8e8
33 --- /dev/null
34 +++ b/dev-libs/libzip/files/libzip-1.5.1-bzip2.patch
35 @@ -0,0 +1,53 @@
36 +From 028c492c9d45ca29e2fbec79a203ba492016f15e Mon Sep 17 00:00:00 2001
37 +From: Miklos Vajna <vmiklos@××××××××××××.uk>
38 +Date: Fri, 7 Sep 2018 23:12:36 +0200
39 +Subject: [PATCH] Add an option to disable bzip2 support
40 +
41 +The explicit switch is still on by default, but this way it's possible
42 +to explicitly disable bzip2 support even if bzip2 is available on the
43 +system.
44 +
45 +This is useful if bzip2 is not needed, but would automatically lead to
46 +an unwanted dependency.
47 +---
48 + CMakeLists.txt | 19 +++++++++++--------
49 + 1 file changed, 11 insertions(+), 8 deletions(-)
50 +
51 +diff --git a/CMakeLists.txt b/CMakeLists.txt
52 +index 73a34855..879e0f21 100644
53 +--- a/CMakeLists.txt
54 ++++ b/CMakeLists.txt
55 +@@ -10,6 +10,7 @@ PROJECT(libzip C)
56 + OPTION(ENABLE_GNUTLS "Enable use of GnuTLS" ON)
57 + OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON)
58 + OPTION(ENABLE_COMMONCRYPTO "Enable use of CommonCrypto" ON)
59 ++OPTION(ENABLE_BZIP2 "Enable use of BZip2" ON)
60 +
61 + OPTION(BUILD_TOOLS "Build tools in the src directory (zipcmp, zipmerge, ziptool)" ON)
62 + OPTION(BUILD_REGRESS "Build regression tests" ON)
63 +@@ -186,15 +187,17 @@ IF(ZLIB_VERSION_STRING VERSION_LESS "1.1.2")
64 + MESSAGE(FATAL_ERROR "-- ZLIB version too old, please install at least v1.1.2")
65 + ENDIF(ZLIB_VERSION_STRING VERSION_LESS "1.1.2")
66 +
67 +-FIND_PACKAGE(BZip2)
68 +-IF(BZIP2_FOUND)
69 +- SET (HAVE_LIBBZ2 1)
70 ++IF(ENABLE_BZIP2)
71 ++ FIND_PACKAGE(BZip2)
72 ++ IF(BZIP2_FOUND)
73 ++ SET (HAVE_LIBBZ2 1)
74 +
75 +- INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR})
76 +- SET (OPTIONAL_LIBRARY ${BZIP2_LIBRARY})
77 +-ELSE()
78 +- MESSAGE(WARNING "-- bzip2 library not found; bzip2 support disabled")
79 +-ENDIF(BZIP2_FOUND)
80 ++ INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR})
81 ++ SET (OPTIONAL_LIBRARY ${BZIP2_LIBRARY})
82 ++ ELSE()
83 ++ MESSAGE(WARNING "-- bzip2 library not found; bzip2 support disabled")
84 ++ ENDIF(BZIP2_FOUND)
85 ++ENDIF(ENABLE_BZIP2)
86 +
87 + IF (COMMONCRYPTO_FOUND)
88 + SET (HAVE_CRYPTO 1)
89
90 diff --git a/dev-libs/libzip/files/libzip-1.5.1-options.patch b/dev-libs/libzip/files/libzip-1.5.1-options.patch
91 new file mode 100644
92 index 00000000000..0cca187d90a
93 --- /dev/null
94 +++ b/dev-libs/libzip/files/libzip-1.5.1-options.patch
95 @@ -0,0 +1,50 @@
96 +From b6e53cce5370fba88299f9ed2944ab8a7a4cef5c Mon Sep 17 00:00:00 2001
97 +From: Florian Delizy <florian.delizy@×××××.com>
98 +Date: Tue, 7 Aug 2018 22:09:32 +0800
99 +Subject: [PATCH] adding BUILD_TOOLS BUILD_REGRESS BUILD_EXAMPLES BUILD_DOC
100 + options (default ON)
101 +
102 +---
103 + CMakeLists.txt | 18 ++++++++++++++++++
104 + 1 file changed, 18 insertions(+)
105 +
106 +diff --git a/CMakeLists.txt b/CMakeLists.txt
107 +index 69e6548e..def25607 100644
108 +--- a/CMakeLists.txt
109 ++++ b/CMakeLists.txt
110 +@@ -11,6 +11,11 @@ OPTION(ENABLE_GNUTLS "Enable use of GnuTLS" ON)
111 + OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON)
112 + OPTION(ENABLE_COMMONCRYPTO "Enable use of CommonCrypto" ON)
113 +
114 ++OPTION(BUILD_TOOLS "Build tools in the src directory (zipcmp, zipmerge, ziptool)" ON)
115 ++OPTION(BUILD_REGRESS "Build regression tests" ON)
116 ++OPTION(BUILD_EXAMPLES "Build examples" ON)
117 ++OPTION(BUILD_DOC "Build documentation" ON)
118 ++
119 + INCLUDE(CheckFunctionExists)
120 + INCLUDE(CheckIncludeFiles)
121 + INCLUDE(CheckSymbolExists)
122 +@@ -234,10 +239,23 @@ ENABLE_TESTING()
123 +
124 + # Targets
125 + ADD_SUBDIRECTORY(lib)
126 ++
127 ++IF(BUILD_DOC)
128 + ADD_SUBDIRECTORY(man)
129 ++ENDIF()
130 ++
131 ++IF(BUILD_TOOLS)
132 + ADD_SUBDIRECTORY(src)
133 ++ENDIF()
134 ++
135 ++IF(BUILD_REGRESS)
136 + ADD_SUBDIRECTORY(regress)
137 ++ENDIF()
138 ++
139 ++IF(BUILD_EXAMPLES)
140 + ADD_SUBDIRECTORY(examples)
141 ++ENDIF()
142 ++
143 +
144 + # pkgconfig file
145 + SET(prefix ${CMAKE_INSTALL_PREFIX})
146
147 diff --git a/dev-libs/libzip/libzip-1.5.1.ebuild b/dev-libs/libzip/libzip-1.5.1.ebuild
148 new file mode 100644
149 index 00000000000..b0125575cca
150 --- /dev/null
151 +++ b/dev-libs/libzip/libzip-1.5.1.ebuild
152 @@ -0,0 +1,89 @@
153 +# Copyright 1999-2019 Gentoo Authors
154 +# Distributed under the terms of the GNU General Public License v2
155 +
156 +EAPI=7
157 +
158 +inherit cmake-utils multibuild
159 +
160 +DESCRIPTION="Library for manipulating zip archives"
161 +HOMEPAGE="https://nih.at/libzip/"
162 +SRC_URI="https://www.nih.at/libzip/${P}.tar.xz"
163 +
164 +LICENSE="BSD"
165 +SLOT="0/5"
166 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
167 +IUSE="bzip2 doc gnutls libressl ssl static-libs test"
168 +
169 +DEPEND="
170 + sys-libs/zlib
171 + bzip2? ( app-arch/bzip2 )
172 + ssl? (
173 + gnutls? ( net-libs/gnutls )
174 + !gnutls? (
175 + !libressl? ( dev-libs/openssl:0= )
176 + libressl? ( dev-libs/libressl:0= )
177 + )
178 + )
179 +"
180 +RDEPEND="${DEPEND}"
181 +
182 +PATCHES=(
183 + "${FILESDIR}/${P}-options.patch"
184 + "${FILESDIR}/${P}-bzip2.patch"
185 +)
186 +
187 +pkg_setup() {
188 + # Upstream doesn't support building dynamic & static
189 + # simultaneously: https://github.com/nih-at/libzip/issues/76
190 + MULTIBUILD_VARIANTS=( shared $(usev static-libs) )
191 +}
192 +
193 +src_configure() {
194 + myconfigure() {
195 + local mycmakeargs=(
196 + -DBUILD_EXAMPLES=OFF # nothing is installed
197 + -DENABLE_COMMONCRYPTO=OFF # not in tree
198 + -DENABLE_BZIP2=$(usex bzip2)
199 + )
200 + if [[ ${MULTIBUILD_VARIANT} = static-libs ]]; then
201 + mycmakeargs+=(
202 + -DBUILD_DOC=OFF
203 + -DBUILD_EXAMPLES=OFF
204 + -DBUILD_SHARED_LIBS=OFF
205 + -DBUILD_TOOLS=OFF
206 + )
207 + else
208 + mycmakeargs+=(
209 + -DBUILD_DOC=$(usex doc)
210 + -DBUILD_REGRESS=$(usex test)
211 + )
212 + fi
213 +
214 + if use ssl; then
215 + mycmakeargs+=(
216 + -DENABLE_GNUTLS=$(usex gnutls)
217 + -DENABLE_OPENSSL=$(usex !gnutls)
218 + )
219 + else
220 + mycmakeargs+=(
221 + -DENABLE_GNUTLS=OFF
222 + -DENABLE_OPENSSL=OFF
223 + )
224 + fi
225 + cmake-utils_src_configure
226 + }
227 +
228 + multibuild_foreach_variant myconfigure
229 +}
230 +
231 +src_compile() {
232 + multibuild_foreach_variant cmake-utils_src_compile
233 +}
234 +
235 +src_test() {
236 + [[ ${MULTIBUILD_VARIANT} = shared ]] && cmake-utils_src_test
237 +}
238 +
239 +src_install() {
240 + multibuild_foreach_variant cmake-utils_src_install
241 +}