-
Notifications
You must be signed in to change notification settings - Fork 55
/
TorStatic.podspec
112 lines (92 loc) · 4.09 KB
/
TorStatic.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
Pod::Spec.new do |m|
# TODO: Why the hell do I need to provide this manually? CocoaPods should figure this out automatically, like with other pods, when they're used as static libraries.
m.name = 'Tor'
m.version = '408.13.1'
m.summary = 'Tor.framework is the easiest way to embed Tor in your iOS application.'
m.description = 'Tor.framework is the easiest way to embed Tor in your iOS application. Currently, the framework compiles in static versions of tor, libevent, openssl, and liblzma.'
m.homepage = 'https://github.com/iCepa/Tor.framework'
m.license = { :type => 'MIT', :file => 'LICENSE' }
m.authors = { 'Conrad Kramer' => 'conrad@conradkramer.com',
'Chris Ballinger' => 'chris@chatsecure.org',
'Mike Tigas' => 'mike@tig.as',
'Benjamin Erhart' => 'berhart@netzarchitekten.com', }
m.source = { :git => 'https://github.com/iCepa/Tor.framework.git',
:branch => 'pure_pod',
:tag => "v#{m.version}",
:submodules => true }
m.social_media_url = 'https://chaos.social/@tla'
m.ios.deployment_target = '12.0'
m.macos.deployment_target = '10.13'
script = <<-ENDSCRIPT
cd "${PODS_TARGET_SRCROOT}/Tor/%1$s"
../%1$s.sh
ENDSCRIPT
m.subspec 'Core' do |s|
s.requires_arc = true
s.source_files = 'Tor/Classes/Core/**/*'
end
m.subspec 'CTor' do |s|
s.dependency 'Tor/Core'
s.requires_arc = true
s.source_files = 'Tor/Classes/CTor/**/*'
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'HEADER_SEARCH_PATHS' => '$(inherited) "${PODS_TARGET_SRCROOT}/Tor/tor" "${PODS_TARGET_SRCROOT}/Tor/tor/src" "${PODS_TARGET_SRCROOT}/Tor/openssl/include" "${BUILT_PRODUCTS_DIR}/openssl" "${PODS_TARGET_SRCROOT}/Tor/libevent/include"',
'OTHER_LDFLAGS' => '$(inherited) -L"${BUILT_PRODUCTS_DIR}/Tor" -l"z" -l"lzma" -l"crypto" -l"ssl" -l"event_core" -l"event_extra" -l"event_pthreads" -l"event" -l"tor"'
}
s.ios.pod_target_xcconfig = {
'OTHER_LDFLAGS' => '$(inherited) -L"${BUILT_PRODUCTS_DIR}/Tor-iOS"'
}
s.macos.pod_target_xcconfig = {
'OTHER_LDFLAGS' => '$(inherited) -L"${BUILT_PRODUCTS_DIR}/Tor-macOS"'
}
s.user_target_xcconfig = {
'HEADER_SEARCH_PATHS' => '$(inherited) "${PODS_ROOT}/Headers/Public"',
}
s.script_phases = [
{
:name => 'Build LZMA',
:execution_position => :before_compile,
:output_files => ['lzma-always-execute-this-but-supress-warning'],
:script => sprintf(script, "xz")
},
{
:name => 'Build OpenSSL',
:execution_position => :before_compile,
:output_files => ['openssl-always-execute-this-but-supress-warning'],
:script => sprintf(script, "openssl")
},
{
:name => 'Build libevent',
:execution_position => :before_compile,
:output_files => ['libevent-always-execute-this-but-supress-warning'],
:script => sprintf(script, "libevent")
},
{
:name => 'Build Tor',
:execution_position => :before_compile,
:output_files => ['tor-always-execute-this-but-supress-warning'],
:script => sprintf(script, "tor")
},
{
:name => 'Link Headers',
:execution_position => :before_compile,
:output_files => ['headers-always-execute-this-but-supress-warning'],
:script => <<-ENDSCRIPT
mkdir -p "${PODS_ROOT}/Headers/Public/Tor"
cd "${PODS_ROOT}/Headers/Public/Tor"
find "${PODS_TARGET_SRCROOT}/Tor/Classes/Core" -name "*.h" -maxdepth 1 -exec ln -s {} \\;
find "${PODS_TARGET_SRCROOT}/Tor/Classes/CTor" -name "*.h" -maxdepth 1 -exec ln -s {} \\;
ENDSCRIPT
}
]
s.preserve_paths = 'Tor/include', 'Tor/libevent', 'Tor/libevent.sh', 'Tor/openssl', 'Tor/openssl.sh', 'Tor/tor', 'Tor/tor.sh', 'Tor/xz', 'Tor/xz.sh'
end
m.subspec 'GeoIP' do |s|
s.dependency 'Tor/CTor'
s.resource_bundles = {
'GeoIP' => ['Tor/tor/src/config/geoip', 'Tor/tor/src/config/geoip6']
}
end
m.default_subspecs = 'CTor'
end