aboutsummaryrefslogtreecommitdiffstats
path: root/pkgbuild/PKGBUILD
blob: 99026c7890aa85f73b8a3cf3cf473699bf30947c (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Maintainer: Enlightenment Developers <enlightenment-devel@enlightenment.org>
pkgname=('elementary' 'elementary_test' 'elementary_doc')
[[ -d ../.git ]] && pkgname=('elementary-git' 'elementary_test-git' 'elementary_doc-git')
pkgver=1.11.99.10566.b520960
pkgrel=1
pkgdesc="Enlightenment GUI toolkit - GIT development snapshot"
arch=('i686' 'x86_64' 'arm')
url="http://www.enlightenment.org"
license=('LGPL2.1' 'CCPL:cc-by-sa')
makedepends=('doxygen' 'imagemagick')
[[ -d ../.git ]] && makedepends+=('git')
depends=('efl')
  [[ ! $(pacman -T ewebkit) ]] && depends+=('ewebkit')                 # webkit-efl support is detected at build time
  [[ ! $(pacman -T elocation-git) ]] && depends+=('elocation-git')     # elocation support is detected at build time
  [[ ! $(pacman -T libeweather-git) ]] && depends+=('libeweather-git') # eweather support is detected at build time
optdepends=('emotion_generic_players' 'evas_generic_loaders')
options=('debug')

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

  if [[ -d .git ]]; then
    local efl_version=$(grep -m 1 EFL_VERSION configure.ac | grep -o "[[:digit:]]*" | tr '\n' '.')
    efl_version=$(awk -F , -v efl_version=${efl_version%.} '/^AC_INIT/ {gsub(/efl_version/, efl_version); gsub(/[\[\] -]/, ""); print $2}' configure.ac)
    printf "$efl_version.$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
  else
    ./configure --version | awk '/^elementary/ {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 --disable-static --with-elementary-web-backend=none
  make
  make doc
}

#check() {
#  cd "../.."
#  make -k check
#}

package_elementary() {
  cd "../.."
  make -j1 DESTDIR="$pkgdir/" install
  install -Dm644 README "$pkgdir/usr/share/doc/${pkgname%-git}/README"
  install -Dm644 NEWS "$pkgdir/usr/share/doc/${pkgname%-git}/NEWS"
  install -Dm644 ChangeLog "$pkgdir/usr/share/doc/${pkgname%-git}/ChangeLog"
  install -Dm644 AUTHORS "$pkgdir/usr/share/doc/${pkgname%-git}/AUTHORS"
  install -Dm644 COMPLIANCE "$pkgdir/usr/share/doc/${pkgname%-git}/COMPLIANCE"
  install -Dm644 COPYING.images "$pkgdir/usr/share/licenses/$pkgname/COPYING.images"
  sed -n '1,/details./p' COPYING > "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  ln -s "../licenses/$pkgname/COPYING" "$pkgdir/usr/share/doc/${pkgname%-git}/COPYING"
  ln -s "../licenses/$pkgname/COPYING.images" "$pkgdir/usr/share/doc/${pkgname%-git}/COPYING.images"
  rm -rf "$pkgdir/usr/bin/"elementary_test
  rm -rf "$pkgdir/usr/lib/elementary/modules/"{test_entry,test_map}
  rm -rf "$pkgdir/usr/share/applications/elementary_test.desktop"
  rm -rf "$pkgdir/usr/share/elementary/"{examples,images,objects}
}

package_elementary-git() {
  provides=("elementary=$pkgver")
  conflicts=('elementary')
  package_elementary
}

package_elementary_test() {
  pkgdesc="Test application for Elementary"
  depends=(${pkgname/_test/})
  unset optdepends

  cd "../.."
  make -j1 DESTDIR="$pkgdir/" install
  rm -rf "$pkgdir/usr/include"
  rm -rf "$pkgdir/usr/share/eolian/include/elementary-1/"
  rm -rf "$pkgdir/usr/bin/"{elementary_codegen,elementary_config,elementary_quicklaunch,elementary_run,elm_prefs_cc}
  rm -rf "$pkgdir/usr/lib/"{cmake,edje,libelementary.so*,pkgconfig}
  rm -rf "$pkgdir/usr/lib/elementary/modules/"{access_output,datetime_input_ctxpopup,prefs}
  rm -rf "$pkgdir/usr/share/applications/elementary_config.desktop"
  rm -rf "$pkgdir/usr/share/elementary/"{config,examples,themes,edje_externals}
  rm -rf "$pkgdir/usr/share/"{icons,locale}
}

package_elementary_test-git() {
  provides=("elementary_test=$pkgver")
  conflicts=('elementary_test')
  package_elementary_test
}

package_elementary_doc() {
  pkgdesc="Documentation for Elementary"
  arch=('any')
  unset depends optdepends

  cd "../.."
  mkdir -p "$pkgdir/usr/share/doc/${pkgname%-git}"
  cp -a doc/html "$pkgdir/usr/share/doc/${pkgname%-git}/html"
  cp -a doc/latex "$pkgdir/usr/share/doc/${pkgname%-git}/latex"
}

package_elementary_doc-git() {
  package_elementary_doc
  provides=("elementary_doc=$pkgver")
  conflicts=('elementary_doc')
}