summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 37c038abf9a6b7724e8df0f33b58d40e7369ba4f (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
pkgname=mingw-w64-mcfgthread-git
pkgver=r528.6af5465
pkgrel=1
pkgdesc="An efficient Gthread implementation for GCC (mingw-w64)"
arch=(any)
url="https://github.com/lhmouse/mcfgthread"
license=('LGPL')
depends=('mingw-w64-crt')
makedepends=('mingw-w64-configure' 'git')
options=(!strip !buildflags staticlibs)
source=("git+https://github.com/lhmouse/mcfgthread.git")
sha256sums=('SKIP')

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

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

build() {
  cd "${srcdir}/mcfgthread"
  autoreconf -vfi
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch} && pushd build-${_arch}
    CFLAGS="-fno-exceptions" ${_arch}-configure ..
    make
    popd
  done
}

package() {
  for _arch in ${_architectures}; do
    cd "${srcdir}"/mcfgthread/build-${_arch}
    make DESTDIR="$pkgdir" install
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
  done
}