summaryrefslogtreecommitdiff
path: root/community/ibus-libpinyin/PKGBUILD
blob: 151ca40c43ee9e8d0dfedce1c935a30fc21828a3 (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
# $Id: PKGBUILD 79787 2012-11-12 15:24:58Z 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.4.93
pkgrel=1
pkgdesc="Intelligent Pinyin engine based on libpinyin for IBus"
arch=('i686' 'x86_64')
license=('LGPL')
url="https://github.com/libpinyin"
depends=('ibus>=1.4' 'libpinyin')
makedepends=('git' 'intltool' 'gnome-common')
source=(https://github.com/downloads/libpinyin/ibus-libpinyin/${pkgname}-${pkgver}.tar.gz)
md5sums=("95f6143323deddaf6d82020dcc14a1af")

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

  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

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

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