updated on Thu Jan 19 00:16:31 UTC 2012
[aur-mirror.git] / glc / PKGBUILD
blobb58107d64c9bfc13f90aacab23d3ba25d46e259b
1 # Maintainer: Austin < doorknob60 at gmail dot com >
2 # Contributor: kumyco <kumyco@kh.nu>
3 pkgname=glc
4 pkgver=0.5.8
5 pkgrel=3
6 pkgdesc="An ALSA & OpenGL capture tool for Linux"
7 arch=("i686" "x86_64")
8 url="https://github.com/nullkey/glc"
9 install=glc.install
10 source=("Copyright"
11   "glc.tar.gz::https://github.com/nullkey/glc/tarball/stable"
12   "elfhacks.tar.gz::https://github.com/nullkey/elfhacks/tarball/stable"
13   "packetstream.tar.gz::https://github.com/nullkey/packetstream/tarball/stable"
14   "glc-support.tar.gz::https://github.com/nullkey/glc-support/tarball/master")
15 license=("CUSTOM")
16 depends=("libpng" "alsa-lib" "libgl")
17 makedepends=("cmake" "mesa")
18 conflicts=("glc-git")
19 if test "$CARCH" == x86_64; then
20         optdepends=('lib32-glc: Support for 32-bit applications such as Wine')
22 md5sums=('d706bd101063967583d3e4f98e0bf14a'
23          'e33b7c221077a5a9db16171c08aa70ea'
24          'fc172d88f30fcfb8acb5eff071fd6287'
25          '89083b4be8aa1bda0c808fefe9c1146a'
26          'cd59270aee6c31bbe40ea6a82805f079')
28 build() {
29         cd $srcdir
30         mv nullkey-glc-ab9c270 glc
31         mv nullkey-elfhacks-2fd0565 elfhacks
32         mv nullkey-packetstream-d9d720b packetstream
33         mv nullkey-glc-support-7f56290 support
34         ln -sf $srcdir/elfhacks $srcdir/glc/elfhacks
35         ln -sf $srcdir/packetstream $srcdir/glc/packetstream
36         ln -sf $srcdir/support $srcdir/glc/support
38         DESTDIR=$pkgdir/usr
39         if [ $CARCH == "x86_64" ]; then
40                 MLIBDIR="lib64"
41                 CFLAGS="$CFLAGS -m64"
42         else
43                 MLIBDIR="lib"
44         fi
45         export CMAKE_INCLUDE_PATH="$srcdir/glc/elfhacks/src:$srcdir/glc/packetstream/src"
46         export CMAKE_LIBRARY_PATH="$srcdir/glc/elfhacks/build/src:$srcdir/glc/packetstream/build/src"
47         
48         mods=("elfhacks" "packetstream" "glc")
49         for mod in ${mods[@]}; do
50                 msg "Building $mod..."
51                 [ -d $mod/build ] || mkdir $mod/build
52                 cd $mod/build
53                 
54                 cmake .. \
55                         -DCMAKE_INSTALL_PREFIX:PATH="${DESTDIR}" \
56                         -DCMAKE_BUILD_TYPE:STRING="Release" \
57                         -DCMAKE_C_FLAGS_RELEASE_RELEASE:STRING="${CFLAGS}" > /dev/null \
58                         -DMLIBDIR="${MLIBDIR}" \
59                         || return 1
60                 make || return 1
61                 cd ../..
62         done
63         
64         
65         for mod in ${mods[@]}; do
66                 msg "Installing $mod to pkgdir..."
67                 cd $srcdir/$mod/build
68                 make install || return 1
69         done
70         
71         install -d -m755 $pkgdir/usr/share/glc/scripts
72         install -m755 $srcdir/glc/scripts/capture.sh $pkgdir/usr/share/glc/scripts/capture.sh
73         install -m755 $srcdir/glc/scripts/play.sh $pkgdir/usr/share/glc/scripts/play.sh
74         install -m755 $srcdir/glc/scripts/encode.sh $pkgdir/usr/share/glc/scripts/encode.sh
75         install -d -m755 $pkgdir/usr/share/licenses/glc
76         install -m644 $srcdir/Copyright $pkgdir/usr/share/licenses/glc/Copyright