-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathbuild_app.sh
executable file
·47 lines (40 loc) · 1.46 KB
/
build_app.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
#!/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-15 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-15 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 Scid.app/Contents
cp -R $Build_SourcesDirectory/resources/macos Scid.app/Contents/Resources
mv Scid.app/Contents/Resources/Info.plist Scid.app/Contents
cp -R $Build_SourcesDirectory/tcltk/lib Scid.app/Contents
rm -f Scid.app/Contents/lib/*.a
rm -f Scid.app/Contents/lib/*.sh
rm -Rf Scid.app/Contents/lib/pkgconfig
cd $Build_SourcesDirectory
if [[ "$(uname)" == "Darwin" ]]; then
STATIC_FLAGS="-lz -framework CoreFoundation"
else
STATIC_FLAGS="-lz -ldl"
fi
tcltk/bin/tclsh8.6 configure \
LINK="g++ $STATIC_FLAGS" \
SHAREDIR="$Build_SourcesDirectory/Scid.app/Contents/scid" \
BINDIR="$Build_SourcesDirectory/Scid.app/Contents/MacOS"
echo "Type \"make install\" to build the Scid.app."