Added Building guide

Jorys Paulin
2018-07-30 08:21:55 +02:00
parent 0cc83eaaff
commit 99ca7dfa1e

42
Buidling.md Normal file

@@ -0,0 +1,42 @@
If you wish to build the extension yourself, or you want to add code to it, this guide will help you.
## Get the code
You can get the code in different ways:
- Cloning the repo via git: `git clone https://github.com/moonlight-stream/moonlight-chrome`
- Getting the code as a zip ("Clone or download" > "Download zip" or via the releases tab, see "Source code (zip)")
Once completed, you'll have a directory (here named `moonlight-chrome`) containing the code of the application. Go inside it and install the requirements.
## Requirements
* Git: https://git-scm.com/downloads
* Python 2.7: https://www.python.org/downloads/release/python-2713/
__Make sure they are properly installed__ by starting your console and typing: `git --version` and `python --version`. If no error is printed inside the console, you're good to go!
## Install the Chrome Native App SDK
> This is quoted from [the pepper.js wiki](https://github.com/google/pepper.js/wiki/Getting-Started).
- Install the [NaCl SDK](https://developers.google.com/native-client/sdk/download). Set the `NACL_SDK_ROOT` environment variable to be an *absolute* path that points to the desired `pepper_*` directory inside of the NaCl SDK. For
example, to temporarily set the environment variable:
```shell
set NACL_SDK_ROOT=c:\path\to\nacl_sdk\pepper_* (Windows)
export NACL_SDK_ROOT=/path/to/nacl_sdk/pepper_* (Almost everything else)
```
> Moonlight uses the latest version of Pepper, which [you can get here](https://developer.chrome.com/native-client/sdk/download#installing-the-stable-bundle)
## Compiling the NaCl module
The compile process has been done in **Windows only** for now
- Go to the directory where you downloaded the code: `cd moonlight-chrome` for example
- Open up your console: _Shift+RightClick_ on Windows
- Type in `git submodule update --init --recursive` to init git submodules required for building
- Type in `make.bat`: the console should log some information
- When it's done, you can move over to the final step
## Adding the extension in Chrome
- Go to `chrome://extensions`
- Tick "Developer mode"
- Click "Load unpacked extension"
- Go to the directory where you installed Moonlight (select its name)
- Moonlight should appear in the list
Launch it by clicking "Launch" in the extensions list or via `chrome://apps`. If making changes, don't forget to __reload the extension__ by clicking "Reload" in chrome://extensions and running `make` if you've changed the NaCl module!
Chrome will now remember you that you have an unpacked extension that could lead to security problems. To remove this message, we recommend you **disable the extension** when you're not using it.