Commit 6f113dd7 authored by manuroe's avatar manuroe
Browse files

OLMKit: Make the project build

Make OLMKit CocoaPods expose the obj-c wrapper of libolm
parent 1d06f2a4
......@@ -4,4 +4,25 @@
/docs/olm.html
/olm-*.tgz
/README.html
/tracing/README.html
\ No newline at end of file
/tracing/README.html
# Xcode
build/
DerivedData/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
*.moved-aside
*.xcuserstate
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
Pods/
*.xcworkspace
\ No newline at end of file
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
}
s.source_files = "xcode/OLMKit/*.{h,m}", "include/**/*.{h,hh}", "src/*.{c,cpp}", "lib/ed25519/**/*.{h,c}", "lib/crypto-algorithms/sha256.c", "lib/crypto-algorithms/aes.c", "lib/curve25519-donna/curve25519-donna.c"
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}"
s.xcconfig = {
'USER_HEADER_SEARCH_PATHS' =>"#{File.join(File.dirname(__FILE__), 'include')} #{File.join(File.dirname(__FILE__), 'lib')}"
}
s.subspec 'olmc' do |olmc|
olmc.source_files = "src/*.{c}", "lib/ed25519/**/*.{h,c}", "lib/crypto-algorithms/sha256.c", "lib/crypto-algorithms/aes.c", "lib/curve25519-donna/curve25519-donna.c"
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
......@@ -21,6 +21,7 @@
#include "aes.h"
#include <stdio.h>
#include <string.h>
/****************************** MACROS ******************************/
// The least significant byte of the word is rotated to the end.
......
......@@ -15,6 +15,7 @@
/*************************** HEADER FILES ***************************/
#include <stdlib.h>
#include <memory.h>
#include <string.h>
#include "sha256.h"
/****************************** MACROS ******************************/
......
#
# Be sure to run `pod spec lint olm.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#
Pod::Spec.new do |s|
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# These will help people to find your library, and whilst it
# can feel like a chore to fill in it's definitely to your advantage. The
# summary should be tweet-length, and the description more in depth.
#
s.name = "olm"
s.version = "0.1.0"
s.summary = "olm"
# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
DESC
s.homepage = "http://EXAMPLE/olm"
# s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
# ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Licensing your code is important. See http://choosealicense.com for more info.
# CocoaPods will detect a license file if there is a named LICENSE*
# Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
#
s.license = "MIT (example)"
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Specify the authors of the library, with email addresses. Email addresses
# of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
# accepts just a name if you'd rather not provide an email address.
#
# Specify a social_media_url where others can refer to, for example a twitter
# profile URL.
#
s.author = { "Chris Ballinger" => "chrisballinger@gmail.com" }
# Or just: s.author = "Chris Ballinger"
# s.authors = { "Chris Ballinger" => "chrisballinger@gmail.com" }
# s.social_media_url = "http://twitter.com/Chris Ballinger"
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# If this Pod runs only on iOS or OS X, then specify the platform and
# the deployment target. You can optionally include the target after the platform.
#
# s.platform = :ios
# s.platform = :ios, "5.0"
# When using multiple platforms
# s.ios.deployment_target = "5.0"
# s.osx.deployment_target = "10.7"
# s.watchos.deployment_target = "2.0"
# s.tvos.deployment_target = "9.0"
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Specify the location from where the source should be retrieved.
# Supports git, hg, bzr, svn and HTTP.
#
s.source = { :git => "http://EXAMPLE/olm.git", :tag => "0.0.1" }
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# CocoaPods is smart about how it includes source code. For source files
# giving a folder will include any swift, h, m, mm, c & cpp files.
# For header files it will include any header in the folder.
# Not including the public_header_files will make all headers public.
#
s.source_files = ["include/olm/*.hh","src/*.cpp"]
s.public_header_files = "include/olm/olm.hh"
s.library = "c++"
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(PODS_ROOT)/olm/include $(PODS_ROOT)/olm/lib $(PODS_ROOT)/../../include $(PODS_ROOT)/../../lib' }
end
......@@ -6,10 +6,10 @@
//
//
@import olm;
#include "olm/olm.h"
@interface OLMAccount()
@property (nonatomic) OlmAccount *account;
@end
\ No newline at end of file
@end
......@@ -17,7 +17,7 @@ FOUNDATION_EXPORT const unsigned char OLMKitVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <OLMKit/PublicHeader.h>
#import "OLMAccount.h"
#import "OLMSession.h"
#import "OLMMessage.h"
#import "OLMUtility.h"
\ No newline at end of file
#import <OLMKit/OLMAccount.h>
#import <OLMKit/OLMSession.h>
#import <OLMKit/OLMMessage.h>
#import <OLMKit/OLMUtility.h>
......@@ -10,7 +10,7 @@
#import "OLMUtility.h"
#import "OLMAccount_Private.h"
#import "OLMSession_Private.h"
@import olm;
#include "olm/olm.h"
@implementation OLMSession
......
......@@ -6,11 +6,11 @@
//
//
@import olm;
#include "olm/olm.h"
@interface OLMSession()
@property (nonatomic) OlmSession *session;
@property (nonatomic, strong) OLMAccount *account;
@end
\ No newline at end of file
@end
......@@ -16,8 +16,6 @@
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
......
......@@ -7,7 +7,7 @@
//
#import <XCTest/XCTest.h>
@import OLMKit;
#import <OLMKit/OLMKit.h>
@interface OLMKitTests : XCTestCase
......
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target "OLMKit" do
pod 'OLMKit', :path => '../OLMKit.podspec'
end
pod 'olm', :path => '../olm.podspec'
\ No newline at end of file
target "OLMKitTests" do
pod 'OLMKit', :path => '../OLMKit.podspec'
end
\ No newline at end of file
PODS:
- olm (0.1.0)
- OLMKit (1.3.0):
- OLMKit/olmc (= 1.3.0)
- OLMKit/olmcpp (= 1.3.0)
- OLMKit/olmc (1.3.0)
- OLMKit/olmcpp (1.3.0)
DEPENDENCIES:
- olm (from `../olm.podspec`)
- OLMKit (from `../OLMKit.podspec`)
EXTERNAL SOURCES:
olm:
:path: "../olm.podspec"
OLMKit:
:path: ../OLMKit.podspec
SPEC CHECKSUMS:
olm: ba8c1a7ca04486ec1ad958ec9feef73c0939ae27
OLMKit: 49b73677a77988cc25e51d023f39a8a3e451cb23
COCOAPODS: 0.39.0
PODFILE CHECKSUM: 4e261dae61d833ec5585ced2473023b98909fd35
COCOAPODS: 1.0.1
OLMKit
======
OLMKit exposes an Objective-C wrapper to libolm.
The original work by Chris Ballinger can be found at https://github.com/chrisballinger/OLMKit.
Installation
------------
You can embed OLMKit to your application project with CocoaPods. The pod for
the latest OLMKit release is::
pod 'OLMKit'
Development
-----------
Run `pod install` and open `OLMKit.xcworkspace`.
The project contains only tests files. The libolm and the Objective-C wrapper source files are loaded via the OLMKit CocoaPods pod.
To add a new source file, add it to the file system and run `pod update` to make CocoaPods insert into OLMKit.xcworkspace.
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D976E43D1CB852E000F5C124"
BuildableName = "OLMKit.framework"
BlueprintName = "OLMKit"
ReferencedContainer = "container:olm.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D976E4461CB852E000F5C124"
BuildableName = "OLMKitTests.xctest"
BlueprintName = "OLMKitTests"
ReferencedContainer = "container:olm.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D976E43D1CB852E000F5C124"
BuildableName = "OLMKit.framework"
BlueprintName = "OLMKit"
ReferencedContainer = "container:olm.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D976E43D1CB852E000F5C124"
BuildableName = "OLMKit.framework"
BlueprintName = "OLMKit"
ReferencedContainer = "container:olm.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D976E43D1CB852E000F5C124"
BuildableName = "OLMKit.framework"
BlueprintName = "OLMKit"
ReferencedContainer = "container:olm.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D976E4461CB852E000F5C124"
BuildableName = "OLMKitTests.xctest"
BlueprintName = "OLMKitTests"
ReferencedContainer = "container:olm.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D976E4461CB852E000F5C124"
BuildableName = "OLMKitTests.xctest"
BlueprintName = "OLMKitTests"
ReferencedContainer = "container:olm.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D976E4461CB852E000F5C124"
BuildableName = "OLMKitTests.xctest"
BlueprintName = "OLMKitTests"
ReferencedContainer = "container:olm.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D976E4461CB852E000F5C124"
BuildableName = "OLMKitTests.xctest"
BlueprintName = "OLMKitTests"
ReferencedContainer = "container:olm.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:olm.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment