summaryrefslogtreecommitdiff
path: root/community/ibus-libpinyin/PKGBUILD
blob: 2d26691f26699411ce3889fd17836b7038badf2d (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
# $Id: PKGBUILD 86672 2013-03-21 01:30:22Z fyan $
# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contributor:  Yangtse Su<yangtsesu@gmail.com>
# Contributor:  Jekyll Wu<adaptee [at] gmail [dot] com>
# Contributor: riverscn<riverscn at gmail.com>
# Contributor: rainy<rainylau at gmail.com>
# Contributor: Lee.MaRS<leemars at gmail.com>

pkgname=ibus-libpinyin
pkgver=1.5.92
pkgrel=1
pkgdesc="Intelligent Pinyin engine based on libpinyin for IBus"
arch=('i686' 'x86_64' 'mips64el')
license=('LGPL')
url="https://github.com/libpinyin"
depends=('ibus>=1.4' 'libpinyin')
makedepends=('git' 'intltool' 'gnome-common')
source=(https://github.com/libpinyin/ibus-libpinyin/archive/$pkgver.tar.gz
	automake-1.13.patch)

build() {
  cd "$srcdir"
  rm -rf "$srcdir/$pkgname-build"
  cp -r "$srcdir/$pkgname-$pkgver" "$srcdir/$pkgname-build"
  cd "$srcdir/$pkgname-build"

  patch -Np1 -i "$srcdir/automake-1.13.patch"

  msg "Starting make..."
  cd "$srcdir/$pkgname-build"

  # python2 fix
  for file in $(find . -name '*.py' -print); do
    sed -i 's_^#!.*/usr/bin/python_#!/usr/bin/python2_' $file
    sed -i 's_^#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' $file
  done

  for file in setup/ibus-setup-libpinyin.in; do
    sed -i 's_exec python_exec python2_' $file
  done

  export REQUIRED_AUTOMAKE_VERSION=1.13 automake_progs=automake-1.13

  ./autogen.sh --prefix=/usr --libexecdir=/usr/lib/$pkgname
  make
}

package() {
  cd "$srcdir/$pkgname-build"
  make NO_INDEX=true DESTDIR="$pkgdir" install
}
md5sums=('2a355713221df7e47354f81cb14e183f'
         '2a743114537a03830d5b4cd71226cfd0')