forked from cossacklabs/themis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
themis.podspec
235 lines (210 loc) · 11.4 KB
/
themis.podspec
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
227
228
229
230
231
232
233
234
235
Pod::Spec.new do |s|
s.name = "themis"
s.version = "0.13.12"
s.summary = "Data security library for network communication and data storage for iOS and mac OS"
s.description = "Themis is a convenient cryptographic library for data protection. It provides secure messaging with forward secrecy and secure data storage. Themis is aimed at modern development practices and has a unified API across 12 platforms, including iOS/macOS, Ruby, JavaScript, Python, and Java/Android."
s.homepage = "https://cossacklabs.com"
s.license = { :type => 'Apache 2.0'}
s.source = { :git => "https://github.com/cossacklabs/themis.git", :tag => "#{s.version}" }
s.author = {'cossacklabs' => '[email protected]'}
s.module_name = 'themis'
s.default_subspec = 'openssl-1.1.1'
s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.11'
s.ios.frameworks = 'UIKit', 'Foundation'
# TODO(ilammy, 2020-03-02): resolve "pod spec lint" warnings due to dependencies
# If you update dependencies, please check whether we can remove "--allow-warnings"
# from podspec validation in .github/workflows/test-objc.yaml
# This variant uses the current stable, non-legacy version of OpenSSL.
s.subspec 'openssl-1.1.1' do |so|
# OpenSSL 1.1.1k
so.dependency 'CLOpenSSL-XCF', '1.1.11101'
# Enable bitcode for OpenSSL in a very specific way, but it works, thanks to @deszip
so.ios.pod_target_xcconfig = {
'OTHER_CFLAGS[config=Debug]' => '$(inherited) -fembed-bitcode-marker',
'OTHER_CFLAGS[config=Release]' => '$(inherited) -fembed-bitcode',
'BITCODE_GENERATION_MODE[config=Release]' => 'bitcode',
'BITCODE_GENERATION_MODE[config=Debug]' => 'bitcode-marker'
}
# We're building some C code here which uses includes as it pleases.
# Allow this behavior, but we will have to control header mappings.
# Also, configure some preprocessor definitions to select OpenSSL backend.
so.ios.xcconfig = {
'OTHER_CFLAGS' => '-DLIBRESSL',
'USE_HEADERMAP' => 'NO',
'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/themis/include" "${PODS_ROOT}/themis/src" "${PODS_ROOT}/themis/src/wrappers/themis/Obj-C"',
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
}
so.osx.xcconfig = {
'OTHER_CFLAGS' => '-DLIBRESSL',
'USE_HEADERMAP' => 'NO',
'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/themis/include" "${PODS_ROOT}/themis/src" "${PODS_ROOT}/themis/src/wrappers/themis/Obj-C"',
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
}
# We need to do this weird subspec matryoshka because CocoaPods
# insists on compiling everything as if it were a modular framework.
# Unfortunately, Themis has a lot of #include "themis/something.h"
# which break in modular compilation. The "header_dir" fixes it up,
# but we must set it differently for ObjCThemis. Hence two subspecs.
# End users should use "themis/openssl-1.1.1" only, not these ones.
so.subspec 'core' do |ss|
ss.source_files = [
"include/themis/*.h",
"include/soter/*.h",
"src/themis/*.{c,h}",
"src/soter/*.{c,h}",
"src/soter/ed25519/*.{c,h}",
"src/soter/openssl/*.{c,h}",
]
# Prevent CocoaPods from flattening the headers, we need structure.
ss.header_mappings_dir = "."
# Don't export Themis Core headers, make only ObjcThemis public.
ss.private_header_files = [
"include/themis/*.h",
"include/soter/*.h",
"src/themis/*.h",
"src/soter/*.h",
"src/soter/ed25519/*.h",
"src/soter/openssl/*.h",
]
end
so.subspec 'objcwrapper' do |ss|
ss.dependency 'themis/openssl-1.1.1/core'
ss.source_files = "src/wrappers/themis/Obj-C/objcthemis/*.{m,h}"
ss.header_dir = "objcthemis"
ss.header_mappings_dir = "src/wrappers/themis/Obj-C/objcthemis"
ss.public_header_files = "src/wrappers/themis/Obj-C/objcthemis/*.h"
end
end
# ---------- WARNING! --------------------------------------------
# themis-boringssl is DEPRECATED and will be removed in version 0.14
# Switch to the default subspec in your Podfile: `pod 'themis'`
# ----------------------------------------------------------------
# use `themis/themis-openssl` as separate target to use Themis with OpenSSL
s.subspec 'themis-openssl' do |so|
# Enable bitcode for OpenSSL in a very specific way, but it works, thanks to @deszip
so.ios.pod_target_xcconfig = {
'OTHER_CFLAGS[config=Debug]' => '$(inherited) -fembed-bitcode-marker',
'OTHER_CFLAGS[config=Release]' => '$(inherited) -fembed-bitcode',
'BITCODE_GENERATION_MODE[config=Release]' => 'bitcode',
'BITCODE_GENERATION_MODE[config=Debug]' => 'bitcode-marker'
}
# As of version 1.0.2.20.1, GRKOpenSSLFramework binaries do not contain
# arm64 slices for iOS Simulator and macOS, and thus do not support
# Apple Silicon. Disable building Themis for Apple Silicon until
# GRKOpenSSLFramework gets proper arm64 support.
# Update: 1.0.2.20.2 still with no arm64 simulator support
so.ios.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
so.ios.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
so.osx.pod_target_xcconfig = { 'EXCLUDED_ARCHS' => 'arm64' }
so.osx.user_target_xcconfig = { 'EXCLUDED_ARCHS' => 'arm64' }
# TODO: due to error in symbols in GRKOpenSSLFramework 219 release, we've manually switched to 218
# which doesn't sound like a good decision, so when GRKOpenSSLFramework will be updated –
# please bring back correct dependency version
# https://github.com/cossacklabs/themis/issues/538
# 26 sept 2019
#so.dependency 'GRKOpenSSLFramework', '~> 1.0.1' # <-- this is good
# 11 oct 2020 update: trying 1.0.2.20, but it also gives linking errors, so postponed
# https://github.com/levigroker/GRKOpenSSLFramework/issues/10
#so.dependency 'GRKOpenSSLFramework', '1.0.2.20' # 1.0.2u, latest in 1.0.2 branch
so.dependency 'GRKOpenSSLFramework', '1.0.2.18' # <-- this is temp
# We're building some C code here which uses includes as it pleases.
# Allow this behavior, but we will have to control header mappings.
# Also, configure some preprocessor definitions to select OpenSSL backend.
so.ios.xcconfig = {
'OTHER_CFLAGS' => '-DLIBRESSL',
'USE_HEADERMAP' => 'NO',
'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/themis/include" "${PODS_ROOT}/themis/src" "${PODS_ROOT}/themis/src/wrappers/themis/Obj-C"',
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
}
so.osx.xcconfig = {
'OTHER_CFLAGS' => '-DLIBRESSL',
'USE_HEADERMAP' => 'NO',
'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/themis/include" "${PODS_ROOT}/themis/src" "${PODS_ROOT}/themis/src/wrappers/themis/Obj-C"',
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
}
# don't use as independent target
so.subspec 'core' do |ss|
ss.source_files = [
"include/themis/*.h",
"include/soter/*.h",
"src/themis/*.{c,h}",
"src/soter/*.{c,h}",
"src/soter/ed25519/*.{c,h}",
"src/soter/openssl/*.{c,h}",
]
# Prevent CocoaPods from flattening the headers, we need structure.
ss.header_mappings_dir = "."
# Don't export Themis Core headers, make only ObjcThemis public.
ss.private_header_files = [
"include/themis/*.h",
"include/soter/*.h",
"src/themis/*.h",
"src/soter/*.h",
"src/soter/ed25519/*.h",
"src/soter/openssl/*.h",
]
end
# don't use as independent target
so.subspec 'objcwrapper' do |ss|
ss.header_mappings_dir = 'src/wrappers/themis/Obj-C/objcthemis'
ss.source_files = "src/wrappers/themis/Obj-C/objcthemis/*.{m,h}"
ss.public_header_files = 'src/wrappers/themis/Obj-C/objcthemis/*.h'
ss.header_dir = 'objcthemis'
ss.dependency 'themis/themis-openssl/core'
end
end
# ---------- WARNING! ----------------------------------------------
# themis-boringssl is DEPRECATED and will be removed in version 0.14
# Switch to the default subspec in your Podfile: `pod 'themis'`
# ------------------------------------------------------------------
# use `themis/themis-boringssl` as separate target to use Themis with BoringSSL
s.subspec 'themis-boringssl' do |so|
so.dependency 'BoringSSL', '~> 10.0'
# We're building some C code here which uses includes as it pleases.
# Allow this behavior, but we will have to control header mappings.
# Also, configure some preprocessor definitions to select BoringSSL backend.
so.ios.xcconfig = {
'OTHER_CFLAGS' => '-DBORINGSSL -DCRYPTO_ENGINE_PATH=boringssl -DSOTER_BORINGSSL_DISABLE_XTS',
'USE_HEADERMAP' => 'NO',
'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/themis/include" "${PODS_ROOT}/themis/src" "${PODS_ROOT}/themis/src/wrappers/themis/Obj-C"',
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
}
so.osx.xcconfig = {
'OTHER_CFLAGS' => '-DBORINGSSL -DCRYPTO_ENGINE_PATH=boringssl -DSOTER_BORINGSSL_DISABLE_XTS',
'USE_HEADERMAP' => 'NO',
'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/themis/include" "${PODS_ROOT}/themis/src" "${PODS_ROOT}/themis/src/wrappers/themis/Obj-C"',
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
}
# don't use as independent target
so.subspec 'core' do |ss|
ss.source_files = [
"include/themis/*.h",
"include/soter/*.h",
"src/themis/*.{c,h}",
"src/soter/*.{c,h}",
"src/soter/ed25519/*.{c,h}",
"src/soter/boringssl/*.{c,h}",
]
# Prevent CocoaPods from flattening the headers, we need structure.
ss.header_mappings_dir = "."
# Don't export Themis Core headers, make only ObjcThemis public.
ss.private_header_files = [
"include/themis/*.h",
"include/soter/*.h",
"src/themis/*.h",
"src/soter/*.h",
"src/soter/ed25519/*.h",
"src/soter/boringssl/*.h",
]
end
# don't use as independent target
so.subspec 'objcwrapper' do |ss|
ss.header_mappings_dir = 'src/wrappers/themis/Obj-C/objcthemis'
ss.source_files = "src/wrappers/themis/Obj-C/objcthemis/*.{m,h}"
ss.public_header_files = 'src/wrappers/themis/Obj-C/objcthemis/*.h'
ss.header_dir = 'objcthemis'
ss.dependency 'themis/themis-boringssl/core'
end
end
end