9 # Fail early if environment not set
10 [ -z "$BUILD_ARCHIVE_NAME" ] && fail "BUILD_ARCHIVE_NAME has to be set"
11 [ -z "$BUILD_PARALLEL_THREADS" ] && fail "BUILD_PARALLEL_THREADS has to be set"
13 # Unpack archived dependencies
14 cd ../dependencies64 || fail "Could not enter ../dependencies64"
15 tar xvJf large_files_linux.tar.xz || fail "Could not unpack large_files_linux.tar.xz"
17 # Clean and enter shadow build folder
19 if [ -e ../build ]; then
20 rm -Rf ../build || fail "Could not delete ../build"
23 mkdir ../build || fail "Could not create ../build"
24 cd ../build || fail "Could not enter ../build"
28 cmake -G "Unix Makefiles" -A x64 -DCMAKE_BUILD_TYPE=RelWithDebInfo .. || fail "cmake failed"
30 # Run make using the number of hardware threads in BUILD_PARALLEL_THREADS
32 /usr/bin/time -f 'Build time %E' make -j$BUILD_PARALLEL_THREADS || fail "make failed"
34 # Create client folder to later zip
35 export SERVER_FOLDER="$BUILD_ARCHIVE_NAME"
36 if [ -f "$SERVER_FOLDER" ]; then
37 rm -Rf "$SERVER_FOLDER" || fail "Could not delete $SERVER_FOLDER"
39 mkdir "$SERVER_FOLDER" || fail "Could not create $SERVER_FOLDER"
40 mkdir "$SERVER_FOLDER/bin" || fail "Could not create $SERVER_FOLDER/bin"
41 mkdir "$SERVER_FOLDER/lib" || fail "Could not create $SERVER_FOLDER/lib"
43 # Copy compiled binaries
44 echo Copying binaries...
45 cp -f shell/lib* "$SERVER_FOLDER/lib/" || fail "Could not copy server libraries"
46 cp -f shell/*.ttf "$SERVER_FOLDER/" || fail "Could not copy font(s)"
47 cp -f shell/casparcg "$SERVER_FOLDER/bin/" || fail "Could not copy server executable"
48 cp -f shell/casparcg.config "$SERVER_FOLDER/" || fail "Could not copy server config"
49 cp -Rf shell/locales "$SERVER_FOLDER/bin/" || fail "Could not copy server CEF locales"
51 # Copy binary dependencies
52 echo Copying binary dependencies...
53 cp -Rf ../deploy/linux/* "$SERVER_FOLDER/" || fail "Could not copy binary dependencies"
54 cp -f ../deploy/general/*.pdf "$SERVER_FOLDER/" || fail "Could not copy pdf"
55 cp -Rf ../deploy/general/wallpapers "$SERVER_FOLDER/" || fail "Could not copy wallpapers"
56 cp -Rf ../deploy/general/server/media "$SERVER_FOLDER/" || fail "Could not copy media"
59 echo Copying documentation...
60 cp -f ../CHANGELOG "$SERVER_FOLDER/" || fail "Could not copy CHANGELOG"
61 cp -f ../README "$SERVER_FOLDER/" || fail "Could not copy README"
62 cp -f ../LICENSE "$SERVER_FOLDER/" || fail "Could not copy LICENSE"
65 echo Creating tag.gz...
66 tar -cvzf "$BUILD_ARCHIVE_NAME.tar.gz" "$SERVER_FOLDER" || fail "Could not create archive"