Anonim / 1 year, 9 months ago | Download | Plaintext | Odpowiedz |

 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
# Contributor: taylorchu <taylorchu@gmail.com>
pkgname=fcitx-chewing-git
pkgver=20121229
pkgrel=1
pkgdesc="Fcitx Wrapper for libchewing"
arch=('i686' 'x86_64')
url="https://github.com/fcitx/fcitx-chewing"
license=('GPLv2')
depends=('fcitx' 'fcitx>=4.2.7' 'libchewing')
makedepends=('git' 'cmake' 'gettext' 'coreutils' 'sh')
provides=('fcitx-chewing')
conflicts=('fcitx-chewing')

_gitname=fcitx-chewing

_gitroot=https://github.com/fcitx/fcitx-chewing
_gitbranch=master

build(){
  cd "$srcdir"

  if [ -d "$srcdir/$_gitname/.git" ]; then
    cd "$_gitname"
    msg "Reset current branch"
    git reset --hard HEAD
    msg "Fetching branch $_gitbranch from $_gitroot..."
    git fetch --force --update-head-ok \
      "$_gitroot" "$_gitbranch:$_gitbranch"
    msg "Checking out branch $_gitbranch..."
    git checkout "$_gitbranch"
    git reset --hard "$_gitbranch"
    msg "The local files are updated."
  else
    msg "Cloning branch $_gitbranch from $_gitroot to $_gitname..."
    git clone --single-branch --branch "$_gitbranch" \
      "$_gitroot" "$_gitname"
    cd "$_gitname"
  fi
  msg "GIT checkout done or server timeout"

  msg "Creating make environment..."
  mkdir -p "$srcdir/$_gitname-build"

  msg "Starting make..."
  cd "$srcdir/$_gitname-build"
  cmake "../$_gitname" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
  make
}

package() {
  cd "$srcdir/$_gitname-build"
  make DESTDIR="$pkgdir" install
}