# Maintainer: Martchus # All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where # you also find the URL of a binary repository. _reponame=cpp-utilities pkgname=apple-darwin-c++utilities _name=${pkgname#apple-darwin-} pkgver=4.16.0 pkgrel=1 arch=('any') pkgdesc='Common C++ classes and routines such as argument parser, IO and conversion utilities (apple-darwin)' license=('GPL') depends=('apple-darwin-osxcross') optdepends=("$_name-doc: API documentation") makedepends=('clang' 'cmake') url="https://github.com/Martchus/${_reponame}" source=("${_name}-${pkgver}.tar.gz::https://github.com/Martchus/${_reponame}/archive/v${pkgver}.tar.gz") sha256sums=('c4487d6e684c523e596bfc91203a6f10609606786553517bcf44ffae181feaa5') options=(!buildflags staticlibs !strip !emptydirs) _architectures='i386-apple-darwin15 x86_64-apple-darwin15' # NOTE: can not build for x86_64h-apple-darwin15 because libstdc++ is (currently) only availabe for x86_64 [[ $NO_STATIC_LIBS ]] || _configurations='-DENABLE_STATIC_LIBS:BOOL=ON' [[ $NO_SHARED_LIBS ]] && _configurations+=' -DDISABLE_SHARED_LIBS:BOOL=ON' build() { cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}" for _arch in ${_architectures}; do mkdir -p "build-${_arch}" && pushd "build-${_arch}" /opt/osxcross/bin/${_arch}-cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS='-std=c++14 -foc-use-gcc-libstdc++ -fvisibility=hidden' \ -DCMAKE_INSTALL_PREFIX:PATH="/opt/osxcross/${_arch}" \ -Diconv_DYNAMIC_LIB:FILEPATH='/opt/osxcross/SDK/MacOSX10.11.sdk/usr/lib/libiconv.2.tbd' \ -Diconv_DYNAMIC_INCLUDE_DIR='/opt/osxcross/SDK/MacOSX10.11.sdk/usr/include' \ -DENABLE_THREAD_LOCAL=OFF \ ${_configurations} \ ../ make popd done } package() { cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}" for _arch in ${_architectures}; do mkdir -p "build-${_arch}" && pushd "build-${_arch}" make DESTDIR="${pkgdir}" install make DESTDIR="${pkgdir}" install-binary-strip popd done }