2016-07-13 08:43:56 +00:00
|
|
|
#! /usr/bin/env sh
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
DEP_SRC=$HOME/dependency_source/
|
2020-05-15 14:19:39 +00:00
|
|
|
|
|
|
|
case $TRAVIS_OS_NAME in
|
|
|
|
linux)
|
|
|
|
DEP_ROOT=$HOME/staging
|
|
|
|
;;
|
|
|
|
windows)
|
|
|
|
DEP_ROOT=/c/staging
|
|
|
|
;;
|
|
|
|
esac
|
2016-07-13 08:43:56 +00:00
|
|
|
|
|
|
|
install_gnustep_make() {
|
|
|
|
cd $DEP_SRC
|
2019-11-28 13:16:14 +00:00
|
|
|
git clone https://github.com/gnustep/tools-make.git
|
|
|
|
cd tools-make
|
2019-11-28 13:16:37 +00:00
|
|
|
if [ -n "$RUNTIME_VERSION" ]
|
|
|
|
then
|
2020-02-23 14:45:52 +00:00
|
|
|
WITH_RUNTIME_ABI="--with-runtime-abi=${RUNTIME_VERSION}"
|
|
|
|
else
|
|
|
|
WITH_RUNTIME_ABI=""
|
2019-11-28 13:16:37 +00:00
|
|
|
fi
|
2020-05-15 14:19:39 +00:00
|
|
|
$mingw ./configure --prefix=$DEP_ROOT --with-library-combo=$LIBRARY_COMBO $WITH_RUNTIME_ABI
|
|
|
|
$mingw make install
|
|
|
|
echo Objective-C build flags: `$DEP_ROOT/bin/gnustep-config --objc-flags`
|
2016-07-13 08:43:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
install_ng_runtime() {
|
|
|
|
cd $DEP_SRC
|
|
|
|
git clone https://github.com/gnustep/libobjc2.git
|
2019-11-24 15:39:06 +00:00
|
|
|
cd libobjc2
|
2019-11-24 18:52:48 +00:00
|
|
|
git submodule init
|
2019-11-24 15:39:06 +00:00
|
|
|
git submodule sync
|
|
|
|
git submodule update
|
|
|
|
cd ..
|
2016-07-13 08:43:56 +00:00
|
|
|
mkdir libobjc2/build
|
|
|
|
cd libobjc2/build
|
|
|
|
export CC="clang"
|
|
|
|
export CXX="clang++"
|
2019-11-24 19:11:15 +00:00
|
|
|
export CXXFLAGS="-std=c++11"
|
2020-05-15 14:19:39 +00:00
|
|
|
cmake \
|
|
|
|
-DTESTS=off \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DGNUSTEP_INSTALL_TYPE=NONE \
|
|
|
|
-DCMAKE_INSTALL_PREFIX:PATH=$DEP_ROOT \
|
|
|
|
../
|
2016-07-13 08:43:56 +00:00
|
|
|
make install
|
|
|
|
}
|
|
|
|
|
|
|
|
install_libdispatch() {
|
|
|
|
cd $DEP_SRC
|
2019-11-26 10:11:38 +00:00
|
|
|
# will reference upstream after https://github.com/apple/swift-corelibs-libdispatch/pull/534 is merged
|
|
|
|
git clone -b system-blocksruntime https://github.com/ngrewe/swift-corelibs-libdispatch.git
|
|
|
|
mkdir swift-corelibs-libdispatch/build
|
|
|
|
cd swift-corelibs-libdispatch/build
|
2016-07-13 08:43:56 +00:00
|
|
|
export CC="clang"
|
|
|
|
export CXX="clang++"
|
2019-11-26 10:11:38 +00:00
|
|
|
export LIBRARY_PATH=$DEP_ROOT/lib;
|
|
|
|
export LD_LIBRARY_PATH=$DEP_ROOT/lib:$LD_LIBRARY_PATH;
|
|
|
|
export CPATH=$DEP_ROOT/include;
|
2020-05-15 14:19:39 +00:00
|
|
|
cmake \
|
|
|
|
-DBUILD_TESTING=off \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_INSTALL_PREFIX:PATH=$DEP_ROOT \
|
|
|
|
-DINSTALL_PRIVATE_HEADERS=1 \
|
|
|
|
-DBlocksRuntime_INCLUDE_DIR=$DEP_ROOT/include \
|
|
|
|
-DBlocksRuntime_LIBRARIES=$DEP_ROOT/lib/libobjc.so \
|
|
|
|
../
|
2016-07-13 08:43:56 +00:00
|
|
|
make install
|
|
|
|
}
|
|
|
|
|
|
|
|
mkdir -p $DEP_SRC
|
2019-11-26 10:11:38 +00:00
|
|
|
if [ "$LIBRARY_COMBO" = 'ng-gnu-gnu' ]
|
2016-07-13 08:43:56 +00:00
|
|
|
then
|
|
|
|
install_ng_runtime
|
|
|
|
install_libdispatch
|
|
|
|
fi
|
|
|
|
|
|
|
|
install_gnustep_make
|