2018-01-20 01:44:18 +01:00
|
|
|
# Maintainer: Martchus <martchus@gmx.net>
|
|
|
|
# Contributor: Jonathan Steel <jsteel at archlinux.org>
|
|
|
|
# Contributor: Yunhui Fu <yhfudev@gmail.com>
|
|
|
|
|
|
|
|
_reponame=rapidjson
|
|
|
|
pkgname=mingw-w64-$_reponame
|
|
|
|
pkgver=1.1.0
|
2022-06-30 21:59:20 +02:00
|
|
|
pkgrel=6
|
2018-01-20 01:44:18 +01:00
|
|
|
pkgdesc='A fast JSON parser/generator for C++ with both SAX/DOM style API (mingw-w64)'
|
|
|
|
arch=('any')
|
|
|
|
url='https://github.com/miloyip/rapidjson'
|
|
|
|
license=('MIT')
|
2022-06-30 21:59:20 +02:00
|
|
|
makedepends=('mingw-w64-gcc' 'mingw-w64-cmake' 'ninja' 'git')
|
2022-06-30 20:38:48 +02:00
|
|
|
checkdepends=('mingw-w64-wine' 'python')
|
|
|
|
source=(
|
|
|
|
"$_reponame-$pkgver.tar.gz::https://github.com/miloyip/$_reponame/archive/v$pkgver.tar.gz"
|
|
|
|
'git+https://github.com/google/googletest.git#commit=2fe3bd994b3189899d93f1d5a881e725e046fdc2')
|
|
|
|
sha256sums=('bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e'
|
|
|
|
'SKIP')
|
2018-01-20 01:44:18 +01:00
|
|
|
options=(!buildflags staticlibs !strip !emptydirs)
|
|
|
|
_architectures='i686-w64-mingw32 x86_64-w64-mingw32'
|
|
|
|
|
2019-11-21 18:05:21 +01:00
|
|
|
prepare() {
|
|
|
|
cd "$_reponame-$pkgver"
|
|
|
|
|
|
|
|
# disable -Werror as it is done in the regular rapidjson package
|
|
|
|
find -name CMakeLists.txt | xargs sed -e 's|-Werror||' -i # Don't use -Werror
|
|
|
|
|
|
|
|
# exclude tests which don't run within WINE
|
|
|
|
sed -e 's:\(filestreamtest\|encodedstreamtest\|prettywritertest\|ostreamwrappertest\)\.cpp:#\0:g' -i test/unittest/CMakeLists.txt
|
|
|
|
}
|
|
|
|
|
2018-01-20 01:44:18 +01:00
|
|
|
build () {
|
|
|
|
cd "$_reponame-$pkgver"
|
2019-11-21 18:05:21 +01:00
|
|
|
|
2018-01-20 01:44:18 +01:00
|
|
|
for _arch in ${_architectures}; do
|
|
|
|
mkdir -p "build-${_arch}" && pushd "build-${_arch}"
|
|
|
|
${_arch}-cmake \
|
2020-10-04 01:04:01 +02:00
|
|
|
-G Ninja \
|
2018-01-20 01:44:18 +01:00
|
|
|
-DCMAKE_BUILD_TYPE:STRING=Release \
|
2019-11-21 18:05:21 +01:00
|
|
|
-DRAPIDJSON_HAS_STDSTRING=ON \
|
|
|
|
-DRAPIDJSON_BUILD_CXX11=ON \
|
|
|
|
-DRAPIDJSON_ENABLE_INSTRUMENTATION_OPT=OFF \
|
2018-01-20 01:44:18 +01:00
|
|
|
-DCMAKE_INSTALL_PREFIX:PATH="/usr/${_arch}" \
|
2022-06-30 20:38:48 +02:00
|
|
|
-DGTEST_SOURCE_DIR="$srcdir/googletest/googletest" \
|
|
|
|
-DGTEST_INCLUDE_DIR="$srcdir/googletest/googletest/include" \
|
|
|
|
-DINSTALL_GTEST=OFF \
|
|
|
|
-DRAPIDJSON_BUILD_THIRDPARTY_GTEST=ON \
|
2018-01-20 01:44:18 +01:00
|
|
|
..
|
2020-10-04 01:04:01 +02:00
|
|
|
ninja
|
2018-01-20 01:44:18 +01:00
|
|
|
popd
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2019-11-21 18:05:21 +01:00
|
|
|
check() {
|
|
|
|
cd "$_reponame-$pkgver"
|
|
|
|
for _arch in ${_architectures}; do
|
|
|
|
mkdir -p "build-${_arch}" && pushd "build-${_arch}"
|
|
|
|
|
|
|
|
pushd bin
|
2022-06-30 20:38:48 +02:00
|
|
|
ln -sf unittest.exe unittest
|
|
|
|
ln -sf perftest.exe perftest
|
2019-11-21 18:05:21 +01:00
|
|
|
popd
|
|
|
|
|
|
|
|
WINEPATH="/usr/${_arch}/bin" ctest -j 2 -V --tests-regex '^(perftest|unittest)$'
|
|
|
|
# note: Not running valgrind tests here; valgrind can not execute Windows executable.
|
|
|
|
popd
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2018-01-20 01:44:18 +01:00
|
|
|
package() {
|
|
|
|
cd "$_reponame-$pkgver"
|
|
|
|
for _arch in ${_architectures}; do
|
|
|
|
mkdir -p "build-${_arch}" && pushd "build-${_arch}"
|
2020-10-04 01:04:01 +02:00
|
|
|
DESTDIR="${pkgdir}" ninja install
|
2018-01-20 01:44:18 +01:00
|
|
|
# remove examples
|
|
|
|
rm -r "${pkgdir}/usr/${_arch}/share"
|
|
|
|
# put cmake files in right directory
|
|
|
|
mkdir -p "${pkgdir}/usr/${_arch}/lib/cmake/RapidJSON"
|
|
|
|
mv "${pkgdir}/usr/${_arch}/cmake/"* "${pkgdir}/usr/${_arch}/lib/cmake/RapidJSON"
|
|
|
|
popd
|
|
|
|
done
|
|
|
|
}
|