about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/build-managers/cmake/libuv-application-services.patch
blob: 08899f5c241fef07ef18d3d229ed50d7ff959644 (plain) (blame)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
diff -ur cmake-3.12.1/Utilities/cmlibuv/CMakeLists.txt cmake-3.12.1-patched/Utilities/cmlibuv/CMakeLists.txt
--- cmake-3.12.1/Utilities/cmlibuv/CMakeLists.txt	2018-08-09 21:14:08.000000000 +0900
+++ cmake-3.12.1-patched/Utilities/cmlibuv/CMakeLists.txt	2018-08-13 10:14:53.000000000 +0900
@@ -173,6 +173,22 @@
     src/unix/kqueue.c
     src/unix/proctitle.c
     )
+
+  include(CheckIncludeFile)
+
+  check_include_file("ApplicationServices/ApplicationServices.h" HAVE_ApplicationServices)
+  if (HAVE_ApplicationServices)
+    list(APPEND uv_defines
+      HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H=1
+      )
+  endif()
+
+  check_include_file("CoreServices/CoreServices.h" HAVE_CoreServices)
+  if (HAVE_CoreServices)
+    list(APPEND uv_defines
+      HAVE_CORESERVICES_CORESERVICES_H=1
+      )
+  endif()
 endif()
 
 if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
diff -ur cmake-3.12.1/Utilities/cmlibuv/src/unix/darwin-proctitle.c cmake-3.12.1-patched/Utilities/cmlibuv/src/unix/darwin-proctitle.c
--- cmake-3.12.1/Utilities/cmlibuv/src/unix/darwin-proctitle.c	2018-08-09 21:14:08.000000000 +0900
+++ cmake-3.12.1-patched/Utilities/cmlibuv/src/unix/darwin-proctitle.c	2018-08-13 10:01:29.000000000 +0900
@@ -26,9 +26,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <TargetConditionals.h>
-
-#if !TARGET_OS_IPHONE
+#if HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H
 # include <CoreFoundation/CoreFoundation.h>
 # include <ApplicationServices/ApplicationServices.h>
 #endif
@@ -58,7 +56,7 @@
 
 
 int uv__set_process_title(const char* title) {
-#if TARGET_OS_IPHONE
+#if !HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H
   return uv__pthread_setname_np(title);
 #else
   CFStringRef (*pCFStringCreateWithCString)(CFAllocatorRef,
@@ -205,5 +203,5 @@
     dlclose(application_services_handle);
 
   return err;
-#endif  /* !TARGET_OS_IPHONE */
+#endif  /* HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H */
 }
diff -ur cmake-3.12.1/Utilities/cmlibuv/src/unix/fsevents.c cmake-3.12.1-patched/Utilities/cmlibuv/src/unix/fsevents.c
--- cmake-3.12.1/Utilities/cmlibuv/src/unix/fsevents.c	2018-08-09 21:14:08.000000000 +0900
+++ cmake-3.12.1-patched/Utilities/cmlibuv/src/unix/fsevents.c	2018-08-13 10:01:29.000000000 +0900
@@ -21,7 +21,7 @@
 #include "uv.h"
 #include "internal.h"
 
-#if TARGET_OS_IPHONE
+#if !HAVE_CORESERVICES_CORESERVICES_H
 
 /* iOS (currently) doesn't provide the FSEvents-API (nor CoreServices) */
 
@@ -38,7 +38,7 @@
 void uv__fsevents_loop_delete(uv_loop_t* loop) {
 }
 
-#else /* TARGET_OS_IPHONE */
+#else /* !HAVE_CORESERVICES_CORESERVICES_H */
 
 #include <dlfcn.h>
 #include <assert.h>
@@ -916,4 +916,4 @@
   return 0;
 }
 
-#endif /* TARGET_OS_IPHONE */
+#endif /* !HAVE_CORESERVICES_CORESERVICES_H */