OLMKit.podspec 2.13 KB
Newer Older
manuroe's avatar
manuroe committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Pod::Spec.new do |s|

  # The libolm version
  MAJOR = 1
  MINOR = 3
  PATCH = 0

  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

  s.homepage     = "http://matrix.org/git/olm"

  s.license      = { :type => "Apache License, Version 2.0", :file => "LICENSE" }

  s.authors            = { "Chris Ballinger" => "chrisballinger@gmail.com", 
                           "matrix.org" => "support@matrix.org" }

  s.platform     = :ios, "5.0"

  # Expose the Objective-C wrapper API of libolm
  s.public_header_files = "xcode/OLMKit/*.h"

  s.source       = { 
    :git => "https://matrix.org/git/olm.git", 
    :tag => s.version.to_s 
  }
    
33
34
35
36
  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"
  
  # Those files (including .c) are included by ed25519.c. We do not want to compile them twice
  s.preserve_paths = "lib/ed25519/**/*.{h,c}"
manuroe's avatar
manuroe committed
37
38
39
40
41
42
43
  
  s.library = "c++"
  
  
  # Use the same compiler options for C and C++ as olm/Makefile
  
  s.compiler_flags = "-g -O3 -DOLMLIB_VERSION_MAJOR=#{MAJOR} -DOLMLIB_VERSION_MINOR=#{MINOR} -DOLMLIB_VERSION_PATCH=#{PATCH}"
44
45
46

  # For headers search paths, manage first the normal installation. Then, use paths used
  # when the pod is local
manuroe's avatar
manuroe committed
47
  s.xcconfig = { 
48
    'USER_HEADER_SEARCH_PATHS' =>"${PODS_ROOT}/OLMKit/include ${PODS_ROOT}/OLMKit/lib #{File.join(File.dirname(__FILE__), 'include')} #{File.join(File.dirname(__FILE__), 'lib')}"
manuroe's avatar
manuroe committed
49
50
51
  }
  
  s.subspec 'olmc' do |olmc|
52
    olmc.source_files   = "src/*.{c}", "lib/curve25519-donna.h", "lib/ed25519/**/*.{h,c}", "lib/crypto-algorithms/sha256.{h,c}", "lib/crypto-algorithms/aes.{h,c}",  "lib/curve25519-donna/curve25519-donna.c"
manuroe's avatar
manuroe committed
53
54
55
56
57
58
59
60
61
    olmc.compiler_flags = ' -std=c99 -fPIC'
  end
  
  s.subspec 'olmcpp' do |olmcpp|
    olmcpp.source_files   = "src/*.{cpp}"
    olmcpp.compiler_flags = ' -std=c++11 -fPIC'
  end
  
end