aboutsummaryrefslogtreecommitdiffstats
path: root/pkgbuild/PKGBUILD
blob: 6905e16925e08bc29ab2d97bd0239885d7166ef9 (plain) (blame)
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
# Maintainer: Enlightenment Developers <enlightenment-devel@enlightenment.org>>
pkgname=enlightenment
[[ -d ../.git ]] && pkgname=$pkgname-git
pkgver=0.18.0rc2.17432.569bc2e
pkgrel=1
pkgdesc="Enlightenment window manager - GIT development snapshot"
arch=('i686' 'x86_64' 'arm')
url="http://www.enlightenment.org"
license=('BSD')
depends=('elementary' 'xcb-util-keysyms' 'hicolor-icon-theme' 'pixman' 'mesa'
         'desktop-file-utils' 'udisks2' 'ttf-font' 'bluez-libs' 'bluez4')
optdepends=('connman: network module'
            'acpid: power events on laptop lid close'
            'gdb: create backtraces on crash')
[[ -d ../.git ]] && makedepends=('git')
provides=("enlightenment=$pkgver" "enlightenment17=$pkgver" 'notification-daemon')
conflicts=('enlightenment<1.0' 'enlightenment17')
backup=('etc/enlightenment/sysactions.conf'
        'etc/xdg/menus/enlightenment.menu')
options=('debug')
install=enlightenment.install

pkgver() {
  cd "../.."

  if [[ -d .git ]]; then
    for _i in v_maj v_min v_mic; do
      local v_ver=$v_ver.$(grep -m1 $_i configure.ac | sed 's/m4//' | grep -o "[[:digit:]]*")
    done

    v_ver=$(awk -F , -v v_ver=${v_ver#.} '/^AC_INIT/ {gsub(/v_ver/, v_ver); gsub(/[\[\] -]/, ""); print $2}' configure.ac)

    printf "$v_ver.$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
  else
    ./configure --version | awk '/^enlightenment/ {gsub("-", ""); print $NF}'
  fi
}

build() {
  cd "../.."
  export CFLAGS="$CFLAGS -fvisibility=hidden -fomit-frame-pointer"
  [[ -e Makefile ]] && make clean distclean
  [[ -e autogen.sh ]] && _configure=autogen.sh || _configure=configure
  ./$_configure --prefix=/usr --sysconfdir=/etc --enable-wayland-clients --enable-wayland-egl
  make
}

package() {
  cd "../.."
  make -j1 DESTDIR="$pkgdir" install
  install -Dm644 AUTHORS "$pkgdir/usr/share/doc/${pkgname%-*}/AUTHORS"
  install -Dm644 ChangeLog "$pkgdir/usr/share/doc/${pkgname%-*}/ChangeLog"
  install -Dm644 NEWS "$pkgdir/usr/share/doc/${pkgname%-*}/NEWS"
  install -Dm644 README "$pkgdir/usr/share/doc/${pkgname%-*}/README"
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  ln -sf "../../licenses/$pkgname/COPYING" "$pkgdir/usr/share/doc/${pkgname%-*}/COPYING"
}