summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: adba9f487136e680e7bb16d39c4221ba1dc40d0f (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
# Maintainer: bemxio <bemxiov at protonmail dot com>
# Contributor: Felix Yan <felixonmars at archlinux dot org>
# Contributor: pingplug <aur at pingplug dot 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.r662.g14315e6
pkgrel=1

arch=(any)

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

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")

pkgver() {
	# move to the source directory
	cd 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 "winpthreads-build-${_target}" && cd "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 "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
}