File: do-not-use_libgcrypt-config.diff

package info (click to toggle)
fis-gtm 7.1-008-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 32,984 kB
  • sloc: ansic: 345,651; asm: 5,183; csh: 4,859; sh: 2,000; awk: 294; makefile: 73; sed: 13
file content (58 lines) | stat: -rw-r--r-- 3,055 bytes parent folder | download | duplicates (2)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Description: Drop unnecessary call to libgcrypt-config
 libgcrypt-config has been dropped in libgcrypt 1.11, the call here is
 unnecessary on Debian (headers in /usr/include).
 .
 The whole code snippet is a little bit strange since it allows searching for
 libgcrypt headers in a standard location while requiring that the library
 itself can be found in a standard location.
Author: Andreas Metzler <ametzler@debian.org>
Origin: vendor
Bug-Debian: https://bugs.debian.org/1071860
Last-Update: 2024-06-29

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -548,24 +548,25 @@ add_custom_command(
 add_custom_target(gen_tls_options
   DEPENDS ${GTM_BINARY_DIR}/gen_tls_options.h ${GTM_BINARY_DIR}/gen_tls_verify_options.h)
 
-# Locate libgcrypt's header files (assumption: all others headers are found in the same location)
-find_program(LIBGCRYPT_CONFIG_SCRIPT NAMES libgcrypt-config)
-if (LIBGCRYPT_CONFIG_SCRIPT MATCHES ".+-NOTFOUND")
-	pkg_check_modules (LIBGCRYPT REQUIRED libgcrypt)
-	if (NOT ${LIBGCRYPT_FOUND})
-		message(FATAL_ERROR "FATAL: neither libgcrypt-config nor pkg-config libgcrypt  found (${LIBGCRYPT_CONFIG_SCRIPT})")
-	endif ()
-	include_directories(${LIBGCRYPT_INCLUDE_DIRS})
-else()
-	# libgcrypt-config --cflags returns "\n" when the includes are located in the default search path
-	exec_program(${LIBGCRYPT_CONFIG_SCRIPT} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE LIBGCRYPT_CFLAGS)
-	# If a path is returned, it is preceded by '-I' for use as CFLAG directive
-	string(REGEX REPLACE "^-I" "" LIBGCRYPT_INCLUDES "${LIBGCRYPT_CFLAGS}")
-	if (NOT (${LIBGCRYPT_INCLUDES} MATCHES "\n"))
-		message("INFO: ${LIBGCRYPT_CONFIG_SCRIPT} ${_return_VALUE} '${LIBGCRYPT_INCLUDES}'")
-		include_directories(${LIBGCRYPT_INCLUDES})
-	endif()
-endif()
+# Disabled - Debian's libgcrypt header are installed in standard paths.
+# # Locate libgcrypt's header files (assumption: all others headers are found in the same location)
+# find_program(LIBGCRYPT_CONFIG_SCRIPT NAMES libgcrypt-config)
+# if (LIBGCRYPT_CONFIG_SCRIPT MATCHES ".+-NOTFOUND")
+# 	pkg_check_modules (LIBGCRYPT REQUIRED libgcrypt)
+# 	if (NOT ${LIBGCRYPT_FOUND})
+# 		message(FATAL_ERROR "FATAL: neither libgcrypt-config nor pkg-config libgcrypt  found (${LIBGCRYPT_CONFIG_SCRIPT})")
+# 	endif ()
+# 	include_directories(${LIBGCRYPT_INCLUDE_DIRS})
+# else()
+# 	# libgcrypt-config --cflags returns "\n" when the includes are located in the default search path
+# 	exec_program(${LIBGCRYPT_CONFIG_SCRIPT} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE LIBGCRYPT_CFLAGS)
+# 	# If a path is returned, it is preceded by '-I' for use as CFLAG directive
+# 	string(REGEX REPLACE "^-I" "" LIBGCRYPT_INCLUDES "${LIBGCRYPT_CFLAGS}")
+# 	if (NOT (${LIBGCRYPT_INCLUDES} MATCHES "\n"))
+# 		message("INFO: ${LIBGCRYPT_CONFIG_SCRIPT} ${_return_VALUE} '${LIBGCRYPT_INCLUDES}'")
+# 		include_directories(${LIBGCRYPT_INCLUDES})
+# 	endif()
+# endif()
 
 # Building the three encryption libraries could by a loop of some sort, but
 # manually creating each target is way easier.