-
Notifications
You must be signed in to change notification settings - Fork 46
/
distpkg_macos.sh
executable file
·72 lines (53 loc) · 1.84 KB
/
distpkg_macos.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
#!/bin/sh
export PATH="${HOMEBREW_PREFIX}/opt/llvm/bin:$PATH"
export MACOSX_DEPLOYMENT_TARGET=10.15
export OPENJKDF2_RELEASE_COMMIT=$(git log -1 --format="%H")
export OPENJKDF2_RELEASE_COMMIT_SHORT=$(git rev-parse --short=8 HEAD)
rm -rf OpenJKDF2.app
rm -rf OpenJKDF2_x86_64.app
rm -rf OpenJKDF2_arm64.app
rm -rf OpenJKDF2_universal.app
rm -rf build_darwin_x86_64
rm -rf build_darwin64
rm -f macos-debug.tar.gz
rm -f src/globals.h
rm -f src/globals.c
#
# x86_64
#
mkdir -p build_darwin_x86_64 && pushd build_darwin_x86_64
export PKG_CONFIG_PATH_OLD=$PKG_CONFIG_PATH
#export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD:/usr/local/opt/openssl@3/lib/pkgconfig
cmake .. -DPLAT_MACOS_X86_64=true --toolchain $(pwd)/../cmake_modules/toolchain_macos_x86_64.cmake -DCMAKE_OSX_ARCHITECTURES="x86_64" &&
cmake .. -DPLAT_MACOS_X86_64=true --toolchain $(pwd)/../cmake_modules/toolchain_macos_x86_64.cmake -DCMAKE_OSX_ARCHITECTURES="x86_64" &&
(make -j $(nproc) PROTOBUF || make -j1 PROTOBUF) &&
( make -j1 openjkdf2-64 || make -j1 openjkdf2-64)
if [ $? -ne 0 ]; then
exit -1
fi
popd
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD
#
# ARM64
#
mkdir -p build_darwin64 && pushd build_darwin64
export PKG_CONFIG_PATH_OLD=$PKG_CONFIG_PATH
#export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD:/opt/homebrew/opt/openssl@3/lib/pkgconfig
cmake .. &&
(make -j $(nproc) PROTOBUF || make -j1 PROTOBUF) &&
(make -j $(nproc) openjkdf2-64 || make -j1 openjkdf2-64)
if [ $? -ne 0 ]; then
exit -1
fi
popd
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_OLD
./combine_macos_appbundles.sh
#zip -r macos-debug.zip OpenJKDF2_universal.app resource
#tar czf macos-debug.tar.gz OpenJKDF2_universal.app resource
tar czf macos-debug.tar.gz OpenJKDF2_universal.app
rm -rf build_darwin_x86_64
rm -rf build_darwin64
rm -rf OpenJKDF2.app
rm -rf OpenJKDF2_x86_64.app
rm -rf OpenJKDF2_arm64.app
rm -rf OpenJKDF2_universal.app