# 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=5.0.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=('92d288b606b4f32d69686cbf5a264f90e5e00d80894583a9df2284d593cdc2b4') options=(!buildflags staticlibs !strip !emptydirs) _architectures=('x86_64-apple-darwin17') [[ $APPLE_32_BIT ]] && _architectures+=('i386-apple-darwin17') [[ $APPLE_HASWELL ]] && _architectures+=('x86_64h-apple-darwin17') _configurations=() [[ $NO_SHARED_LIBS ]] || _configurations+=('shared') [[ $NO_STATIC_LIBS ]] || _configurations+=('static') build() { cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}" declare -A _config_flags=( [shared]=' -DBUILD_SHARED_LIBS:BOOL=ON ' [static]=' -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_FIND_LIBRARY_SUFFIXES:STRING=.a -DSTATIC_LINKAGE:BOOL=ON -DSTATIC_LIBRARY_LINKAGE:BOOL=ON ' ) export PATH="/opt/osxcross/bin:$PATH" export LD_LIBRARY_PATH="/opt/osxcross/lib" for _arch in "${_architectures[@]}"; do for _cfg in "${_configurations[@]}"; do msg2 "${_arch}-${_cfg}" mkdir -p "build-${_arch}-${_cfg}" && pushd "build-${_arch}-${_cfg}" ${_arch}-cmake \ -DCMAKE_BUILD_TYPE:STRING='Release' \ -DCMAKE_INSTALL_PREFIX:PATH="/opt/osxcross/${_arch}" \ -DCONFIGURATION_NAME:STRING="${_cfg}" \ -DCONFIGURATION_PACKAGE_SUFFIX:STRING="-${_cfg}" \ -DUSE_STANDARD_FILESYSTEM:BOOL=OFF \ -DENABLE_THREAD_LOCAL:BOOL=OFF \ ${_config_flags[$_cfg]} \ ../ make popd done done } package() { cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}" export PATH="/opt/osxcross/bin:$PATH" export LD_LIBRARY_PATH="/opt/osxcross/lib" for _arch in "${_architectures[@]}"; do for _cfg in "${_configurations[@]}"; do msg2 "${_arch}-${_cfg}" pushd "build-${_arch}-${_cfg}" make DESTDIR="${pkgdir}" install make DESTDIR="${pkgdir}" install-binary-strip popd done done }