macos work

This commit is contained in:
John Smith
2022-01-30 17:47:46 -05:00
parent d3bdd4adc2
commit ccfde9977f
7 changed files with 50 additions and 14 deletions

1
veilid-flutter/macos/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
lib

View File

@@ -7,11 +7,11 @@ Pod::Spec.new do |s|
s.version = '0.0.1'
s.summary = 'Veilid Network'
s.description = <<-DESC
Veilid Network
Veilid Network Plugin
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.homepage = 'http://veilid.com'
s.license = 'LGPL-2.0-or-later OR MPL-2.0 OR (MIT AND BSD-3-Clause)'
s.author = { 'John Smith' => 'jsmith@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'FlutterMacOS'
@@ -20,6 +20,26 @@ Veilid Network
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.0'
s.script_phase = { :name => 'Cargo Build', :script => '../rust/macos_build.sh', :execution_position => :before_compile }
s.script_phase = {
:name => 'Cargo Build',
:script => File.join(File.dirname(__dir__), 'rust', 'macos_build.sh'),
:execution_position => :before_compile,
:output_files => [ File.join(File.dirname(__dir__), 'lib', 'libveilid_flutter.dylib') ]
}
# s.prepare_command = <<-CMD
# mkdir -p lib/Release/
# cp /dev/null lib/Release/libveilid_flutter.dylib
# CMD
# require 'json'
# require 'pathname'
# rust_dylib_absolute = File.join(File.dirname(JSON.parse(`cargo locate-project`)['root']), 'target', 'x86_64-apple-darwin', 'release', 'libveilid_flutter.dylib')
# rust_dylib_relative = Pathname.new(rust_dylib_absolute).relative_path_from(Pathname.new(Dir.pwd)).to_s
# require 'pp'
# print 'Rust dylib: '
# pp rust_dylib_relative
# s.vendored_libraries = 'lib/Release/libveilid_flutter.dylib'
# s.libraries = [ 'veilid_flutter' ]
end