From 359af30b937cb1b350d9734b265eb54e32b64932 Mon Sep 17 00:00:00 2001 From: Martell Malone Date: Fri, 5 Jun 2015 00:40:01 +0100 Subject: [PATCH] jsoncpp: new package --- jsoncpp/PKGBUILD | 42 +++++++++++++++++++++++++++++++++++ jsoncpp/snprintf-newlib.patch | 11 +++++++++ 2 files changed, 53 insertions(+) create mode 100644 jsoncpp/PKGBUILD create mode 100644 jsoncpp/snprintf-newlib.patch diff --git a/jsoncpp/PKGBUILD b/jsoncpp/PKGBUILD new file mode 100644 index 00000000..66134d88 --- /dev/null +++ b/jsoncpp/PKGBUILD @@ -0,0 +1,42 @@ +# Maintainer: Martell Malone + +pkgname="jsoncpp" +pkgver=1.6.2 +pkgrel=1 +pkgdesc="A C++ library for interacting with JSON" +arch=('any') +url="https://github.com/open-source-parsers/jsoncpp" +license=('MIT') +makedepends=("gcc" + "cmake" + "python2" + ) +options=('staticlibs' '!strip' '!buildflags') +source=("https://github.com/open-source-parsers/jsoncpp/archive/$pkgver.tar.gz" + "snprintf-newlib.patch") +md5sums=('5a62da8b5c5b0e46a0e782e7363aee3d' + '34829bc0fc597234537f376eb2762a6d') + +prepare() { + cd "${srcdir}/${pkgname}-$pkgver" + patch -p1 -i ${srcdir}/snprintf-newlib.patch +} + +build() { + mkdir "${srcdir}/build-${CARCH}" + cd "${srcdir}/build-${CARCH}" + + cmake \ + -G"MSYS Makefiles" \ + -DCMAKE_INSTALL_PREFIX:PATH="${pkgdir}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DJSONCPP_WITH_CMAKE_PACKAGE=ON \ + "${srcdir}/${pkgname}-$pkgver" + + make +} + +package() { + cd "${srcdir}/build-${CARCH}" + make install +} diff --git a/jsoncpp/snprintf-newlib.patch b/jsoncpp/snprintf-newlib.patch new file mode 100644 index 00000000..776521bd --- /dev/null +++ b/jsoncpp/snprintf-newlib.patch @@ -0,0 +1,11 @@ +--- jsoncpp-1.6.2/src/lib_json/json_writer.cpp.old 2015-04-11 20:45:33.000000000 +0100 ++++ jsoncpp-1.6.2/src/lib_json/json_writer.cpp 2015-06-05 00:14:09.610468200 +0100 +@@ -29,7 +29,7 @@ + + #if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below + #define snprintf _snprintf +-#elif __cplusplus >= 201103L ++#elif __cplusplus >= 201103L && !defined(__CYGWIN__) + #define snprintf std::snprintf + #endif +