Merge pull request #86 from lbryio/doc-standardisation

standardised README.md. Created BUILD.md for full build instructions.
This commit is contained in:
Jeremy Kauffman 2018-04-30 15:12:32 -04:00 committed by GitHub
commit 3bba3c5689
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 81 additions and 67 deletions

65
BUILD.md Normal file
View file

@ -0,0 +1,65 @@
## 64-bit Ubuntu 16.04 LTS build instructions
While these instructions are for Ubuntu 16.04, the same steps have also been confirmed to work on 14.04 (which is the Travis CI environment), 17.10 and 18.04.
### Install Prerequisites
#### Requirements
* JDK 1.8
* Android SDK
* Android NDK
* Buildozer
* Node.js
* npm
#### Apt Packages
Based on the quickstart instructions at http://buildozer.readthedocs.io/en/latest/installation.html
```
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386
```
Alternatively, the JDK available from http://www.oracle.com/technetwork/java/javase/downloads/index.html can be installed instead of the `openjdk-8-jdk` package.
#### Install Cython
```
sudo pip install --upgrade cython==0.25.2
```
#### Install buildozer
A forked version of `buildozer` needs to be installed in order to copy the React Native UI source files into the corresponding directories.
```
git clone https://github.com/akinwale/buildozer.git
cd buildozer
sudo python2.7 setup.py install
```
#### Create buildozer.spec
Assuming `lbry-android` as the current working folder:
* Copy `buildozer.spec.sample` to `buildozer.spec` in the `lbry-android` folder. Running `buildozer init` instead will create a new `buildozer.spec` file.
* Update `buildozer.spec` settings to match your environment. The basic recommended settings are outlined below.
| Setting | Description |
|:------------------- |:-----------------------------|
| title | application title |
| package.name | package name (eg. browser) |
| package.domain | package domain (eg. io.lbry) |
| source.dir | the location of the application main.py |
| version | application version |
| requirements | the Python module requirements for building the application |
| services | list of Android background services and their corresponding Python entry points |
| android.permissions | Android manifest permissions required by the application. This should be set to `INTERNET` at the very least to enable internet connectivity |
| android.api | Android API version (Should be at least 23 for Gradle build support) |
| android.sdk | Android SDK version (Should be at least 23 for Gradle build support) |
| android.ndk | Android NDK version (13b has been tested to result in a successful build) |
| android.ndk_path | Android NDK path. buildozer will automatically download this if not set |
| android.sdk_path | Android SDK path. buildozer will automatically download this if not set |
| p4a.source_dir | Path to the python-for-android repository folder. Currently set to the included `p4a` folder |
| p4a.local_recipes | Path to a folder containing python_for_android recipes to be used in the build. The included `recipes` folder includes recipes for a successful build |
#### Build and deploy the APK
Run `npm i` in the `lbry-android/app` folder to install the necessary modules required by the React Native user interface.
Run `./build.sh` in `lbry-android` to build the APK. The output can be found in the `bin` subdirectory.
To build and deploy, you can run `./deploy.sh`. This requires a connected device or running Android emulator.

View file

@ -1,75 +1,24 @@
# LBRY Android
[![Build Status](https://travis-ci.org/lbryio/lbry-android.svg?branch=master)](https://travis-ci.org/lbryio/lbry-android)
## 64-bit Ubuntu 16.04 LTS build instructions
The LBRY Android app running the Python lbrynet-daemon as a background service and a UI layer built with React Native. The APK is built using buildozer and the Gradle build tool.
### Install Prerequisites
## Installation
The minimum supported Android version is 5.0 Lollipop. There are currently 2 options for obtaining the APK. The latest APK release can be downloaded from http://build.lbry.io/android/latest.apk. You will need to enable installation from third-party sources on your device in order to install from this source. The other option is to install from the Google Play Store.
#### Requirements
* JDK 1.8
* Android SDK
* Android NDK
* Buildozer
## Usage
The app can be launched by opening **LBRY Browser** from the device's app drawer or a shortcut on the homescreen if that was created upon install.
#### Apt Packages
Based on the quickstart instructions at http://buildozer.readthedocs.io/en/latest/installation.html
```
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386
```
Alternatively, the JDK available from http://www.oracle.com/technetwork/java/javase/downloads/index.html can be installed instead of the `openjdk-8-jdk` package.
## Running from Source
The app can be built from source using `buildozer`. The first thing you will need to do after cloning the repository is create a `buildozer.spec` file. You can base your spec on the provided sample file `buildozer.spec.sample`. Please read [BUILD.md](BUILD.md) for detailed build instructions.
**Additional package for building libgmp**
```
sudo apt-get install m4
```
## Contributing
Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.io/faq/contributing
**Additional package for the pycrypto recipe**
## License
This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
This had to be installed due to an error regarding the `<gnu/stubs.h>` include not found.
```
sudo apt-get install libc6-dev-i386
```
## Security
We take security seriously. Please contact security@lbry.io regarding any security issues. Our PGP key is [here](https://keybase.io/lbry/key.asc) if you need it.
#### Install Cython
```
sudo pip install --upgrade cython==0.25.2
```
#### Install buildozer
```
git clone https://github.com/kivy/buildozer.git
cd buildozer
sudo python2.7 setup.py install
```
#### Create buildozer.spec
Assuming `lbrydroid` as the current working folder:
* Copy `buildozer.spec.sample` to `buildozer.spec` in the `lbry-android` folder. Running `buildozer init` instead will create a new `buildozer.spec` file.
* Update `buildozer.spec` settings to match your environment. Basic recommended settings are outlined below.
| Setting | Description |
|:------------------- |:-----------------------------|
| title | application title |
| package.name | package name (eg. lbrynet) |
| package.domain | package domain (eg. io.lbry) |
| source.dir | the location of the application main.py |
| version | application version |
| requirements | the module requirements for building the application |
| services | list of Android background services and their corresponding Python entry points |
| android.permissions | Android manifest permissions required by the application. This should be set to `INTERNET` at the very least to enable internet connectivity |
| android.api | Android API version (21 and 24 have been tested to result in a successful build) |
| android.sdk | Android SDK version (21 and 24 have been tested to result in a successful build) |
| android.ndk | Android NDK version (13b has been tested to result in a successful build) |
| android.ndk_path | Android NDK path. buildozer will automatically download this if not set |
| android.sdk_path | Android SDK path. buildozer will automatically download this if not set |
| p4a.source_dir | Path to the python-for-android repository folder. Currently set to the included `p4a` folder |
| p4a.local_recipes | Path to a folder containing python_for_android recipes to be used in the build. The included `recipes` folder includes recipes for a successful build |
#### Build and deploy the APK
Run `buildozer android debug` to build a debug APK, or `buildozer android release` to build a release APK.
To deploy and run the APK on a connected Android device, you can run `buildozer android debug deploy run`.
Run `buildozer android clean` to clean the package if you intend to rebuild.
## Contact
The primary contact for this project is [@akinwale](https://github.com/akinwale) (akinwale@lbry.io)