summaryrefslogtreecommitdiff
path: root/extra/celestia/PKGBUILD
blob: 5890807337a08050a3a062aa53f487da473853c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# $Id: PKGBUILD 184365 2013-05-06 19:36:48Z foutrelis $
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor : Damir Perisa <damir.perisa@bluewin.ch>

pkgname=celestia
pkgver=1.6.1
pkgrel=5
pkgdesc="Real-time space simulation"
arch=('i686' 'x86_64' 'mips64el')
license=('GPL')
url="http://www.shatters.net/celestia/"
depends=('gtk2' 'libtheora' 'lua51' 'gtkglext' 'glut' 'libxmu' 'glu' 'libjpeg' 'mesa')
options=('!makeflags')
source=("http://downloads.sourceforge.net/sourceforge/celestia/${pkgname}-${pkgver}.tar.gz"
        'celestia-1.6.1-gcc46.patch'
        'celestia-1.6.1-libpng15.patch'
        'celestia-1.6.1-libpng16.patch'
        'celestia-1.6.1-linking.patch'
        'gcc-4.7-fixes.diff')
sha1sums=('1f0fdf4525a8b9d6c708e1f6383babed670d18e7'
          '7c08ca391603806d788cb8f3342acedafc924eef'
          '46ecc4e10b24191384bc848c206652498843adf0'
          '6f357bd319cdac0776206726e0743b90d4d8127b'
          '534c8eee18d13a868c91f0b870ebecc05f3e7ae1'
          '582f9eed93eca02a16350f02c29e2ea6f69aa869')

prepare() {
    cd ${srcdir}/${pkgname}-${pkgver}

    # build patch
    patch -Np0 -i "${srcdir}/celestia-1.6.1-gcc46.patch"
    patch -Np0 -i "${srcdir}/celestia-1.6.1-libpng15.patch"
    patch -Np2 -i "${srcdir}/celestia-1.6.1-libpng16.patch"
    patch -Np1 -i "${srcdir}/celestia-1.6.1-linking.patch"
    patch -Np1 -i "${srcdir}/gcc-4.7-fixes.diff"

    sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.in

    autoreconf -vi
}

build() {
    cd ${srcdir}/${pkgname}-${pkgver}

    # This version of Celestia has a bug in the font rendering and requires -fsigned-char
    CFLAGS+=' -fsigned-char'
    CXXFLAGS+=' -fsigned-char'

    ./configure --prefix=/usr \
                --with-lua=/usr \
                --datadir=/usr/share \
                --with-gtk \
                --disable-rpath \
                --with-lua
    make
}

package() {
    cd ${srcdir}/${pkgname}-${pkgver}

    make DESTDIR=${pkgdir} MKDIR_P='mkdir -p' install
}