forked from olive-editor/olive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor-build.sh
58 lines (44 loc) · 1.35 KB
/
appveyor-build.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
# Set architecture
ARCH=x86_64
MINGW_PATH=mingw64
NSISDEF=-DX64
# Update packages
pacman -Syu --noconfirm
# Install necessary packages
pacman -S --noconfirm --needed mingw-w64-$ARCH-toolchain mingw-w64-$ARCH-cmake mingw-w64-$ARCH-ninja mingw-w64-$ARCH-qt5 mingw-w64-$ARCH-ffmpeg mingw-w64-$ARCH-openimageio mingw-w64-$ARCH-opencolorio
# Generate Ninja Makefiles
cmake . -G "Ninja" -DCMAKE_BUILD_TYPE=Debug
# Compile
ninja
# Get Git hash
GITHASH=$(git rev-parse --short=7 HEAD)
# Build finished, time to package
mkdir olive
# Copy main executable in
cd olive
cp ../app/olive-editor.exe .
# Inject Qt libraries
windeployqt --debug olive-editor.exe
# Inject all other libraries (loops over dependency output from ldd)
ldd olive-editor.exe | while read -r dep
do
# Acquire full path to dependency
dep_output=( $dep )
dep_path=${dep_output[2]}
# If this is a mingw dependency, copy it into the deploy folder
if [[ $dep_path == /$MINGW_PATH* ]]
then
cp $dep_path .
fi
done
# For some reason, this dep doesn't get listed by ldd but is necessary regardless
cp /$MINGW_PATH/bin/libcrypto*.dll .
# Create package name
PKGNAME=Olive-$GITHASH-Windows-$ARCH
# Package installer
cd ..
cp app/packaging/windows/nsis/* .
"/c/Program Files (x86)/NSIS/makensis.exe" -V4 $NSISDEF "-XOutFile $PKGNAME.exe" olive.nsi
# Package portable
touch olive/portable
7z a $PKGNAME.zip olive