-
Notifications
You must be signed in to change notification settings - Fork 55
/
Tor.podspec
147 lines (121 loc) · 4.9 KB
/
Tor.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
Pod::Spec.new do |m|
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' => '[email protected]',
'Chris Ballinger' => '[email protected]',
'Mike Tigas' => '[email protected]',
'Benjamin Erhart' => '[email protected]', }
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.source_files = 'Tor/Classes/CTor/**/*'
s.pod_target_xcconfig = {
'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.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")
},
]
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 'CTor-NoLZMA' do |s|
s.dependency 'Tor/Core'
s.source_files = 'Tor/Classes/CTor/**/*'
s.pod_target_xcconfig = {
'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"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.script_phases = [
{
: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 => <<-ENDSCRIPT
cd "${PODS_TARGET_SRCROOT}/Tor/tor"
../tor.sh --no-lzma
ENDSCRIPT
},
]
s.preserve_paths = 'Tor/include', 'Tor/libevent', 'Tor/libevent.sh', 'Tor/openssl', 'Tor/openssl.sh', 'Tor/tor', 'Tor/tor.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.subspec 'GeoIP-NoLZMA' do |s|
s.dependency 'Tor/CTor-NoLZMA'
s.resource_bundles = {
'GeoIP' => ['Tor/tor/src/config/geoip', 'Tor/tor/src/config/geoip6']
}
end
m.default_subspecs = 'CTor'
end