File: libgit2-mbedtls2.patch

package info (click to toggle)
julia 1.0.3%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 49,452 kB
  • sloc: lisp: 236,453; ansic: 55,579; cpp: 25,603; makefile: 1,685; pascal: 1,130; sh: 956; asm: 86; xml: 76
file content (43 lines) | stat: -rw-r--r-- 1,799 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Fixes mbedTLS support to link properly and not include libssl.so

Tracked in upstream PR https://github.com/libgit2/libgit2/pull/4678

diff --git a/.travis.yml b/.travis.yml
index 686041bfa..61edba135 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -58,12 +58,12 @@ matrix:
    - compiler: gcc
      env:
          MBEDTLS=1
-         OPTIONS="-DTHREADSAFE=ON -DCMAKE_BUILD_TYPE=Release -DUSE_HTTPS=mbedTLS -DMBEDTLS_ROOT_DIR=../deps/mbedtls"
+         OPTIONS="-DTHREADSAFE=ON -DCMAKE_BUILD_TYPE=Release -DUSE_HTTPS=mbedTLS -DSHA1_BACKEND=mbedTLS -DMBEDTLS_ROOT_DIR=../deps/mbedtls"
      os: linux
    - compiler: gcc
      env:
          MBEDTLS=1
-         OPTIONS="-DTHREADSAFE=OFF -DBUILD_EXAMPLES=ON -DUSE_HTTPS=mbedTLS -DMBEDTLS_ROOT_DIR=../deps/mbedtls"
+         OPTIONS="-DTHREADSAFE=OFF -DBUILD_EXAMPLES=ON -DUSE_HTTPS=mbedTLS -DSHA1_BACKEND=mbedTLS -DMBEDTLS_ROOT_DIR=../deps/mbedtls"
      os: linux
  allow_failures:
    - env: COVERITY=1
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2b82bb325..2deed5f87 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -284,8 +284,13 @@ ELSEIF(SHA1_BACKEND STREQUAL "CommonCrypto")
 ELSEIF (SHA1_BACKEND STREQUAL "mbedTLS")
 	ADD_FEATURE_INFO(SHA ON "using mbedTLS")
 	SET(GIT_SHA1_MBEDTLS 1)
-	FILE(GLOB SRC_SHA1 src/hash/hash_mbedtls.c)
-	LIST(APPEND LIBGIT2_PC_REQUIRES "mbedtls")
+	FILE(GLOB SRC_SHA1 hash/hash_mbedtls.c)
+	LIST(APPEND LIBGIT2_INCLUDES ${MBEDTLS_INCLUDE_DIR})
+	LIST(APPEND LIBGIT2_LIBS ${MBEDTLS_LIBRARIES})
+	# mbedTLS has no pkgconfig file, hence we can't require it
+	# https://github.com/ARMmbed/mbedtls/issues/228
+	# For now, pass its link flags as our own
+	LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
 ELSE()
 	MESSAGE(FATAL_ERROR "Asked for unknown SHA1 backend ${SHA1_BACKEND}")
 ENDIF()