diff options
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | PKGBUILD | 53 |
2 files changed, 73 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..cf5771d77cda --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +# Generated by makepkg 4.2.0 +# Wed Feb 4 20:30:00 UTC 2015 +pkgbase = mingw-w64-yajl + pkgdesc = Yet Another JSON Library (mingw-w64) + pkgver = 2.1.0 + pkgrel = 1 + url = http://lloyd.github.com/yajl/ + arch = any + license = ISC + makedepends = mingw-w64-gcc + makedepends = mingw-w64-cmake + depends = mingw-w64-crt + options = !strip + options = !buildflags + options = staticlibs + source = yajl-2.1.0.tar.gz::https://github.com/lloyd/yajl/archive/2.1.0.tar.gz + md5sums = 6887e0ed7479d2549761a4d284d3ecb0 + +pkgname = mingw-w64-yajl + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..4ddd2c4f7ea1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,53 @@ +# Maintainer: Stas Elensky <stas-at-flexsys-dot-com-dot-ua> + +pkgname=mingw-w64-yajl +_pkgnameorig=yajl +pkgver=2.1.0 +pkgrel=1 +pkgdesc='Yet Another JSON Library (mingw-w64)' +arch=('any') +url='http://lloyd.github.com/yajl/' +license=('ISC') +makedepends=(mingw-w64-gcc mingw-w64-cmake) +depends=(mingw-w64-crt) +options=('!strip' '!buildflags' staticlibs) +source=("$_pkgnameorig-$pkgver.tar.gz::https://github.com/lloyd/$_pkgnameorig/archive/$pkgver.tar.gz") +md5sums=('6887e0ed7479d2549761a4d284d3ecb0') + +_architectures="i686-w64-mingw32 x86_64-w64-mingw32" + +build() { + unset LDFLAGS + + cd "$srcdir/yajl-$pkgver" + + # Source code uses WIN32 definition to include code specific to MSVC + # However this makes MSVC specific code included when compiling under MinGW32 + # Fix it by changing WIN32 to _MSC_VER + find . -type f -exec sed "s|WIN32|_MSC_VER|g" -i {} \; + + # We want the DLL to go into bin and archive into lib + sed 's|RUNTIME DESTINATION lib${LIB_SUFFIX}|RUNTIME DESTINATION bin|g' -i src/CMakeLists.txt + + # Conform to Arch directory structure + sed 's|DESTINATION share/pkgconfig|DESTINATION lib/pkgconfig|g' -i src/CMakeLists.txt + + for _arch in ${_architectures}; do + mkdir -p build-${_arch} && pushd build-${_arch} + + ${_arch}-cmake .. + + make + + popd + done +} + +package() { + for _arch in ${_architectures}; do + cd "${srcdir}/yajl-$pkgver/build-${_arch}" + make DESTDIR="${pkgdir}" install + ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll + ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a + done +} |