net-libs/mbedtls: fix wrong headers, bug #705038
authorAnthony G. Basile <blueness@gentoo.org>
Wed, 29 Jan 2020 14:21:46 +0000 (09:21 -0500)
committerAnthony G. Basile <blueness@gentoo.org>
Wed, 29 Jan 2020 14:22:13 +0000 (09:22 -0500)
Closes: https://bugs.gentoo.org/705038
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
net-libs/mbedtls/files/mbedtls-un-pebcak-705038-wrong-file.patch [new file with mode: 0644]
net-libs/mbedtls/mbedtls-2.18.1-r1.ebuild
net-libs/mbedtls/mbedtls-2.19.1-r1.ebuild

diff --git a/net-libs/mbedtls/files/mbedtls-un-pebcak-705038-wrong-file.patch b/net-libs/mbedtls/files/mbedtls-un-pebcak-705038-wrong-file.patch
new file mode 100644 (file)
index 0000000..73e870f
--- /dev/null
@@ -0,0 +1,50 @@
+Fix https://bugs.gentoo.org/705038
+
+Thanks Greg Turner <gmt@be-evil.net>
+
+diff -urpN mbedtls-mbedtls-2.19.1.orig/crypto/include/CMakeLists.txt mbedtls-mbedtls-2.19.1/crypto/include/CMakeLists.txt
+--- mbedtls-mbedtls-2.19.1.orig/crypto/include/CMakeLists.txt  2020-01-26 09:01:50.324231295 -0800
++++ mbedtls-mbedtls-2.19.1/crypto/include/CMakeLists.txt       2020-01-26 09:04:26.498880873 -0800
+@@ -5,6 +5,19 @@ if(INSTALL_MBEDTLS_HEADERS)
+     file(GLOB headers "mbedtls/*.h")
+     file(GLOB psa_headers "psa/*.h")
++    if(USE_CRYPTO_SUBMODULE)
++        # Don't overwrite mbedtls's header files!
++        # config.h is supposed to be automatically checked for compatibility
++        # in automatic builds, while the other files should not just be
++        # compatible, but also identical in theory.
++        # Practically, we don't check that in crypto but just assume that the
++        # submodule configuration is sane and trust tls's headers.
++        list(REMOVE_ITEM headers    "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls/compat-1.3.h"
++                                    "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls/config.h"
++                                    "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls/error.h"
++                                    "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls/version.h")
++    endif(USE_CRYPTO_SUBMODULE)
++
+     install(FILES ${headers}
+         DESTINATION include/mbedtls
+         PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
+diff -urpN mbedtls-mbedtls-2.19.1.orig/include/CMakeLists.txt mbedtls-mbedtls-2.19.1/include/CMakeLists.txt
+--- mbedtls-mbedtls-2.19.1.orig/include/CMakeLists.txt 2020-01-26 09:01:50.320231227 -0800
++++ mbedtls-mbedtls-2.19.1/include/CMakeLists.txt      2020-01-26 09:03:45.761189288 -0800
+@@ -4,19 +4,6 @@ if(INSTALL_MBEDTLS_HEADERS)
+     file(GLOB headers "mbedtls/*.h")
+-    if(USE_CRYPTO_SUBMODULE)
+-        # Don't overwrite mbedtls's header files!
+-        # config.h is supposed to be automatically checked for compatibility
+-        # in automatic builds, while the other files should not just be
+-        # compatible, but also identical in theory.
+-        # Practically, we don't check that in crypto but just assume that the
+-        # submodule configuration is sane and trust tls's headers.
+-        list(REMOVE_ITEM headers    "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls/compat-1.3.h"
+-                                    "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls/config.h"
+-                                    "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls/error.h"
+-                                    "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls/version.h")
+-    endif(USE_CRYPTO_SUBMODULE)
+-
+     install(FILES ${headers}
+         DESTINATION include/mbedtls
+         PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
index b11f2794a352dcd7b83d1d5018f999d77a23b479..dfb900ea4c69443c197b557e52415031b0ce5a48 100644 (file)
@@ -38,6 +38,7 @@ enable_mbedtls_option() {
 
 PATCHES=(
        "${FILESDIR}"/${PN}-dont-overwrite-headers.patch
+       "${FILESDIR}"/${PN}-un-pebcak-705038-wrong-file.patch
 )
 
 src_prepare() {
index 1a73d20f220e8e9f55729b96e4d4db68529268d2..a18fc891988464987ad0b02540db33a3c0f18c92 100644 (file)
@@ -38,6 +38,7 @@ enable_mbedtls_option() {
 
 PATCHES=(
        "${FILESDIR}"/${PN}-dont-overwrite-headers.patch
+       "${FILESDIR}"/${PN}-un-pebcak-705038-wrong-file.patch
 )
 
 src_prepare() {