@@ -11,26 +11,89 @@ let package = Package(
1111 . macOS( . v10_14)
1212 ] ,
1313 products: [
14+ . library(
15+ name: " AltSign " ,
16+ targets: [ " AltSign " ]
17+ ) ,
18+
19+ . library(
20+ name: " AltSign-Static " ,
21+ type: . static,
22+ targets: [ " AltSign " ]
23+ ) ,
24+
1425 . library(
1526 name: " AltSign-Dynamic " ,
1627 type: . dynamic,
17- targets: [ " AltSign " , " CAltSign " , " CoreCrypto " , " CCoreCrypto " , " ldid " , " ldid-core " , " OpenSSL " ]
18- ) ,
19- . library(
20- name: " AltSign-Static " ,
21- targets: [ " AltSign " , " CAltSign " , " CoreCrypto " , " CCoreCrypto " , " ldid " , " ldid-core " ]
28+ targets: [ " AltSign " ]
2229 )
2330 ] ,
24- dependencies: [ ] ,
31+ dependencies: [
32+ . package ( url: " https://github.com/krzyzanowskim/OpenSSL.git " , . upToNextMinor( from: " 1.1.180 " ) )
33+ ] ,
2534 targets: [
26- . binaryTarget(
27- name: " OpenSSL " ,
28- path: " Dependencies/OpenSSL/Frameworks/OpenSSL.xcframework "
29- ) ,
35+ // MARK: - AltSign
36+
37+ . target(
38+ name: " AltSign " ,
39+ dependencies: [
40+ " CAltSign "
41+ ] ,
42+ cSettings: [
43+ . headerSearchPath( " ../minizip/include " ) ,
44+ . define( " CORECRYPTO_DONOT_USE_TRANSPARENT_UNION=1 " )
45+ ]
46+ ) ,
47+
48+ . target(
49+ name: " CAltSign " ,
50+ dependencies: [
51+ " CoreCrypto " ,
52+ " ldid " ,
53+ " minizip " ,
54+ ] ,
55+ publicHeadersPath: " include " ,
56+ cSettings: [
57+ . headerSearchPath( " include/ " ) ,
58+ . headerSearchPath( " include/AltSign " ) ,
59+ . headerSearchPath( " Capabilities " ) ,
60+ . headerSearchPath( " ../ldid " ) ,
61+ . headerSearchPath( " ../ldid/include " ) ,
62+ . headerSearchPath( " ../minizip/include " ) ,
63+ . headerSearchPath( " ../ldid/libplist/include " ) ,
64+ . headerSearchPath( " ../ldid " ) ,
65+ . define( " unix " , to: " 1 " ) ,
66+ . unsafeFlags( [
67+ " -w "
68+ ] )
69+ ] ,
70+ cxxSettings: [
71+ . headerSearchPath( " include/ " ) ,
72+ . headerSearchPath( " include/AltSign " ) ,
73+ . headerSearchPath( " Capabilities " ) ,
74+ . headerSearchPath( " ../ldid " ) ,
75+ . headerSearchPath( " ../ldid/include " ) ,
76+ . headerSearchPath( " ../minizip/include " ) ,
77+ . headerSearchPath( " ../ldid/libplist/include " ) ,
78+ . headerSearchPath( " ../ldid " ) ,
79+ . define( " unix " , to: " 1 " ) ,
80+ . unsafeFlags( [
81+ " -w "
82+ ] )
83+ ] ,
84+ linkerSettings: [
85+ . linkedFramework( " UIKit " , . when( platforms: [ . iOS] ) ) ,
86+ . linkedFramework( " Security " )
87+ ]
88+ ) ,
89+
90+ // MARK: - ldid
3091
3192 . target(
3293 name: " ldid-core " ,
33- path: " Dependencies/ldid " ,
94+ dependencies: [
95+ " OpenSSL "
96+ ] ,
3497 exclude: [
3598 " ldid.hpp " ,
3699 " ldid.cpp " ,
@@ -70,105 +133,75 @@ let package = Package(
70133 " lookup2.c " ,
71134 " libplist/src " ,
72135 " libplist/libcnary " ,
73- " libplist/libcnary/src "
74136 ] ,
75137 publicHeadersPath: " " ,
76138 cSettings: [
77139 . headerSearchPath( " libplist/include " ) ,
78140 . headerSearchPath( " libplist/src " ) ,
79141 . headerSearchPath( " libplist/libcnary/include " ) ,
80- . headerSearchPath( " ../OpenSSL/ios/include " )
142+ . unsafeFlags( [
143+ " -w "
144+ ] )
81145 ]
82146 ) ,
147+
83148 . target(
84149 name: " ldid " ,
85150 dependencies: [ " ldid-core " ] ,
86- path: " AltSign/ldid " ,
87- exclude: [
88- " alt_ldid.hpp "
89- ] ,
90151 sources: [
91152 " alt_ldid.cpp "
92153 ] ,
93- publicHeadersPath: " " ,
154+ publicHeadersPath: " include " ,
94155 cSettings: [
95- . headerSearchPath( " ../../Dependencies/ldid " ) ,
96- . headerSearchPath( " ../../Dependencies/ldid/libplist/include " ) ,
97- . headerSearchPath( " ../../Dependencies/ldid/libplist/src " ) ,
98- . headerSearchPath( " ../../Dependencies/ldid/libplist/libcnary/include " ) ,
99- . headerSearchPath( " ../../Dependencies/OpenSSL/ios/include " )
156+ . headerSearchPath( " ../ldid-core " ) ,
157+ . headerSearchPath( " ../ldid-core/libplist/include " ) ,
158+ . headerSearchPath( " ../ldid-core//libplist/src " ) ,
159+ . headerSearchPath( " ../ldid-core//libplist/libcnary/include " ) ,
160+ . unsafeFlags( [
161+ " -w "
162+ ] )
100163 ]
101164 ) ,
102165
166+ // MARK: - CoreCrypto
167+
103168 . target(
104169 name: " CCoreCrypto " ,
105- path: " Dependencies/corecrypto " ,
106- // exclude: [
107- // "Sources/CoreCryptoMacros.swift"
108- // ],
170+ exclude: [
171+ " Sources/CoreCryptoMacros.swift "
172+ ] ,
109173 cSettings: [
110174 . headerSearchPath( " include/corecrypto " ) ,
111175 . define( " CORECRYPTO_DONOT_USE_TRANSPARENT_UNION=1 " )
112176 ]
113177 ) ,
114- // .target(
115- // name: "CoreCrypto",
116- // dependencies: ["CCoreCrypto"],
117- // path: "Dependencies/corecrypto/Sources",
118- // exclude: [
119- // "ccsrp.m"
120- // ],
121- // sources: [
122- // "CoreCryptoMacros.swift"
123- // ],
124- // cSettings: [
125- // .define("CORECRYPTO_DONOT_USE_TRANSPARENT_UNION=1")
126- // ]
127- // ),
128178
129- . target(
130- name: " CAltSign " ,
131- dependencies: [ " CoreCrypto " , " ldid " ] ,
132- path: " " ,
133- exclude: [
134- " AltSign/ldid/alt_ldid.cpp " ,
135- " AltSign/ldid/alt_ldid.hpp " ,
136- " AltSign/Sources " ,
137- " AltSign/include/module.modulemap " ,
138- " Dependencies/corecrypto " ,
139- " Dependencies/ldid " ,
140- " Dependencies/OpenSSL " ,
141- " Dependencies/minizip/iowin32.c " ,
142- " Dependencies/minizip/Makefile " ,
143- " Dependencies/minizip/minizip.c " ,
144- " Dependencies/minizip/miniunz.c " ,
145- " Dependencies/minizip/ChangeLogUnzip "
146- ] ,
147- publicHeadersPath: " AltSign/include " ,
148- cSettings: [
149- . headerSearchPath( " AltSign/** " ) ,
150- . headerSearchPath( " AltSign/ldid " ) ,
151- . headerSearchPath( " Dependencies/minizip " ) ,
152- . headerSearchPath( " AltSign/Capabilities " ) ,
153- . headerSearchPath( " Dependencies/OpenSSL/ios/include " ) ,
154- . headerSearchPath( " Dependencies/ldid/libplist/include " ) ,
155- . headerSearchPath( " Dependencies/ldid " ) ,
156- . define( " unix=1 " )
157- ] ,
158- linkerSettings: [
159- . linkedFramework( " UIKit " , . when( platforms: [ . iOS] ) ) ,
160- . linkedFramework( " Security " )
161- ]
162- ) ,
163- . target(
164- name: " AltSign " ,
165- dependencies: [ " CAltSign " ] ,
166- path: " AltSign/Sources " ,
167- cSettings: [
168- . headerSearchPath( " Dependencies/minizip " ) ,
169- . define( " CORECRYPTO_DONOT_USE_TRANSPARENT_UNION=1 " )
170- ]
171- )
179+ . target(
180+ name: " CoreCrypto " ,
181+ dependencies: [ " CCoreCrypto " ] ,
182+ exclude: [
183+ " Sources/ccsrp.m "
184+ ] ,
185+ cSettings: [
186+ . define( " CORECRYPTO_DONOT_USE_TRANSPARENT_UNION=1 " )
187+ ]
188+ ) ,
189+
190+ // MARK: - minizip
191+ . target(
192+ name: " minizip " ,
193+ sources: [
194+ " minizip/zip.c " ,
195+ " minizip/unzip.c " ,
196+ " minizip/ioapi.c "
197+ ] ,
198+ publicHeadersPath: " include " ,
199+ cSettings: [
200+ . unsafeFlags( [
201+ " -w "
202+ ] )
203+ ]
204+ )
172205 ] ,
173206
174207 cLanguageStandard: CLanguageStandard . gnu11,
0 commit comments