83 lines
2.5 KiB
Bash
83 lines
2.5 KiB
Bash
# Maintainer: Martchus <martchus@gmx.net>
|
|
|
|
# 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.4.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' 'ninja')
|
|
url="https://github.com/Martchus/${_reponame}"
|
|
source=("${_name}-${pkgver}.tar.gz::https://github.com/Martchus/${_reponame}/archive/v${pkgver}.tar.gz")
|
|
sha256sums=('12330ad7b3f745f91bf37193dc872462fd1e14cc13018094a200d424bf346be6')
|
|
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 \
|
|
-G Ninja \
|
|
-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]} \
|
|
../
|
|
ninja
|
|
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}"
|
|
DESTDIR="${pkgdir}" ninja install
|
|
DESTDIR="${pkgdir}" ninja install-binary-strip
|
|
popd
|
|
done
|
|
done
|
|
}
|