3 export CBS_BASE=$(cd $(dirname "$0"); pwd)
5 if [ -e $CBS_BASE/config.sh ]; then
8 echo "config.sh not found."
12 if [ "$CBS_PARALLEL" == "" ]; then
13 echo " (\$CBS_PARALLEL not set; add export CBS_PARALLEL=\"-j4\" or similar to config.sh to do parallel builds)"
16 # $1 must be package name
17 if [ "$1" == "" ]; then
18 echo "Syntax: $0 <package> [variant]"
26 export CBS_ARCHIVES=$CBS_BASE/Archives
27 export CBS_PATCHES=$CBS_BASE/Patches
28 export CBS_REPOS=$CBS_BASE/Repos
32 # Some packages (e.g. glib with glib-genmarshal) require native tools
33 # (that they build) as part of the build process, so we need to build
34 # the build host's version first.
35 for v in x86_64 arm64; do
38 if [ "$VARIANT" == "" -o "$VARIANT" == "$CBS_VARIANT" ]; then
40 source $CBS_BASE/tools.sh
41 source $CBS_BASE/Variants/$CBS_VARIANT
43 export CBS_ROOT=$CBS_BASE/$CBS_CLANG_ARCH
44 export CBS_BUILD=$CBS_BASE/Build/$CBS_CLANG_ARCH
45 export CBS_BUILD_BIN=$CBS_BASE/x86_64/bin
46 export PKG_CONFIG_LIBDIR=$CBS_ROOT/lib/pkgconfig
47 export PKG_CONFIG_PATH=
49 # Magic variable to set target OS X version
50 export MACOSX_DEPLOYMENT_TARGET=$CBS_MACOSX_DEPLOYMENT
51 export CBS_MACOSX_SDK=$CBS_MACOSX_SDK_PREFIX/MacOSX${CBS_MACOSX_SDK_VERSION}.sdk
53 export CBS_OSX_FLAGS="-arch $CBS_CLANG_ARCH -isysroot $CBS_MACOSX_SDK"
54 export CBS_BUILD_TRIPLE=x86_64-apple-darwin
55 export CBS_HOST_TRIPLE=$CBS_CONFIGURE_ARCH-apple-darwin
56 export MESON=$CBS_BASE/meson-0.56.0/meson.py
57 mkdir -p $CBS_ROOT $CBS_BUILD $CBS_BASE/Log/$CBS_CLANG_ARCH
60 echo -n " $PACKAGE for $CBS_VARIANT... "
61 bash $CBS_BASE/Scripts/$PACKAGE.sh > $CBS_BASE/Log/$CBS_CLANG_ARCH/$PACKAGE.log 2>&1
62 if [ "$?" != "0" ]; then
63 echo "********* ERROR!"
64 errors=`expr $errors + 1`