commit:     7131703c3d0024686f34ebfcb0ee4f72282b088e
Author:     Sven Eden <sven.eden <AT> prydeworx <DOT> com>
AuthorDate: Sun Mar 14 15:47:06 2021 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sat Mar 27 05:49:55 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7131703c

dev-libs/aws-c-cal: Fix building with USE="static-libs" (#761385)

Whe building with USE="static-libs", the final linker stage fails
with:

````
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
    /usr/lib64/libcrypto.a(c_zlib.o):
        in function `zlib_stateful_expand_block':
            undefined reference to `inflate'
            undefined reference to `deflateEnd'
````

To fix this -lz is now explicitly added when merging with
USE="static-libs"

Closes: https://bugs.gentoo.org/761385
Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Sven Eden <sven.eden <AT> prydeworx.com>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 dev-libs/aws-c-cal/aws-c-cal-0.4.5.ebuild                    | 11 +++--------
 .../files/aws-c-cal-0.4.5-add_libz_for_static.patch          | 12 ++++++++++++
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/dev-libs/aws-c-cal/aws-c-cal-0.4.5.ebuild 
b/dev-libs/aws-c-cal/aws-c-cal-0.4.5.ebuild
index 407a8f3334d..7dd18890b23 100644
--- a/dev-libs/aws-c-cal/aws-c-cal-0.4.5.ebuild
+++ b/dev-libs/aws-c-cal/aws-c-cal-0.4.5.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -16,19 +16,14 @@ IUSE="static-libs test"
 
 RESTRICT="!test? ( test )"
 
-BDEPEND="
-       || (
-               >dev-util/cmake-3.19.1
-               <dev-util/cmake-3.19.0
-       )
-"
-
 DEPEND="
        >=dev-libs/aws-c-common-0.4.62:=[static-libs=]
+       >=dev-libs/openssl-1.1.1:=[static-libs=]
 "
 
 PATCHES=(
        "${FILESDIR}"/${P}-cmake-prefix.patch
+       "${FILESDIR}"/${P}-add_libz_for_static.patch
 )
 
 src_configure() {

diff --git a/dev-libs/aws-c-cal/files/aws-c-cal-0.4.5-add_libz_for_static.patch 
b/dev-libs/aws-c-cal/files/aws-c-cal-0.4.5-add_libz_for_static.patch
new file mode 100644
index 00000000000..d5a8aec1245
--- /dev/null
+++ b/dev-libs/aws-c-cal/files/aws-c-cal-0.4.5-add_libz_for_static.patch
@@ -0,0 +1,12 @@
+--- a/CMakeLists.txt   2021-03-26 08:23:16.460538851 +0100
++++ b/CMakeLists.txt   2021-03-26 08:25:31.408531072 +0100
+@@ -81,6 +81,9 @@
+         find_package(LibCrypto REQUIRED)
+         set(PLATFORM_LIBS LibCrypto::Crypto dl)
+     endif()
++    if (NOT BUILD_SHARED_LIBS)
++        set(PLATFORM_LIBS ${PLATFORM_LIBS} z)
++    endif()
+ endif()
+ 
+ file(GLOB CAL_HEADERS

Reply via email to