forked from gnustep/libs-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdependencies.sh
executable file
·74 lines (66 loc) · 2.25 KB
/
dependencies.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#! /usr/bin/env sh
set -ex
install_gnustep_make() {
echo "::group::GNUstep Make"
cd $DEPS_PATH
git clone -q -b ${TOOLS_MAKE_BRANCH:-master} https://github.com/gnustep/tools-make.git
cd tools-make
MAKE_OPTS=
if [ -n "$HOST" ]; then
MAKE_OPTS="$MAKE_OPTS --host=$HOST"
fi
if [ -n "$RUNTIME_VERSION" ]; then
MAKE_OPTS="$MAKE_OPTS --with-runtime-abi=$RUNTIME_VERSION"
fi
./configure --prefix=$INSTALL_PATH --with-library-combo=$LIBRARY_COMBO $MAKE_OPTS || cat config.log
make install
echo Objective-C build flags:
$INSTALL_PATH/bin/gnustep-config --objc-flags
echo "::endgroup::"
}
install_libobjc2() {
echo "::group::libobjc2"
cd $DEPS_PATH
git clone -q https://github.com/gnustep/libobjc2.git
cd libobjc2
git submodule sync
git submodule update --init
mkdir build
cd build
cmake \
-DTESTS=off \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DGNUSTEP_INSTALL_TYPE=NONE \
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PATH \
../
make install
echo "::endgroup::"
}
install_libdispatch() {
echo "::group::libdispatch"
cd $DEPS_PATH
# will reference upstream after https://github.com/apple/swift-corelibs-libdispatch/pull/534 is merged
git clone -q -b system-blocksruntime https://github.com/ngrewe/swift-corelibs-libdispatch.git libdispatch
mkdir libdispatch/build
cd libdispatch/build
# -Wno-error=void-pointer-to-int-cast to work around build error in queue.c due to -Werror
cmake \
-DBUILD_TESTING=off \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PATH \
-DCMAKE_C_FLAGS="-Wno-error=void-pointer-to-int-cast" \
-DINSTALL_PRIVATE_HEADERS=1 \
-DBlocksRuntime_INCLUDE_DIR=$INSTALL_PATH/include \
-DBlocksRuntime_LIBRARIES=$INSTALL_PATH/lib/libobjc.so \
../
make install
echo "::endgroup::"
}
mkdir -p $DEPS_PATH
# Windows MSVC toolchain uses tools-windows-msvc scripts to install non-GNUstep dependencies;
# the MSYS2 toolchain uses Pacman to install non-GNUstep dependencies.
if [ "$LIBRARY_COMBO" = "ng-gnu-gnu" -a "$IS_WINDOWS_MSVC" != "true" -a "$IS_WINDOWS_MINGW" != "true" ]; then
install_libobjc2
install_libdispatch
fi
install_gnustep_make