forked from benini/scid
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_app.sh
More file actions
executable file
·59 lines (51 loc) · 2.32 KB
/
build_app.sh
File metadata and controls
executable file
·59 lines (51 loc) · 2.32 KB
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
#!/bin/bash
if [ -z "$Build_SourcesDirectory" ]; then
Build_SourcesDirectory=$(pwd)
fi
cd $Build_SourcesDirectory
mkdir -p tcltk && cd tcltk
git clone --depth=1 --branch core-8-6-branch https://github.com/tcltk/tcl.git
cd tcl/unix
./configure --prefix=$Build_SourcesDirectory/tcltk --enable-64bit --disable-shared
make -j
make install
cd $Build_SourcesDirectory
mkdir -p tcltk && cd tcltk
git clone --depth=1 --branch core-8-6-branch https://github.com/tcltk/tk.git
# LAYOUT_WITH_BASE_CHUNKS is not thread safe
sed -i'' -e '/define TK_LAYOUT_WITH_BASE_CHUNKS/d' tk/macosx/tkMacOSXInt.h
sed -i'' -e '/define TK_DRAW_IN_CONTEXT/d' tk/macosx/tkMacOSXInt.h
cd tk/unix
./configure --prefix=$Build_SourcesDirectory/tcltk --enable-64bit --enable-aqua
make -j
make install
cd $Build_SourcesDirectory
mkdir -p ScidCommunity.app/Contents
cp -R $Build_SourcesDirectory/resources/macos ScidCommunity.app/Contents/Resources
mv ScidCommunity.app/Contents/Resources/Info.plist ScidCommunity.app/Contents
cp -R $Build_SourcesDirectory/tcltk/lib ScidCommunity.app/Contents
rm -f ScidCommunity.app/Contents/lib/*.a
rm -f ScidCommunity.app/Contents/lib/*.sh
rm -Rf ScidCommunity.app/Contents/lib/pkgconfig
# Inject dynamic version into Info.plist if SCIDCOMMUNITY_VERSION is set
if [ -n "$SCIDCOMMUNITY_VERSION" ]; then
PLIST="ScidCommunity.app/Contents/Info.plist"
# Update CFBundleGetInfoString ("ScidCommunity X")
sed -i'' -e "s|<key>CFBundleGetInfoString</key>[[:space:]]*<string>[^<]*</string>|<key>CFBundleGetInfoString</key>\n <string>ScidCommunity $SCIDCOMMUNITY_VERSION</string>|" "$PLIST"
# Update CFBundleShortVersionString
sed -i'' -e "s|<key>CFBundleShortVersionString</key>[[:space:]]*<string>[^<]*</string>|<key>CFBundleShortVersionString</key>\n <string>$SCIDCOMMUNITY_VERSION</string>|" "$PLIST"
fi
cd $Build_SourcesDirectory
if [[ "$(uname)" == "Darwin" ]]; then
EXTRA_TCL_LIBS="-lz -framework CoreFoundation"
else
EXTRA_TCL_LIBS="-lz -ldl"
fi
tcltk/bin/tclsh8.6 configure \
TCL_VERSION=8.6 \
LIBS="$EXTRA_TCL_LIBS" \
TCL_INCLUDE="-I$Build_SourcesDirectory/tcltk/include" \
TCL_LIBRARY="-L$Build_SourcesDirectory/tcltk/lib -ltcl8.6 -ltk8.6" \
SHAREDIR="$Build_SourcesDirectory/ScidCommunity.app/Contents/scid" \
BINDIR="$Build_SourcesDirectory/ScidCommunity.app/Contents/MacOS"
echo "Type \"make install\" to build the ScidCommunity.app."