KaiOS: Difference between revisions

Jump to navigation Jump to search
2,549 bytes added ,  28 October 2020
Added instructions on how to add stuff to the sysroot
(Updated the mozconfig file to reflect the changes to the build system and sysroot)
(Added instructions on how to add stuff to the sysroot)
Line 110: Line 110:
Run your build using the same mozconfig, the very simple default homescreen will show up:
Run your build using the same mozconfig, the very simple default homescreen will show up:
<pre>env MOZCONFIG=mozconfig-b2g-desktop ./mach run</pre>
<pre>env MOZCONFIG=mozconfig-b2g-desktop ./mach run</pre>
= Development =
== Adding new dependencies to the sysroot ==
The Android-specific dependencies used in the build are taken from a sysroot generated via the [https://searchfox.org/kaios/source/taskcluster/scripts/misc/create-b2g-sysroot.sh create-b2g-sysroot.sh] script. Dependencies are split in multiple lists which include libraries, headers and generated headers. Depending on what dependency you want to add follow the steps below:
=== Adding a new system library (lib<name>.so) ===
* Add the library the full path to the library to the [https://searchfox.org/kaios/source/taskcluster/scripts/misc/create-b2g-sysroot.sh#69-121 list of libraries and shared objects], please keep the list sorted
* Add the library name to the [https://searchfox.org/kaios/rev/66d140e3f973a2257d45c006afd1a30f76844b1e/toolkit/library/moz.build#107-133 <code>OS_LIBS</code>] variable in the appropriate moz.build file. Note that you don't need to specify the '''lib''' prefix nor the '''.so''' extension, just the library name.
=== Adding a new Android shared object (<name>@<version>.so format) ===
* Add the library the full path to the shared object to the [https://searchfox.org/kaios/source/taskcluster/scripts/misc/create-b2g-sysroot.sh#69-121 list of libraries and shared objects], please keep the list sorted
* Add the object name to the [https://searchfox.org/kaios/rev/66d140e3f973a2257d45c006afd1a30f76844b1e/toolkit/library/moz.build#134-158 AOSPSharedObjects template] without the '''.so''' extension
=== Adding a new set of headers ===
* Find the path to the headers you want to include and note their relative path. If your source is including <code>B2G/foo/bar/baz.h</code> via <code>#include <bar/baz.h></code> then the path you will want to add the <code>foo</code> path.
* Add the path you noted above to the appropriate list of headers:
** System includes go [https://searchfox.org/kaios/source/taskcluster/scripts/misc/create-b2g-sysroot.sh#125-164 here]
** Generated AIDL headers go [https://searchfox.org/kaios/source/taskcluster/scripts/misc/create-b2g-sysroot.sh#168-178 here] (you can recognize them by a <code>#define AIDL_...</code> definition. AIDL headers sometimes have the target architecture in their path so make sure you don't hard-code it in the script but use the appropriate variable instead to avoid breaking other targets
** Generated HIDL headers go [https://searchfox.org/kaios/source/taskcluster/scripts/misc/create-b2g-sysroot.sh#182-213 here] (you can recognize them by a <code>#define HIDL_...</code> definition
Confirmed users
429

edits

Navigation menu