-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-on-mac-ios.sh
56 lines (43 loc) · 1.32 KB
/
build-on-mac-ios.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
#!/usr/bin/env bash
set -e
export LIBSODIUM_FULL_BUILD=true
readonly IOS_MIN_VERSION=6.0
# ===========================
# macOs, iOs
# ===========================
# [brew] install dependencies
# packages='libtool autoconf automake'
# brew update
# for pkg in ${packages}; do
# if brew list -1 | grep -q "^${pkg}\$"; then
# echo "Package '$pkg' is installed"
# #brew upgrade $pkg
# else
# echo "Package '$pkg' is not installed"
# brew install $pkg
# fi
# done
# brew upgrade ${packages} || true
# [variable]
ROOT=$(pwd)
DIR_DEST=${ROOT}/output
DIR_LIBSODIUM=${ROOT}/libsodium
# [src] libsodium
git clone -b 1.0.18 --depth 1 https://github.com/jedisct1/libsodium.git $DIR_LIBSODIUM && cd $DIR_LIBSODIUM
# configure
./autogen.sh
# [generate]
#git clean -Xdf
#./autogen.sh
#./dist-build/ios.sh
#mkdir -p $DIR_DEST/Plugins/iOS
#cp $DIR_LIBSODIUM/libsodium-ios/lib/libsodium.a $DIR_DEST/Plugins/iOS/libsodium.a
git clean -Xdf
# replace osx.sh with modified_osx.sh
cp $ROOT/modified_osx.sh $DIR_LIBSODIUM/dist-build/osx.sh
./autogen.sh
./dist-build/osx.sh
mkdir -p $DIR_DEST/Plugins/x64
cp $DIR_LIBSODIUM/libsodium-osx/lib/libsodium.*.dylib $DIR_DEST/Plugins/x64/sodium.bundle
echo "lipo -info $DIR_LIBSODIUM/libsodium-osx/lib/libsodium.*.dylib"
lipo -info $DIR_LIBSODIUM/libsodium-osx/lib/libsodium.*.dylib