aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.rst70
-rw-r--r--OLMKit.podspec31
-rw-r--r--README.rst20
-rw-r--r--xcode/OLMKit/OLMKit.h3
4 files changed, 100 insertions, 24 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
new file mode 100644
index 0000000..52c484c
--- /dev/null
+++ b/CONTRIBUTING.rst
@@ -0,0 +1,70 @@
+Contributing code to libolm
+===========================
+
+To contribute code to this library, the preferred way is to clone the git
+repository, create a git patch series (for example via ``git
+format-patch --stdout origin/master``), and send this by email to
+``richard@matrix.org``.
+
+Naturally, you must be willing to license your contributions under the same
+license as the project itself - in this case, Apache Software License v2 (see
+`<LICENSE>`_).
+
+Sign off
+--------
+
+In order to have a concrete record that your contribution is intentional and
+you agree to license it under the same terms as the project's license, we've
+adopted the same lightweight approach that the
+`Linux Kernel <https://www.kernel.org/doc/Documentation/SubmittingPatches>`_,
+`Docker <https://github.com/docker/docker/blob/master/CONTRIBUTING.md>`_,
+and many other projects use: the DCO
+(`Developer Certificate of Origin <http://developercertificate.org/>`_).
+This is a simple declaration that you wrote the contribution or otherwise have
+the right to contribute it to Matrix::
+
+ Developer Certificate of Origin
+ Version 1.1
+
+ Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
+ 660 York Street, Suite 102,
+ San Francisco, CA 94110 USA
+
+ Everyone is permitted to copy and distribute verbatim copies of this
+ license document, but changing it is not allowed.
+
+ Developer's Certificate of Origin 1.1
+
+ By making a contribution to this project, I certify that:
+
+ (a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+ (b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+ (c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+ (d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
+
+If you agree to this for your contribution, then all that's needed is to
+include the line in your commits or covering email::
+
+ Signed-off-by: Your Name <your@email.example.org>
+
+...using your real name; unfortunately pseudonyms and anonymous contributions
+can't be accepted. Git makes this trivial - just use the -s flag when you do
+``git commit``, having first set ``user.name`` and ``user.email`` git configs
+(which you should have done anyway :)
diff --git a/OLMKit.podspec b/OLMKit.podspec
index e21d10f..133e23d 100644
--- a/OLMKit.podspec
+++ b/OLMKit.podspec
@@ -17,45 +17,46 @@ Pod::Spec.new do |s|
s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }
- s.authors = { "Chris Ballinger" => "chrisballinger@gmail.com",
+ s.authors = { "Chris Ballinger" => "chrisballinger@gmail.com",
"matrix.org" => "support@matrix.org" }
- s.platform = :ios, "5.0"
+ s.ios.deployment_target = "5.0"
+ s.osx.deployment_target = "10.9"
# 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 = {
+ :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/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}"
-
+
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}"
# For headers search paths, manage first the normal installation. Then, use paths used
# when the pod is local
- s.xcconfig = {
+ s.xcconfig = {
'USER_HEADER_SEARCH_PATHS' =>"${PODS_ROOT}/OLMKit/include ${PODS_ROOT}/OLMKit/lib #{File.join(File.dirname(__FILE__), 'include')} #{File.join(File.dirname(__FILE__), 'lib')}"
}
-
+
s.subspec 'olmc' do |olmc|
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"
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
diff --git a/README.rst b/README.rst
index 43873ee..bc5e21c 100644
--- a/README.rst
+++ b/README.rst
@@ -5,12 +5,10 @@ An implementation of the Double Ratchet cryptographic ratchet described by
https://github.com/trevp/double_ratchet/wiki, written in C and C++11 and
exposed as a C API.
-The specification of the Olm ratchet can be found in ``docs/olm.rst`` or
-https://matrix.org/docs/spec/olm.html.
+The specification of the Olm ratchet can be found in `<docs/olm.rst>`_.
This library also includes an implementation of the Megolm cryptographic
-ratchet, as specified in ``docs/megolm.rst`` or
-https://matrix.org/docs/spec/megolm.html.
+ratchet, as specified in `<docs/megolm.rst>`_.
Building
--------
@@ -32,12 +30,13 @@ To build the javascript bindings, install emscripten from http://kripken.github.
.. code:: bash
make js
-
+
To build the android project for Android bindings, run:
- .. code:: bash
- cd android
- ./gradlew clean assembleRelease
+.. code:: bash
+
+ cd android
+ ./gradlew clean assembleRelease
To build the Xcode workspace for Objective-C bindings, run:
@@ -60,6 +59,7 @@ It's probably sensible to do the above on a release branch (``release-vx.y.z``
by convention), and merge back to master once the release is complete.
.. code:: bash
+
make clean
# build and test C library
@@ -129,6 +129,10 @@ Olm uses pure C implementations of the cryptographic primitives used by
the ratchet. While this decreases the performance it makes it much easier
to compile the library for different architectures.
+Contributing
+------------
+Please see `<CONTRIBUTING.rst>`_ when making contributions to the library.
+
What's an olm?
--------------
diff --git a/xcode/OLMKit/OLMKit.h b/xcode/OLMKit/OLMKit.h
index 34db111..e23a9f1 100644
--- a/xcode/OLMKit/OLMKit.h
+++ b/xcode/OLMKit/OLMKit.h
@@ -16,7 +16,8 @@
limitations under the License.
*/
-#import <UIKit/UIKit.h>
+#import <Foundation/Foundation.h>
+
//! Project version string for OLMKit, the same as libolm.
NSString *OLMKitVersionString();