Skip to content

Instantly share code, notes, and snippets.

@dinhvh
Last active December 19, 2015 14:48
Show Gist options
  • Save dinhvh/5971554 to your computer and use it in GitHub Desktop.
Save dinhvh/5971554 to your computer and use it in GitHub Desktop.
podspec for MailCore 2
Pod::Spec.new do |s|
s.name = 'mailcore2'
s.version = '0.1'
s.summary = 'MailCore 2 provide a simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP. The API has been redesigned from ground up.'
s.homepage = 'http://libmailcore.com'
s.license = { :type => 'BSD', :file => 'COPYRIGHT' }
s.author = 'Hoà V. DINH'
s.source = { :git => 'https://github.com/MailCore/mailcore2'}
s.source_files = 'src/core/**/*.h', 'src/core/**/*.c', 'src/core/**/*.cc', 'src/core/**/*.mm', 'src/core/**/*.m',
'src/async/**/*.h', 'src/async/**/*.c', 'src/async/**/*.cc', 'src/async/**/*.mm', 'src/async/**/*.m',
'src/objc/**/*.h', 'src/objc/**/*.c', 'src/objc/**/*.cc', 'src/objc/**/*.mm', 'src/objc/**/*.m',
'src/*.h'
s.preserve_path = 'scripts', 'Externals'
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/mailcore2/Externals/libetpan-ios/include" "${PODS_ROOT}/mailcore2/Externals/icu4c-ios/include" "${PODS_ROOT}/mailcore2/Externals/ctemplate-ios/include" "${PODS_ROOT}/mailcore2/Externals/tidy-html5-ios/include/tidy" /usr/include/libxml2',
'LIBRARY_SEARCH_PATHS' => '"${PODS_ROOT}/mailcore2/Externals/libetpan-ios/lib" "${PODS_ROOT}/mailcore2/Externals/icu4c-ios/lib" "${PODS_ROOT}/mailcore2/Externals/ctemplate-ios/lib" "${PODS_ROOT}/mailcore2/Externals/libsasl-ios/lib" "${PODS_ROOT}/mailcore2/Externals/tidy-html5-ios/lib"',
# Use GNU C++ standard
'CLANG_CXX_LANGUAGE_STANDARD' => 'gnu++0x',
'CLANG_CXX_LIBRARY' => 'libstdc++',
# Required because MailCore include C++ code
'OTHER_LDFLAGS' => '-lctemplate-ios -letpan-ios -licudata -licui18n -licuuc -lxml2 -lsasl2 -liconv -ltidy -lstdc++ -stdlib=libstdc++'
}
s.frameworks = 'CFNetwork', 'Foundation'
def s.pre_install (pod, lib)
# Retrieve all prebuilt dependencies
Dir.chdir(pod.root + 'scripts') do
puts "Retrieve all prebuilt dependencies"
`sh prepare.sh`
raise "[!] Failed pre install hook" unless $?.to_i == 0
end
end
def s.post_install (lib)
# to allow #import <MailCore/MailCore.h>
headers_dir = lib.sandbox_dir.to_s + "/Headers/mailcore2"
target_dir = lib.sandbox_dir.to_s + "/Headers/mailcore2/MailCore"
files = Dir.glob(headers_dir + "/*.h");
Dir.mkdir(target_dir)
FileUtils.ln_s files, target_dir
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment