Compilation guide (Ubuntu 16.04)

Added by Pirm Okas almost 4 years ago

Guide to building Native Client version of Movian media player

Since Google is killing Chrome Apps early next year, not only Chrome Web Store will stop offering Apps for all platforms except of Chrome OS, Google will also prevent Chrome from launching already installed apps. That means those who use Google Apps should prepare for that in advance and backup up their Google Chrome (or any of the fork) installs, as well as Apps they use.

This guide will show just that. That is, making an offline installation package for Movian's Chrome version. Thus allowing to install Movian without a necessity for accessing Web Store.

In this example, host OS will be Windows 7 (where Movian will be used) and our objective is to build Movian to be run on Google Chrome or its many forks. So let's say what we have is a regular OpenVZ VPS running latest Ubuntu 16.04 and we will SSH to connect and build the App right on the remote server.

$ uname -r

$ cat /etc/*release | grep DESCRIPTION

Let's begin. Here are the required steps to build Google Chrome App version of Movian. In other words, a Native Client module. Or to be more exact, a Portable Native Client which means it is fully OS and CPU independent.

1) Installing additional dependencies

sudo apt-get install git nano mc moreutils libfreetype6-dev libfontconfig1-dev libxext-dev libgl1-mesa-dev libasound2-dev libasound2-dev libgtk2.0-dev libxss-dev libxxf86vm-dev libxv-dev libvdpau-dev yasm libpulse-dev libssl-dev curl libwebkitgtk-dev libsqlite3-dev

2) Getting actual source files, including required submodules with their referenced commits

cd ~
git clone movian_sources
cd movian_sources
git submodule update --init ext/gumbo-parser
git submodule update --init ext/libav
git submodule update --init ext/rtmpdump
git submodule update --init ext/vmir

3) Downloading Google Native Client SDK. You can either use official SDK update script (naclsdk) or simply download full archive directly.

cd ~
wget -O sdk-v49.tar.bz2
tar xvfj sdk-v49.tar.bz2

So now we have two main directories: "movian_sources" and "pepper_49". However, before compiling it is necessary to edit certain Movian Native Client source file.

4) Accomodating Movian source for recent Pepper API changes

cd ~
tac movian_sources/src/arch/nacl/nacl_video.c | sed '0,/PP_BlockUntilComplete/ s//0, PP_BlockUntilComplete/' | tac | sponge movian_sources/src/arch/nacl/nacl_video.c

5) Configuring the build environment and setting custom version just for fun

cd ~/movian_sources
./configure.nacl --pepper=`cd .. && pwd`/pepper_49 --version=999-custom

6) Finally all is left to do is to compile everything


Sit back and relax. It takes roughly 15 minute for me. Longest part of it obviously consists of building libav and also linking the final Portable Native Client .pexe module.

7) Final touches and moving whole Portable Native Client package we have just built up to the homedir

cd ~
sed 's/"version": ".*"/"version": "999"/'  movian_sources/build.nacl/stage/manifest.json
mkdir Movian_for_Chrome
mv  movian_sources/build.nacl/stage/* Movian_for_Chrome/

8) Let's see what we've got... Structure of the App

$ ls -lh Movian_for_Chrome/

total 14M
-rw-rw-r-- 1 user user  828 Jun  1 08:34 app.css
-rw-rw-r-- 1 user user 4.3K Jun  1 08:34 app.js
-rw-rw-r-- 1 user user  213 Jun  1 08:34 app.nmf
-rw-rw-r-- 1 user user  14M Jun  1 08:48 app.pexe
-rw-rw-r-- 1 user user  171 Jun  1 08:34 background.js
-rw-rw-r-- 1 user user  897 Jun  1 08:34 index.html
-rw-rw-r-- 1 user user  874 Jun  1 08:34 manifest.json
-rw-rw-r-- 1 user user  11K Jun  1 08:34 st128.png
-rw-rw-r-- 1 user user 1.6K Jun  1 08:34 st16.png

9) Creating tar archive for easy distribution

tar cvf Movian_for_Chrome.tar Movian_for_Chrome

10) Here are some deployment screenshots down below


It's installed!

Seems to be running

And it actually works

Replies (1)

RE: Compilation guide (Ubuntu 16.04) - Added by Rob Koni over 3 years ago

Pirm Okas wrote:

Guide to building Native Client version of Movian media player

Many thanks for this guide!