This should be done on a Debian / Ubuntu environment. Personally I set up a VM running Debian.
Now if you choose debian, run:
sudo apt-get install debootstrap qemu-user-static
If ubuntu, run:
sudo apt-get install debootstrap qemu-debootstrap
Now, run:
git clone https://github.com/skgsergio/rpi-buildenv.git
cd rpi-buildenv
./install.sh
./prepare_omxplayer.sh
./build.sh
However at some point after compiling ffmpeg (during omxplayer compilation, which is quite short) the script will fail. Then run:
cd /root/omxplayer-build/omxplayer-src/
./prepare-native-raspbian.sh
# prepare-native told me to run the following command, you may not have to
sudo apt-get update && sudo apt-get install libva1 libidn11-dev libssl1.0-dev
make
make dist
This will finally create ./omxplayer-src/omxplayer.bin
Please note that my raspberry pi 1 running jessie also needed "libswscale.so" to run omxplayer.bin, which I then copied from "/rpi-buildenv/rootfs/root/omxplayer-build/omxplayer-src/ffmpeg_compiled/usr/local/lib/libswscale.so" to "/lib/libswscale.so" on my raspberry. Then I run sudo ldconfig
to updated the libraries.
I really want to thank skgsergio for his script. It would have been way harder without him!