mraa: update to version 0.8.0
[contrib/mraa.git] / docs / building.md
index 7ab9ae2..1d57752 100644 (file)
@@ -16,8 +16,10 @@ what you'll need:
 
 To build the documentation you'll also need:
 * [Doxygen](http://www.stack.nl/~dimitri/doxygen/) 1.8.9.1+
+* [Graphviz](http://graphviz.org/) 2+ (For doxygen graph generation)
 * [Sphinx](http://sphinx-doc.org/) 1.1.3+ (For Python docs)
 
+
 ## Basic build steps
 
 ~~~~~~~~~~~~~{.sh}
@@ -60,6 +62,14 @@ Building doc, this will require [SPHINX](http://sphinx-doc.org) &
 [Doxygen](http://doxygen.org):
  -DBUILDDOC=ON
 
+Building with python3 (careful you need to clear cmake cache between python
+version switches!)
+ -DBUILDPYTHON3=ON
+
+Override build architecture (this is useful because on x86 arm code is not
+compiled so use this flag to force the target arch)
+ -DBUILDARCH=arm
+
 ## Dependencies continued
 
 You'll need at least SWIG version 3.0.2 and we recommend 3.0.5 to build the
@@ -105,3 +115,36 @@ cmake -DBUILDDOC=OFF -DBUILDSWIG=OFF ..
 cov-build --dir cov-int make
 tar caf mraa.tar.bz2 cov-int
 ~~~~~~~~~~~~~
+
+## Building Java bindings
+Have JAVA_HOME set to JDK install directory. Most distributions set this from /etc/profile.d/ and have a way of switching between alternatives. We support both OpenJDK and Oracle's JDK. On Arch Linux with openjdk8 you'll have to set this yourself like this:
+~~~~~~~~~~~~~{.sh}
+export JAVA_HOME=/usr/lib/jvm/default/
+~~~~~~~~~~~~~
+Then use the cmake configuration flag:
+ -DBUILDSWIGJAVA=ON
+To compile Example.java
+~~~~~~~~~~~~~{.sh}
+javac -cp $DIR_WHERE_YOU_INSTALLED_MRAA/mraa.jar:. Example.java
+~~~~~~~~~~~~~
+To run, make sure libmraajava.so is in LD_LIBRARY_PATH
+ ~~~~~~~~~~~~~{.sh}
+jave -cp $DIR_WHERE_YOU_INSTALLED_MRAA/mraa.jar:. Example
+~~~~~~~~~~~~~
+
+## Building an IPK/RPM package using cpack
+
+You can get cpack to generate an IPK or RPM package fairly easily if you have
+the correct packaging tools
+
+~~~~~~~~~~~~~{.sh}
+cmake -DIPK=ON -DCMAKE_INSTAL_PREFIX=/usr ..
+make package
+~~~~~~~~~~~~~
+
+To use RPM simply enable the RPM option. You'll need rpmbuild installed on your
+build machine.
+
+~~~~~~~~~~~~~{.sh}
+cmake -DRPM=ON -DCMAKE_INSTAL_PREFIX=/usr ..
+~~~~~~~~~~~~~