summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e9371e2596c303d8062e30d7009b64056ea1ae07 (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
# Maintainer: osfans <waxaca@163.com>
_pkgname=uchardet
pkgname=mingw-w64-${_pkgname}-git
pkgver=r191.e6be228
pkgrel=1
pkgdesc="Encoding detector library ported from Mozilla (mingw-w64)"
arch=(any)
url="https://github.com/BYVoid/uchardet"
license=('MPL')
makedepends=('git' 'mingw-w64-cmake' 'make')
options=(!strip !buildflags staticlibs)
source=('uchardet::git+https://github.com/BYVoid/uchardet.git')
md5sums=('SKIP')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

pkgver() {
  cd "$srcdir/$_pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  #unset LDFLAGS
  cd "$srcdir/$_pkgname"
  for _arch in ${_architectures}; do
    ${_arch}-cmake -Bbuild-${_arch} -H.
    make -Cbuild-${_arch}
  done
}

package() {
  cd "$srcdir/$_pkgname"
  for _arch in ${_architectures}; do
    make -Cbuild-${_arch} DESTDIR="$pkgdir" install
    ln -s libuchardet.dll $pkgdir/usr/${_arch}/bin/uchardet.dll
  done
}