2016-09-27 11:57:29 +02:00
|
|
|
Pod::Spec.new do |s|
|
|
|
|
|
|
|
|
# The libolm version
|
2018-10-24 15:32:21 +02:00
|
|
|
MAJOR = 3
|
2020-10-06 21:08:10 +02:00
|
|
|
MINOR = 2
|
2021-05-24 16:29:24 +02:00
|
|
|
PATCH = 3
|
2016-09-27 11:57:29 +02:00
|
|
|
|
|
|
|
s.name = "OLMKit"
|
|
|
|
s.version = "#{MAJOR}.#{MINOR}.#{PATCH}"
|
|
|
|
s.summary = "An Objective-C wrapper of olm (http://matrix.org/git/olm)"
|
|
|
|
|
|
|
|
s.description = <<-DESC
|
|
|
|
olm is an implementation of the Double Ratchet cryptographic ratchet in C++
|
|
|
|
DESC
|
|
|
|
|
2019-04-19 11:59:22 +02:00
|
|
|
s.homepage = "https://gitlab.matrix.org/matrix-org/olm"
|
2016-09-27 11:57:29 +02:00
|
|
|
|
|
|
|
s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }
|
|
|
|
|
2017-01-14 21:57:46 +01:00
|
|
|
s.authors = { "Chris Ballinger" => "chrisballinger@gmail.com",
|
2016-09-27 11:57:29 +02:00
|
|
|
"matrix.org" => "support@matrix.org" }
|
|
|
|
|
2018-06-25 17:57:51 +02:00
|
|
|
s.ios.deployment_target = "6.0"
|
2017-01-14 21:57:46 +01:00
|
|
|
s.osx.deployment_target = "10.9"
|
2016-09-27 11:57:29 +02:00
|
|
|
|
|
|
|
# Expose the Objective-C wrapper API of libolm
|
|
|
|
s.public_header_files = "xcode/OLMKit/*.h"
|
|
|
|
|
2017-01-14 21:57:46 +01:00
|
|
|
s.source = {
|
2019-04-19 11:59:22 +02:00
|
|
|
:git => "https://gitlab.matrix.org/matrix-org/olm.git",
|
2017-01-14 21:57:46 +01:00
|
|
|
:tag => s.version.to_s
|
2016-09-27 11:57:29 +02:00
|
|
|
}
|
2017-01-14 21:57:46 +01:00
|
|
|
|
2016-11-04 11:01:09 +01:00
|
|
|
s.source_files = "xcode/OLMKit/*.{h,m}", "include/**/*.{h,hh}", "src/*.{c,cpp}", "lib/crypto-algorithms/sha256.c", "lib/crypto-algorithms/aes.c", "lib/curve25519-donna/curve25519-donna.c"
|
2017-01-18 03:27:10 +01:00
|
|
|
s.private_header_files = "xcode/OLMKit/*_Private.h"
|
2017-01-14 21:57:46 +01:00
|
|
|
|
2016-11-04 11:01:09 +01:00
|
|
|
# Those files (including .c) are included by ed25519.c. We do not want to compile them twice
|
|
|
|
s.preserve_paths = "lib/ed25519/**/*.{h,c}"
|
2017-01-14 21:57:46 +01:00
|
|
|
|
2016-09-27 11:57:29 +02:00
|
|
|
s.library = "c++"
|
2017-01-14 21:57:46 +01:00
|
|
|
|
|
|
|
|
2016-09-27 11:57:29 +02:00
|
|
|
# Use the same compiler options for C and C++ as olm/Makefile
|
2017-01-14 21:57:46 +01:00
|
|
|
|
2016-09-27 11:57:29 +02:00
|
|
|
s.compiler_flags = "-g -O3 -DOLMLIB_VERSION_MAJOR=#{MAJOR} -DOLMLIB_VERSION_MINOR=#{MINOR} -DOLMLIB_VERSION_PATCH=#{PATCH}"
|
2016-11-03 17:33:31 +01:00
|
|
|
|
|
|
|
# For headers search paths, manage first the normal installation. Then, use paths used
|
|
|
|
# when the pod is local
|
2017-01-14 21:57:46 +01:00
|
|
|
s.xcconfig = {
|
2016-11-03 17:33:31 +01:00
|
|
|
'USER_HEADER_SEARCH_PATHS' =>"${PODS_ROOT}/OLMKit/include ${PODS_ROOT}/OLMKit/lib #{File.join(File.dirname(__FILE__), 'include')} #{File.join(File.dirname(__FILE__), 'lib')}"
|
2016-09-27 11:57:29 +02:00
|
|
|
}
|
2017-01-14 21:57:46 +01:00
|
|
|
|
2016-09-27 11:57:29 +02:00
|
|
|
s.subspec 'olmc' do |olmc|
|
2016-11-04 11:07:36 +01:00
|
|
|
olmc.source_files = "src/*.{c}", "lib/curve25519-donna.h", "lib/crypto-algorithms/sha256.{h,c}", "lib/crypto-algorithms/aes.{h,c}", "lib/curve25519-donna/curve25519-donna.c"
|
2016-09-27 11:57:29 +02:00
|
|
|
olmc.compiler_flags = ' -std=c99 -fPIC'
|
|
|
|
end
|
2017-01-14 21:57:46 +01:00
|
|
|
|
2016-09-27 11:57:29 +02:00
|
|
|
s.subspec 'olmcpp' do |olmcpp|
|
|
|
|
olmcpp.source_files = "src/*.{cpp}"
|
|
|
|
olmcpp.compiler_flags = ' -std=c++11 -fPIC'
|
|
|
|
end
|
2017-01-14 21:57:46 +01:00
|
|
|
|
2016-09-27 11:57:29 +02:00
|
|
|
end
|