#!/bin/sh

# install_glc.sh
# 2012-04-19
# by Gernot WALZL

# based on
# https://github.com/nullkey/glc/wiki/Install

# glc is an ALSA & OpenGL capture tool for Linux.
# It consists of a generic video capture, playback and processing library and
# a set of tools built around that library. glc should be able to capture any
# application that uses ALSA for sound and OpenGL for drawing.

# TODO: glc-play crashes under 64 bit
# https://github.com/nullkey/glc/issues/20
# using aoss or gdb is a temporary fix

# Using FFMPEG to encode glc's captured stream
# https://github.com/nullkey/glc/wiki/Encode
# glc-play test.glc -o - -a 1 | ffmpeg -i - -sameq -y audio.mp4
# glc-play test.glc -o - -y 1 | ffmpeg -i - -sameq -y video.mp4
# ffmpeg -i audio.mp4 -i video.mp4 -sameq test2.mp4

set -e

mkdir glc
cd glc

wget https://github.com/nullkey/glc/raw/master/scripts/glc-build.sh
wget http://pastebin.com/raw.php?i=XysdYfc8 -O diff-glc-build
patch -p1 glc-build.sh < diff-glc-build
chmod a+x glc-build.sh
yes "" | ./glc-build.sh

upgradepkg --reinstall --install-new /tmp/glc-git-0.5.8-*-1_AC.tgz