depot/third_party/nixpkgs/pkgs/development/tools/build-managers/cmake/remove-systemconfiguration-dep.patch
Default email 88abffb7d2 Project import generated by Copybara.
GitOrigin-RevId: bc9b956714ed6eac5f8888322aac5bc41389defa
2021-09-18 12:52:07 +02:00

89 lines
3.2 KiB
Diff

From 76523ca5b2227085bb65253900e866b08a2b5efb Mon Sep 17 00:00:00 2001
From: Tobias Mayer <tobim@fastmail.fm>
Date: Fri, 30 Jul 2021 10:50:16 +0200
Subject: [PATCH] Disable NAT64 address synthesis on darwin
This intentionally breaks the feature by partially reverting
https://github.com/curl/curl/commit/31f631a142d855f069242f3e0c643beec25d1b51
This is a stop-gap to get CMake to build without the SystemConfiguration
framework.
---
Utilities/cmcurl/CMakeLists.txt | 8 --------
Utilities/cmcurl/lib/curl_setup.h | 4 ----
Utilities/cmcurl/lib/hostip.c | 17 -----------------
3 files changed, 29 deletions(-)
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 16ef037ccc..17564bbb69 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -511,14 +511,6 @@ if(CMAKE_USE_SECTRANSP)
list(APPEND CURL_LIBS "${COREFOUNDATION_FRAMEWORK}" "${SECURITY_FRAMEWORK}")
endif()
-if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- find_library(SYSTEMCONFIGURATION_FRAMEWORK "SystemConfiguration")
- if(NOT SYSTEMCONFIGURATION_FRAMEWORK)
- message(FATAL_ERROR "SystemConfiguration framework not found")
- endif()
- list(APPEND CURL_LIBS "${SYSTEMCONFIGURATION_FRAMEWORK}")
-endif()
-
if(CMAKE_USE_OPENSSL)
find_package(OpenSSL)
if(NOT OpenSSL_FOUND)
diff --git a/Utilities/cmcurl/lib/curl_setup.h b/Utilities/cmcurl/lib/curl_setup.h
index 2d13a40a55..35160bc0f5 100644
--- a/Utilities/cmcurl/lib/curl_setup.h
+++ b/Utilities/cmcurl/lib/curl_setup.h
@@ -251,11 +251,7 @@
* performing this task will result in a synthesized IPv6 address.
*/
#if defined(__APPLE__) && !defined(USE_ARES)
-#include <TargetConditionals.h>
#define USE_RESOLVE_ON_IPS 1
-# if defined(TARGET_OS_OSX) && TARGET_OS_OSX
-# define CURL_OSX_CALL_COPYPROXIES 1
-# endif
#endif
#ifdef USE_LWIPSOCK
diff --git a/Utilities/cmcurl/lib/hostip.c b/Utilities/cmcurl/lib/hostip.c
index e0e3cfc2cb..45190a100b 100644
--- a/Utilities/cmcurl/lib/hostip.c
+++ b/Utilities/cmcurl/lib/hostip.c
@@ -68,10 +68,6 @@
#include "curl_memory.h"
#include "memdebug.h"
-#if defined(ENABLE_IPV6) && defined(CURL_OSX_CALL_COPYPROXIES)
-#include <SystemConfiguration/SCDynamicStoreCopySpecific.h>
-#endif
-
#if defined(CURLRES_SYNCH) && \
defined(HAVE_ALARM) && defined(SIGALRM) && defined(HAVE_SIGSETJMP)
/* alarm-based timeouts can only be used with all the dependencies satisfied */
@@ -533,19 +529,6 @@ enum resolve_t Curl_resolv(struct Curl_easy *data,
return CURLRESOLV_ERROR;
}
-#if defined(ENABLE_IPV6) && defined(CURL_OSX_CALL_COPYPROXIES)
- /*
- * The automagic conversion from IPv4 literals to IPv6 literals only works
- * if the SCDynamicStoreCopyProxies system function gets called first. As
- * Curl currently doesn't support system-wide HTTP proxies, we therefore
- * don't use any value this function might return.
- *
- * This function is only available on a macOS and is not needed for
- * IPv4-only builds, hence the conditions above.
- */
- SCDynamicStoreCopyProxies(NULL);
-#endif
-
#ifndef USE_RESOLVE_ON_IPS
/* First check if this is an IPv4 address string */
if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
--
2.32.0