summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1ddbdd92589d896ca3c55fd159d1a55b2674b26d (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
# Maintainer: Patrick Northon <northon_patrick3@yahoo.ca>

pkgname=mingw-w64-pystring
pkgver=1.1.3
pkgrel=2
pkgdesc="Pystring is a collection of C++ functions which match the interface and behavior of python's string class methods using std::string (mingw-w64)"
arch=(any)
url="https://github.com/imageworks/pystring"
license=("custom")
makedepends=('mingw-w64-cmake')
depends=('mingw-w64-crt')
options=('!strip' '!buildflags' 'staticlibs')
source=(
	"https://github.com/imageworks/pystring/archive/v${pkgver}.tar.gz"
	"BuildPystring.cmake")
sha256sums=(
	"358a56e756e701836b69a31c75d3d9d41c34d447cf7b3775bbd5620dcd3203d9"
	"1069e99aa9e546945e0f88bd4f2b06cbca8bb796843d7dc97fa428bafef60a05")

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

prepare() {
	cp "BuildPystring.cmake" "pystring-${pkgver}/CMakeLists.txt"
}

build() {
	_flags=( -Wno-dev -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE="-O2 -DNDEBUG" )
	
	for _arch in ${_architectures}; do
		${_arch}-cmake -S "pystring-${pkgver}" -B "build-${_arch}" "${_flags[@]}"
		make -C "build-${_arch}"
	done
}

package() {
	for _arch in ${_architectures}; do
		make DESTDIR="${pkgdir}" -C "build-${_arch}" install
		install -Dm644 "pystring-${pkgver}/LICENSE" "$pkgdir/usr/${_arch}/share/licenses/$pkgname/LICENSE"
	done
}