OLMKit.podspec 2.2 KB
Newer Older
manuroe's avatar
manuroe committed
1
2
3
Pod::Spec.new do |s|

  # The libolm version
Hubert Chathi's avatar
Hubert Chathi committed
4
  MAJOR = 3
Hubert Chathi's avatar
Hubert Chathi committed
5
  MINOR = 1
Hubert Chathi's avatar
Hubert Chathi committed
6
  PATCH = 5
manuroe's avatar
manuroe committed
7
8
9
10
11
12
13
14
15

  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

16
  s.homepage     = "https://gitlab.matrix.org/matrix-org/olm"
manuroe's avatar
manuroe committed
17
18
19

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

20
  s.authors            = { "Chris Ballinger" => "chrisballinger@gmail.com",
manuroe's avatar
manuroe committed
21
22
                           "matrix.org" => "support@matrix.org" }

manuroe's avatar
manuroe committed
23
  s.ios.deployment_target = "6.0"
24
  s.osx.deployment_target = "10.9"
manuroe's avatar
manuroe committed
25
26
27
28

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

29
  s.source       = {
30
    :git => "https://gitlab.matrix.org/matrix-org/olm.git",
31
    :tag => s.version.to_s
manuroe's avatar
manuroe committed
32
  }
33

34
  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"
35
  s.private_header_files = "xcode/OLMKit/*_Private.h"
36

37
38
  # Those files (including .c) are included by ed25519.c. We do not want to compile them twice
  s.preserve_paths = "lib/ed25519/**/*.{h,c}"
39

manuroe's avatar
manuroe committed
40
  s.library = "c++"
41
42


manuroe's avatar
manuroe committed
43
  # Use the same compiler options for C and C++ as olm/Makefile
44

manuroe's avatar
manuroe committed
45
  s.compiler_flags = "-g -O3 -DOLMLIB_VERSION_MAJOR=#{MAJOR} -DOLMLIB_VERSION_MINOR=#{MINOR} -DOLMLIB_VERSION_PATCH=#{PATCH}"
46
47
48

  # For headers search paths, manage first the normal installation. Then, use paths used
  # when the pod is local
49
  s.xcconfig = {
50
    '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
51
  }
52

manuroe's avatar
manuroe committed
53
  s.subspec 'olmc' do |olmc|
54
    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"
manuroe's avatar
manuroe committed
55
56
    olmc.compiler_flags = ' -std=c99 -fPIC'
  end
57

manuroe's avatar
manuroe committed
58
59
60
61
  s.subspec 'olmcpp' do |olmcpp|
    olmcpp.source_files   = "src/*.{cpp}"
    olmcpp.compiler_flags = ' -std=c++11 -fPIC'
  end
62

manuroe's avatar
manuroe committed
63
end