-
Notifications
You must be signed in to change notification settings - Fork 87
Getting Started
The following is a short outline of how to compile one of the examples (see apps/
). If you have some experience in building software then this, and a few minutes, should be enough to build and run one of the examples. If you get stuck with something then continue reading this document.
Step 1: Clone the LambdaNative repository:
git clone https://github.com/part-cw/lambdanative.git
Step 2: Create (and edit as needed) the files SETUP
and PROFILE
(see the provided *.template files):
cd lambdanative
cp SETUP.template SETUP
cp PROFILE.template PROFILE
Step 3: Configure an example app:
./configure Calculator
==> configured to build Calculator for macosx in normal mode
== using source in /somewhere/lambdanative/apps/Calculator
Step 4: Start the build:
make
The first build will take a while, as the supporting libraries are downloaded and compiled for the first time. The build may also stop once a while and complain about missing dependencies. If so, just install what is missing and resume. The final executable will be generated in the LambdaNative cache directory, and can be installed to the desktop and launched with make install
.
On a suitably configured platform, you can now do:
./configure DemoHelloWorld android
make
./configure DemoHelloWorld ios
make
and binaries for the specified platforms should be built and packaged. On the Mac, the packages will be placed in ~/Library/Caches/lambdanative/packages/
and on linux in ~/.cache/lambdanative/packages/
.
The minimum requirement for developing applications is the presence of a working gcc compiler.
A number of tools are needed to support the framework. Please ensure that these are installed on your system:
-
libfreetype
for rendering vector fonts -
OpenGL
headers and libraries -
libasound
for sound if developing on/for Linux -
libportaudio
from ports if developing on OpenBSD
-
wget
for pulling library code from the net -
automake
(aclocal) andautoconf
for generating build files -
netpbm
andImageMagick
for miscellaneous pixmap manipulation -
ghostscript
andps2eps
for converting vector artwork -
xelatex
(the unicode version oflatex
) for generating string textures (optional, but recommended) -
bc
andpython
(if developing for android) -
cmake
for generating XCode projects (only if developing for iOS) -
tgif
for editing vector artwork (optional) -
fruitstrap
for installing iOS apps (optional)
For example, on a clean Ubuntu install, the following command will install all necessary packages:
sudo apt install git autoconf build-essential libtool libgl1-mesa-dev libfreetype6-dev libasound2-dev netpbm imagemagick ghostscript ps2eps texlive-xetex libxext-dev
If using MacPorts, xelatex is available under the package texlive-xetex, and LambdaNative requires the tipa tex package, available from MacPorts under the package texlive-fonts-recommended.
Cross-compilation requires installation of the appropriate environments:
- Install Java (7 or 8) JDK.
- Download the "Command Line Tools only" from near the bottom of the Android studio page.
- Download latest Android NDK from Android developers NDK. For Mac, choose "Mac App Bundle".
-
Mac: Open the NDK .dmg and and drag the file beginning with "AndroidNDK" to your Applications folder.
Linux: Extract the contents of the NDK to/usr/local/
(so that in it should be aandroid-ndk-[version]/
directory). Then run the following to change the ownership of these directories to your current account[username]
.
$ cd /usr/local
$ sudo chown -R [username] android-ndk-[version]
- Extract the contents of the Command Line tools, which will give a tools directory. Move this to a new directory so that the path to it is
/usr/local/android-sdk-[platform]/cmdline-tools/
(so that in it should be atools/
directory), then run the following to change the ownership of this directory to your current account[username]
.
$ cd /usr/local
$ sudo chown -R [username] android-sdk-[platform]
- Navigate to folder
/usr/local/android-sdk-[platform]/cmdline-tools/tools/bin
. - Run
./sdkmanager --list
to see all Android packages available for install. Install the following:
./sdkmanager "platform-tools"
./sdkmanager "build-tools;28.0.2"
./sdkmanager "extras;android;m2repository"
- The API for which you wish to develop; minimum supported API is API 21 (Android 5.0), as it is the first one to support arm64. Example:
./sdkmanager "platforms;android-21"
- Optionally, if you do not have a physical Android device, run
./avdmanager
to setup an Android virtual device with your desired API. - In the
SETUP
file, setANDROIDAPI
to the API version you have installed. - Edit
PROFILE
and in particular the fieldsSYS_PROFILE
,SYS_ORGTLD
,SYS_ORGSLD
, andSYS_ANDROIDPW
. - If you have an existing
android.keystore
file matching the values above, copy it into the same directory asPROFILE
, otherwise one will be generated for you. - Install additional system requirements as they are asked for.
Linux: The commandsudo apt install python ant clang ncurses5-compat-libs
should install several necessary packages that may be missing. -
macOS Version 10.14 (Mojave) and higher: When trying to
make
an app, you may get a dialog box that says a given tool (eg. clang) cannot be open because the developer cannot be verified. If there is an "Open" button, press it. Otherwise press "Cancel" and then open your System Preferences and then Security & Privacy. There should be a message about the same tool. Press the Allow Anyway button. Thenmake
again. This time the "Open" button should appear in the dialog box. Keep the Security & Privacy window open as you may have to repeat this process many times (once per tool) over many attempts to build for Android.
- Install Xcode 9 or higher and the corresponding command line tools, found under More Downloads for Apple Developers.
- Follow the standard online procedures to create an iOS Development Certificate, and, optionally, an iOS Distribution Certificate, and register your device(s) for development.
- Use Xcode to create and sync a Provisioning Profile onto your device(s). The Xcode build chain will not work properly if you do this step outside of Xcode.
- Load the Keychain Access app on your Mac, search for "iPhone", then copy the full text of the title of
iPhone Developer: XXX
andiPhone Distribution: YYY
into thePROFILE
file in the appropriate spots. - In the
SETUP
file, setIOSVERSION
to 6.0 or higher. (Xcode 10 requires IOSVERSION >7)
- Install the BlackBerry Native SDK.
- Register as a BlackBerry developer and generate a BlackBerry ID token.
- Use the SDK Wizard to generate certificates and setup a device for development; generating a debug token and installing it on the device.
- Update SETUP and PROFILE with the relevant passwords and paths.
Install a linux cross-compiler under /usr/local
to create linux binaries.
Install a windows cross-compiler under /usr/local
to create windows binaries.
For Ubuntu, install mingw: $ sudo apt-get install mingw-w64
For macOS CrossGCC works quite well. On newer versions using homebrew brew install mingw-w64
and 'WIN32SDK=/usr/local/Cellar/mingw-w64/7.0.0_2/toolchain-i686' in SETUP also works.
Install the OpenWrt SDK for your target embedded platform and the system tools needed by the SDK. Note that only stand-alone (non-gui) applications can be built with OpenWrt. The OpenWrt SDK toolchains contain 32bit applications, so support for 32bit binaries are required on the host.
If you are developing on a windows machine (not recommended) you have two options: MinGW and the MSYS development environment, or the Cygwin development environment.
Cygwin caution: Please note that the PATH
environment can cause weird behaviour
of the Cygwin system. This is especially true if a MinGW installation is present on
the system. The best option to ensure that the environment is sane, is
to limit PATH
to cygwin directories only by editing /etc/profile
.
-
- accelerometer
- alist
- audio
- audioaux
- base64
- btle-scan
- camera
- cdb
- cgi
- config
- csv
- curl
- digest
- dmtx
- download
- eventloop
- fcgi
- fft
- generalized-arrays
- gps
- graph
- gyro
- hidapi
- hpdf
- html
- httpsclient
- hybridapp
- json
- lmdb
- ln_core
- ln_glcore
- ln_glgui
- ln_store
- localization
- localization_gui
- localnotification
- magnetometer
- mdns
- mqtt
- mqtt-store
- multitouch
- oauth
- orientation
- p256ecdsa
- png
- portaudio
- pregexp
- pressure
- prime
- pushnotification
- redcap
- rsa
- rtaudio
- rupi
- rotation
- sanestring
- scheduler
- serial
- sets
- settings
- simplexnoise
- sqlite
- ssax
- syntax-case
- timestamp
- ttf
- uiform
- url
- uuid
- vibrate
- videoplayer
- watchdog
- website
- xml
- zip