summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 20b37e1016a481ccd8cda3bd1d7f7c8461d8f80e (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
54
55
56
57
58
59
60
61
62
63
64
# Maintainer: bemxio <bemxiov@protonmail.com>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: pingplug <aur@pingplug.me>

pkgname=mingw-w64-winpthreads-git
pkgdesc="MinGW-w64 winpthreads library (git version)"

_targets="i686-w64-mingw32 x86_64-w64-mingw32"

pkgver=11.0.0.r643.g57f796c
pkgrel=1

arch=(any)

url="http://mingw-w64.sourceforge.net"
license=("custom")

#depends=()
makedepends=(mingw-w64-gcc mingw-w64-binutils mingw-w64-crt)

provides=(mingw-w64-winpthreads)
conflicts=(mingw-w64-winpthreads)

source=("git+https://git.code.sf.net/p/mingw-w64/mingw-w64")
md5sums=("SKIP")

options=("staticlibs" "!strip" "!buildflags" "!emptydirs")

pkgver() {
    # move to the source directory
    cd "${srcdir}/mingw-w64"

    # use the most recent annotated tag reachable from the last commit
    git describe --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    for _target in ${_targets}; do
        # make a build directory and move into it
        mkdir -p "${srcdir}/winpthreads-build-${_target}" && cd "${srcdir}/winpthreads-build-${_target}"
        
        # configure the build
        "${srcdir}/mingw-w64/mingw-w64-libraries/winpthreads/configure" \
            --prefix="/usr/${_target}" \
            --host="${_target}" \
            --enable-static --enable-shared
        
        # build the library
        make
    done
}

package() {
    for _target in ${_targets}; do
        # move to the build directory
        cd "${srcdir}/winpthreads-build-${_target}"

        # install the library
        make DESTDIR="${pkgdir}" install

        # strip unneeded symbols from the DLLs
        "${_target}-strip" --strip-unneeded "${pkgdir}/usr/${_target}/bin"/*.dll
    done
}