forked from analogdevicesinc/scopy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
106 lines (80 loc) · 6.61 KB
/
appveyor.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
clone_depth: 1
#init:
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
environment:
matrix:
- MINGW_VERSION: mingw32
ARCH: i686
ARCH_BIT: 32
- MINGW_VERSION: mingw64
ARCH: x86_64
ARCH_BIT: 64
matrix:
fast_finish: true
install:
# Remove dependencies that prevent us from upgrading to GCC 6.2
- C:\msys64\usr\bin\bash -lc "pacman -Rs --noconfirm mingw-w64-i686-gcc-ada mingw-w64-i686-gcc-fortran mingw-w64-i686-gcc-libgfortran mingw-w64-i686-gcc-objc"
- C:\msys64\usr\bin\bash -lc "pacman -Rs --noconfirm mingw-w64-x86_64-gcc-ada mingw-w64-x86_64-gcc-fortran mingw-w64-x86_64-gcc-libgfortran mingw-w64-x86_64-gcc-objc"
- C:\msys64\usr\bin\bash -lc "pacman -Syu --noconfirm "
- C:\msys64\usr\bin\bash -lc "pacman -Syu --noconfirm "
# Remove existing file that causes GCC install to fail
- C:\msys64\usr\bin\bash -lc "rm /mingw32/etc/gdbinit /mingw64/etc/gdbinit"
# Update to GCC 6.2 and install dependencies
- C:\msys64\usr\bin\bash -lc "pacman --noconfirm -Sy mingw-w64-%ARCH%-gcc mingw-w64-%ARCH%-boost mingw-w64-%ARCH%-python3 mingw-w64-%ARCH%-fftw mingw-w64-%ARCH%-libzip mingw-w64-%ARCH%-glibmm mingw-w64-%ARCH%-matio"
# Install older version of hdf5
- C:\msys64\usr\bin\bash -lc "wget -q http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-hdf5-1.8.21-2-any.pkg.tar.xz"
- C:\msys64\usr\bin\bash -lc "pacman -U --force --noconfirm mingw-w64-${ARCH}-hdf5-1.8.21-2-any.pkg.tar.xz"
# Install breakpad lib
- C:\msys64\usr\bin\bash -lc "wget -q http://repo.msys2.org/mingw/%ARCH%/mingw-w64-%ARCH%-breakpad-git-r1680.70914b2d-1-any.pkg.tar.xz"
- C:\msys64\usr\bin\bash -lc "pacman -U --force --noconfirm mingw-w64-%ARCH%-breakpad-git-r1680.70914b2d-1-any.pkg.tar.xz"
- C:\msys64\usr\bin\bash -lc "pacman -S --noconfirm mingw-w64-%ARCH%-qt5"
- C:\msys64\usr\bin\bash -lc "wget -q http://repo.msys2.org/mingw/%ARCH%/mingw-w64-%ARCH%-libusb-1.0.21-2-any.pkg.tar.xz"
- C:\msys64\usr\bin\bash -lc "pacman -U --force --noconfirm mingw-w64-%ARCH%-libusb-1.0.21-2-any.pkg.tar.xz"
# Install pre-compiled libraries
- 'appveyor DownloadFile "https://ci.appveyor.com/api/projects/analogdevicesinc/scopy-mingw-build-deps/artifacts/scopy-%MINGW_VERSION%-build-deps.tar.xz?branch=master&job=Environment: MINGW_VERSION=%MINGW_VERSION%, ARCH=%ARCH%" -FileName C:\scopy-%MINGW_VERSION%-build-deps.tar.xz'
- C:\msys64\usr\bin\bash -lc "cd /c ; tar xJf scopy-%MINGW_VERSION%-build-deps.tar.xz"
# Download a 32-bit version of windres.exe
- appveyor DownloadFile http://swdownloads.analog.com/cse/build/windres.exe.gz -FileName C:\windres.exe.gz
- C:\msys64\usr\bin\bash -lc "cd /c ; gunzip windres.exe.gz"
# Hack: Qt5Qml CMake script throws errors when loading its plugins. So let's just drop those plugins.
- C:\msys64\usr\bin\bash -lc "rm -f /%MINGW_VERSION%/lib/cmake/Qt5Qml/*Factory.cmake"
# Install Inno Setup
- choco install InnoSetup
build_script:
- set OLD_PATH=%PATH%
- set DEST_FOLDER=scopy_%ARCH_BIT%
- set BUILD_FOLDER=build_%ARCH_BIT%
- set DEBUG_FOLDER=debug_%ARCH_BIT%
- set RC_COMPILER=
- IF "%ARCH_BIT%"=="32" (
set RC_COMPILER="-DCMAKE_RC_COMPILER=/c/windres.exe"
)
- set PATH=C:\msys64\%MINGW_VERSION%\bin;%PATH%
- C:\msys64\usr\bin\bash -lc "mkdir /c/%BUILD_FOLDER% ; cd /c/%BUILD_FOLDER% ; cmake -G 'Unix Makefiles' %RC_COMPILER% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGIT_EXECUTABLE=/c/Program\\ Files/Git/cmd/git.exe -DPKG_CONFIG_EXECUTABLE=/%MINGW_VERSION%/bin/pkg-config.exe -DCMAKE_C_COMPILER=%ARCH%-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER=%ARCH%-w64-mingw32-g++.exe /c/projects/scopy"
- C:\msys64\usr\bin\bash -lc "cd /c/%BUILD_FOLDER%/resources && sed -i 's/^\(FILEVERSION .*\)$/\1,0,"{build}"/' properties.rc"
- C:\msys64\usr\bin\bash -lc "cd /c/build_%ARCH_BIT% && make -j3"
# Copy the dependencies
- mkdir c:\%DEST_FOLDER%
- copy c:\%BUILD_FOLDER%\Scopy.exe c:\%DEST_FOLDER%\
- c:\msys64\%MINGW_VERSION%\bin\windeployqt.exe --dir c:\%DEST_FOLDER% --release --no-system-d3d-compiler --no-compiler-runtime --no-quick-import --opengl --printsupport c:\%BUILD_FOLDER%\Scopy.exe
- C:\msys64\usr\bin\bash -lc "cp -r /c/projects/scopy/resources/decoders /c/%DEST_FOLDER%/"
- C:\msys64\usr\bin\bash -lc "tar -C /c/%DEST_FOLDER% --strip-components=3 -xJf /c/scopy-%MINGW_VERSION%-build-deps.tar.xz msys64/%MINGW_VERSION%/bin"
- C:\msys64\usr\bin\bash -lc "cd /%MINGW_VERSION%/bin ; cp -r libmatio-*.dll libhdf5-*.dll libszip*.dll libpcre*.dll libdouble-conversion*.dll libwinpthread-*.dll libgcc_*.dll libstdc++-*.dll libboost_{system,filesystem,atomic,program_options,regex,thread}-*.dll libglib-*.dll libintl-*.dll libiconv-*.dll libglibmm-2.*.dll libgmodule-2.*.dll libgobject-2.*.dll libffi-*.dll libsigc-2.*.dll libfftw3f-*.dll libicu{in,uc,dt}[!d]*.dll zlib*.dll libharfbuzz-*.dll libfreetype-*.dll libbz2-*.dll libpng16-*.dll libgraphite2.dll libjpeg-*.dll libsqlite3-*.dll libwebp-*.dll libxml2-*.dll liblzma-*.dll libxslt-*.dll libzip*.dll libpython3.*.dll libgnutls*.dll libnettle*.dll libhogweed*.dll libgmp*.dll libidn*.dll libp11*.dll libtasn*.dll libunistring*.dll libusb-*.dll /%MINGW_VERSION%/lib/python3.* /c/%DEST_FOLDER%/"
- mkdir C:\scopy_%ARCH_BIT%\.debug
# - C:\msys64\usr\bin\bash -lc "/%MINGW_VERSION%/bin/objcopy -v --only-keep-debug /c/%DEST_FOLDER%/Scopy.exe /c/%DEST_FOLDER%/.debug/Scopy.exe.debug"
- C:\msys64\usr\bin\bash -lc "dump_syms /c/%DEST_FOLDER%/Scopy.exe > /c/%DEST_FOLDER%/Scopy.exe.sym"
# - ps: C:\msys64\%MINGW_VERSION%\bin\strip.exe --strip-debug --strip-unneeded "C:\%DEST_FOLDER%\Scopy.exe"
# - ps: C:\msys64\%MINGW_VERSION%\bin\objcopy.exe -v --add-gnu-debuglink="C:\%DEST_FOLDER%\.debug\Scopy.exe.debug" "C:\%DEST_FOLDER%\Scopy.exe"
- mkdir C:\%DEBUG_FOLDER%
- mv C:\%DEST_FOLDER%\Scopy.exe.sym C:\%DEBUG_FOLDER%
- mv C:\%DEST_FOLDER%\.debug C:\%DEBUG_FOLDER%
- 7z a "c:\scopy-%ARCH_BIT%bit.zip" c:\%DEST_FOLDER%
- appveyor PushArtifact c:\scopy-%ARCH_BIT%bit.zip
- 7z a "C:\debug-%ARCH_BIT%bit.zip" c:\%DEBUG_FOLDER%
- appveyor PushArtifact C:\debug-%ARCH_BIT%bit.zip
# Build the installer
- set PATH=%PATH%;"C:\Program Files (x86)\Inno Setup 5"
- ISCC /Q C:\%BUILD_FOLDER%\scopy-%ARCH_BIT%.iss
- appveyor PushArtifact C:\scopy-%ARCH_BIT%-setup.exe
#on_finish:
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))