-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathbuild.py
228 lines (216 loc) · 7.76 KB
/
build.py
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
script = Script()
cf = StaticLibrary("CoreFoundation")
cf.GCC_PREFIX_HEADER = 'Base.subproj/CoreFoundation_Prefix.h'
if Configuration.current.target.sdk == OSType.Linux:
cf.CFLAGS = '-DDEPLOYMENT_TARGET_LINUX -D_GNU_SOURCE '
Configuration.current.requires_pkg_config = True
elif Configuration.current.target.sdk == OSType.FreeBSD:
cf.CFLAGS = '-DDEPLOYMENT_TARGET_FREEBSD -I/usr/local/include -I/usr/local/include/libxml2 '
elif Configuration.current.target.sdk == OSType.MacOSX:
cf.CFLAGS = '-DDEPLOYMENT_TARGET_MACOSX '
cf.ASFLAGS = " ".join([
'-DCF_CHARACTERSET_BITMAP=\\"CharacterSets/CFCharacterSetBitmaps.bitmap\\"',
'-DCF_CHARACTERSET_UNICHAR_DB=\\"CharacterSets/CFUniCharPropertyDatabase.data\\"',
'-DCF_CHARACTERSET_UNICODE_DATA_B=\\"CharacterSets/CFUnicodeData-B.mapping\\"',
'-DCF_CHARACTERSET_UNICODE_DATA_L=\\"CharacterSets/CFUnicodeData-L.mapping\\"',
])
cf.ROOT_HEADERS_FOLDER_PATH = "${PREFIX}/lib/swift"
cf.PUBLIC_HEADERS_FOLDER_PATH = "${PREFIX}/lib/swift/CoreFoundation"
cf.PRIVATE_HEADERS_FOLDER_PATH = "${PREFIX}/lib/swift/CoreFoundation"
cf.PROJECT_HEADERS_FOLDER_PATH = "${PREFIX}/lib/swift/CoreFoundation"
cf.PUBLIC_MODULE_FOLDER_PATH = "${PREFIX}/lib/swift/CoreFoundation"
cf.CFLAGS += " ".join([
'-DU_SHOW_DRAFT_API',
'-DCF_BUILDING_CF',
'-DDEPLOYMENT_RUNTIME_SWIFT',
'-fconstant-cfstrings',
'-fexceptions',
'-Wno-shorten-64-to-32',
'-Wno-deprecated-declarations',
'-Wno-unreachable-code',
'-Wno-conditional-uninitialized',
'-Wno-unused-variable',
'-Wno-int-conversion',
'-Wno-unused-function',
'-I${SYSROOT}/usr/include/libxml2',
'-I./',
])
headers = CopyHeaders(
module = 'Base.subproj/module.modulemap',
public = [
'Stream.subproj/CFStream.h',
'String.subproj/CFStringEncodingExt.h',
'Base.subproj/SwiftRuntime/CoreFoundation.h',
'Base.subproj/SwiftRuntime/TargetConditionals.h',
'RunLoop.subproj/CFMessagePort.h',
'Collections.subproj/CFBinaryHeap.h',
'PlugIn.subproj/CFBundle.h',
'Locale.subproj/CFCalendar.h',
'Collections.subproj/CFBitVector.h',
'Base.subproj/CFAvailability.h',
'Collections.subproj/CFTree.h',
'NumberDate.subproj/CFTimeZone.h',
'Error.subproj/CFError.h',
'Collections.subproj/CFBag.h',
'PlugIn.subproj/CFPlugIn.h',
'Parsing.subproj/CFXMLParser.h',
'String.subproj/CFString.h',
'Collections.subproj/CFSet.h',
'Base.subproj/CFUUID.h',
'NumberDate.subproj/CFDate.h',
'Collections.subproj/CFDictionary.h',
'Base.subproj/CFByteOrder.h',
'AppServices.subproj/CFUserNotification.h',
'Base.subproj/CFBase.h',
'Preferences.subproj/CFPreferences.h',
'Locale.subproj/CFLocale.h',
'RunLoop.subproj/CFSocket.h',
'Parsing.subproj/CFPropertyList.h',
'Collections.subproj/CFArray.h',
'RunLoop.subproj/CFRunLoop.h',
'URL.subproj/CFURLAccess.h',
'Locale.subproj/CFDateFormatter.h',
'RunLoop.subproj/CFMachPort.h',
'PlugIn.subproj/CFPlugInCOM.h',
'Base.subproj/CFUtilities.h',
'Parsing.subproj/CFXMLNode.h',
'URL.subproj/CFURLComponents.h',
'URL.subproj/CFURL.h',
'Locale.subproj/CFNumberFormatter.h',
'String.subproj/CFCharacterSet.h',
'NumberDate.subproj/CFNumber.h',
'Collections.subproj/CFData.h',
'String.subproj/CFAttributedString.h',
'AppServices.subproj/CFNotificationCenter.h',
],
private = [
'Base.subproj/CFAsmMacros.h',
'Base.subproj/ForSwiftFoundationOnly.h',
'Base.subproj/ForFoundationOnly.h',
'String.subproj/CFBurstTrie.h',
'Error.subproj/CFError_Private.h',
'URL.subproj/CFURLPriv.h',
'Base.subproj/CFLogUtilities.h',
'PlugIn.subproj/CFBundlePriv.h',
'StringEncodings.subproj/CFStringEncodingConverter.h',
'Stream.subproj/CFStreamAbstract.h',
'Base.subproj/CFInternal.h',
'Parsing.subproj/CFXMLInputStream.h',
'Parsing.subproj/CFXMLInterface.h',
'PlugIn.subproj/CFPlugIn_Factory.h',
'String.subproj/CFStringLocalizedFormattingInternal.h',
'PlugIn.subproj/CFBundle_Internal.h',
'StringEncodings.subproj/CFStringEncodingConverterPriv.h',
'Collections.subproj/CFBasicHash.h',
'StringEncodings.subproj/CFStringEncodingDatabase.h',
'StringEncodings.subproj/CFUnicodeDecomposition.h',
'Stream.subproj/CFStreamInternal.h',
'PlugIn.subproj/CFBundle_BinaryTypes.h',
'Locale.subproj/CFICULogging.h',
'Locale.subproj/CFLocaleInternal.h',
'StringEncodings.subproj/CFUnicodePrecomposition.h',
'Base.subproj/CFPriv.h',
'StringEncodings.subproj/CFUniCharPriv.h',
'URL.subproj/CFURL.inc.h',
'NumberDate.subproj/CFBigNumber.h',
'StringEncodings.subproj/CFUniChar.h',
'StringEncodings.subproj/CFStringEncodingConverterExt.h',
'Collections.subproj/CFStorage.h',
'Base.subproj/CFRuntime.h',
'String.subproj/CFStringDefaultEncoding.h',
'String.subproj/CFCharacterSetPriv.h',
'Stream.subproj/CFStreamPriv.h',
'StringEncodings.subproj/CFICUConverters.h',
'String.subproj/CFRegularExpression.h',
'String.subproj/CFRunArray.h',
'URL.subproj/CFURLSessionInterface.h',
],
project = [
])
cf.add_phase(headers)
sources = CompileSources([
'Base.subproj/CFBase.c',
'Base.subproj/CFFileUtilities.c',
'Base.subproj/CFPlatform.c',
'Base.subproj/CFRuntime.c',
'Base.subproj/CFSortFunctions.c',
'Base.subproj/CFSystemDirectories.c',
'Base.subproj/CFUtilities.c',
'Base.subproj/CFUUID.c',
'Collections.subproj/CFArray.c',
'Collections.subproj/CFBag.c',
'Collections.subproj/CFBasicHash.c',
'Collections.subproj/CFBinaryHeap.c',
'Collections.subproj/CFBitVector.c',
'Collections.subproj/CFData.c',
'Collections.subproj/CFDictionary.c',
'Collections.subproj/CFSet.c',
'Collections.subproj/CFStorage.c',
'Collections.subproj/CFTree.c',
'Error.subproj/CFError.c',
'Locale.subproj/CFCalendar.c',
'Locale.subproj/CFDateFormatter.c',
'Locale.subproj/CFLocale.c',
'Locale.subproj/CFLocaleIdentifier.c',
'Locale.subproj/CFLocaleKeys.c',
'Locale.subproj/CFNumberFormatter.c',
'NumberDate.subproj/CFBigNumber.c',
'NumberDate.subproj/CFDate.c',
'NumberDate.subproj/CFNumber.c',
'NumberDate.subproj/CFTimeZone.c',
'Parsing.subproj/CFBinaryPList.c',
'Parsing.subproj/CFOldStylePList.c',
'Parsing.subproj/CFPropertyList.c',
'Parsing.subproj/CFXMLInputStream.c',
'Parsing.subproj/CFXMLNode.c',
'Parsing.subproj/CFXMLParser.c',
'Parsing.subproj/CFXMLTree.c',
'Parsing.subproj/CFXMLInterface.c',
'PlugIn.subproj/CFBundle.c',
'PlugIn.subproj/CFBundle_Binary.c',
'PlugIn.subproj/CFBundle_Grok.c',
'PlugIn.subproj/CFBundle_InfoPlist.c',
'PlugIn.subproj/CFBundle_Locale.c',
'PlugIn.subproj/CFBundle_Resources.c',
'PlugIn.subproj/CFBundle_Strings.c',
'PlugIn.subproj/CFPlugIn.c',
'PlugIn.subproj/CFPlugIn_Factory.c',
'PlugIn.subproj/CFPlugIn_Instance.c',
'PlugIn.subproj/CFPlugIn_PlugIn.c',
'Preferences.subproj/CFApplicationPreferences.c',
'Preferences.subproj/CFPreferences.c',
'RunLoop.subproj/CFRunLoop.c',
'RunLoop.subproj/CFSocket.c',
'Stream.subproj/CFConcreteStreams.c',
'Stream.subproj/CFSocketStream.c',
'Stream.subproj/CFStream.c',
'String.subproj/CFBurstTrie.c',
'String.subproj/CFCharacterSet.c',
'String.subproj/CFString.c',
'String.subproj/CFStringEncodings.c',
'String.subproj/CFStringScanner.c',
'String.subproj/CFStringUtilities.c',
'String.subproj/CFStringTransform.c',
'StringEncodings.subproj/CFBuiltinConverters.c',
'StringEncodings.subproj/CFICUConverters.c',
'StringEncodings.subproj/CFPlatformConverters.c',
'StringEncodings.subproj/CFStringEncodingConverter.c',
'StringEncodings.subproj/CFStringEncodingDatabase.c',
'StringEncodings.subproj/CFUniChar.c',
'StringEncodings.subproj/CFUnicodeDecomposition.c',
'StringEncodings.subproj/CFUnicodePrecomposition.c',
'URL.subproj/CFURL.c',
'URL.subproj/CFURLAccess.c',
'URL.subproj/CFURLComponents.c',
'URL.subproj/CFURLComponents_URIParser.c',
'String.subproj/CFCharacterSetData.S',
'String.subproj/CFUnicodeData.S',
'String.subproj/CFUniCharPropertyDatabase.S',
'String.subproj/CFRegularExpression.c',
'String.subproj/CFAttributedString.c',
'String.subproj/CFRunArray.c',
])
sources.add_dependency(headers)
cf.add_phase(sources)
script.add_product(cf)
script.generate()