1# This script shouldn't be run directly, but instead invoked by make_appimage.py
2# which runs this script in a Centos 6.8 docker container to create an app image
3
4# Arguments
5#   $1 clazy sha1 to build
6#   $2 user uid to chown the files to before leaving docker
7
8cp -r /clazy.AppDir /tmp/clazy_work/
9
10cd /llvm
11echo "LLVM sha1: `git rev-parse HEAD`" > /tmp/clazy_work/clazy.AppDir/sha1
12cd tools/clang
13echo "Clang sha1: `git rev-parse HEAD`" >> /tmp/clazy_work/clazy.AppDir/sha1
14
15cd /clazy
16echo "Clazy sha1: `git rev-parse HEAD`" >> /tmp/clazy_work/clazy.AppDir/sha1
17
18git clean -fdx .
19git checkout .
20
21echo "Running git pull..."
22git pull
23
24echo "Checking out $1..."
25git checkout $1
26
27echo "Building..."
28cmake3 -DCMAKE_BUILD_TYPE=Release -DLINK_CLAZY_TO_LLVM=OFF -DCMAKE_INSTALL_PREFIX=/tmp/clazy_work/clazy.AppDir/usr . && make -j12 && make install
29
30echo "Fixing permissions..."
31chown -R $2 /tmp/clazy_work/clazy.AppDir/
32
33cp /clazy/README.md /tmp/clazy_work/clazy.AppDir/
34cp /clazy/COPYING-LGPL2.txt /tmp/clazy_work/clazy.AppDir/
35
36
37echo "Done"
38echo
39