Skip to content

Commit 0e05c90

Browse files
committed
fix: lipo archs error and arm64e support
1 parent 76ac878 commit 0e05c90

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

cocoapods-packager-next.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
77
spec.name = 'cocoapods-packager-next'
88
spec.version = Pod::Packager::VERSION
99
spec.authors = ['Kyle Fuller', 'Boris Bügling', 'Chenguang Wang']
10-
spec.summary = 'A new version of cocoapods-packager, fix many adaptation issues with the new version of Xcode,
10+
spec.summary = 'An alternative to cocoapods-packager, adapted to the latest Xcode.
1111
CocoaPods plugin which allows you to generate a framework or static library from a podspec.'
1212
spec.homepage = 'https://github.com/wwwcg/cocoapods-packager-next'
1313
spec.license = 'MIT'

lib/cocoapods-packager/builder.rb

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,20 @@ def static_libs_in_sandbox(build_dir = 'build')
277277

278278
def vendored_libraries
279279
if @vendored_libraries
280-
@vendored_libraries
280+
return @vendored_libraries
281281
end
282282
file_accessors = if @exclude_deps
283+
puts "Excluding dependencies"
283284
@file_accessors
284285
else
286+
puts "Including dependencies"
285287
@static_installer.pod_targets.flat_map(&:file_accessors)
286288
end
287289
libs = file_accessors.flat_map(&:vendored_static_frameworks).map { |f| f + f.basename('.*') } || []
288290
libs += file_accessors.flat_map(&:vendored_static_libraries)
289291
@vendored_libraries = libs.compact.map(&:to_s)
292+
puts "Final vendored libraries: #{@vendored_libraries}"
293+
290294
@vendored_libraries
291295
end
292296

@@ -304,10 +308,28 @@ def ios_build_options
304308
end
305309

306310
def ios_architectures
307-
archs = %w(x86_64 i386 arm64 armv7 armv7s)
311+
xcode_version_string = `xcodebuild -version`.strip.split()[1]
312+
xcode_version = Pod::Version.new(xcode_version_string)
313+
UI.puts "current xcode version: #{xcode_version}"
314+
archs = if xcode_version >= Pod::Version.new('14.0')
315+
# i386 & armv7/armv7s has been deprecated in Xcode14
316+
%w(x86_64 arm64 arm64e)
317+
elsif xcode_version < Pod::Version.new('10.0')
318+
%w(x86_64 i386 arm64 armv7 armv7s)
319+
else
320+
%w(x86_64 i386 arm64 arm64e armv7 armv7s)
321+
end
322+
UI.puts "Initial architectures: #{archs}"
323+
308324
vendored_libraries.each do |library|
309-
archs = `lipo -info #{library}`.split & archs
325+
library_archs = `lipo -info #{library}`.split
326+
UI.puts "Architectures for #{library}: #{library_archs}"
327+
328+
archs = library_archs & archs
329+
UI.puts "Intersected architectures: #{archs}"
310330
end
331+
332+
UI.puts "Final architectures: #{archs}"
311333
archs
312334
end
313335

0 commit comments

Comments
 (0)