2017-08-04 02:53:25 +00:00
|
|
|
#! /usr/bin/env sh
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
DEP_SRC=$HOME/dependency_source/
|
2019-12-07 14:51:31 +00:00
|
|
|
DEP_ROOT=$HOME/staging
|
2017-08-04 02:53:25 +00:00
|
|
|
|
|
|
|
install_gnustep_make() {
|
|
|
|
cd $DEP_SRC
|
2019-12-06 16:32:25 +00:00
|
|
|
git clone https://github.com/gnustep/tools-make.git
|
|
|
|
cd tools-make
|
|
|
|
if [ -n "$RUNTIME_VERSION" ]
|
2017-08-04 02:53:25 +00:00
|
|
|
then
|
2020-02-23 17:17:33 +00:00
|
|
|
WITH_RUNTIME_ABI="--with-runtime-abi=${RUNTIME_VERSION}"
|
|
|
|
else
|
|
|
|
WITH_RUNTIME_ABI=""
|
2017-08-04 02:53:25 +00:00
|
|
|
fi
|
2020-02-23 17:17:33 +00:00
|
|
|
./configure --prefix=$DEP_ROOT --with-library-combo=$LIBRARY_COMBO $WITH_RUNTIME_ABI
|
|
|
|
make install
|
2019-12-06 16:32:25 +00:00
|
|
|
echo Objective-C build flags: `$HOME/staging/bin/gnustep-config --objc-flags`
|
2017-08-04 02:53:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
install_ng_runtime() {
|
|
|
|
cd $DEP_SRC
|
|
|
|
git clone https://github.com/gnustep/libobjc2.git
|
2019-12-06 16:32:25 +00:00
|
|
|
cd libobjc2
|
|
|
|
git submodule init
|
|
|
|
git submodule sync
|
|
|
|
git submodule update
|
|
|
|
cd ..
|
2017-08-04 02:53:25 +00:00
|
|
|
mkdir libobjc2/build
|
|
|
|
cd libobjc2/build
|
|
|
|
export CC="clang"
|
|
|
|
export CXX="clang++"
|
2019-12-06 16:32:25 +00:00
|
|
|
export CXXFLAGS="-std=c++11"
|
2019-12-07 14:51:31 +00:00
|
|
|
cmake -DTESTS=off -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGNUSTEP_INSTALL_TYPE=NONE -DCMAKE_INSTALL_PREFIX:PATH=$DEP_ROOT ../
|
2017-08-04 02:53:25 +00:00
|
|
|
make install
|
|
|
|
}
|
|
|
|
|
|
|
|
install_libdispatch() {
|
|
|
|
cd $DEP_SRC
|
2019-12-07 14:51:31 +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
|
2017-08-04 02:53:25 +00:00
|
|
|
export CC="clang"
|
|
|
|
export CXX="clang++"
|
2019-12-07 14:51:31 +00:00
|
|
|
export LIBRARY_PATH=$DEP_ROOT/lib;
|
|
|
|
export LD_LIBRARY_PATH=$DEP_ROOT/lib:$LD_LIBRARY_PATH;
|
|
|
|
export CPATH=$DEP_ROOT/include;
|
|
|
|
cmake -DBUILD_TESTING=off -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH=$HOME/staging -DINSTALL_PRIVATE_HEADERS=1 -DBlocksRuntime_INCLUDE_DIR=$DEP_ROOT/include -DBlocksRuntime_LIBRARIES=$DEP_ROOT/lib/libobjc.so ../
|
2017-08-04 02:53:25 +00:00
|
|
|
make install
|
|
|
|
}
|
|
|
|
|
|
|
|
install_gnustep_base() {
|
|
|
|
export GNUSTEP_MAKEFILES=$HOME/staging/share/GNUstep/Makefiles
|
|
|
|
. $HOME/staging/share/GNUstep/Makefiles/GNUstep.sh
|
|
|
|
|
|
|
|
cd $DEP_SRC
|
|
|
|
git clone https://github.com/gnustep/libs-base.git
|
|
|
|
cd libs-base
|
|
|
|
./configure
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
}
|
|
|
|
|
|
|
|
mkdir -p $DEP_SRC
|
2019-12-07 14:51:31 +00:00
|
|
|
if [ "$LIBRARY_COMBO" = 'ng-gnu-gnu' ]
|
2017-08-04 02:53:25 +00:00
|
|
|
then
|
|
|
|
install_ng_runtime
|
|
|
|
install_libdispatch
|
|
|
|
fi
|
|
|
|
|
|
|
|
install_gnustep_make
|
|
|
|
install_gnustep_base
|