forked from manuelm/pvr.dvbviewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
148 lines (129 loc) · 4.69 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
matrix:
fast_finish: true
environment:
CONFIG: Debug
KODI_BRANCH: master # usually synced with APPVEYOR_REPO_BRANCH
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
PLATFORM: win32
MSVC_PLATFORM: x86
CONFIG: RelWithDebInfo
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
PLATFORM: win64
MSVC_PLATFORM: amd64
CONFIG: RelWithDebInfo
- APPVEYOR_BUILD_WORKER_IMAGE: ubuntu
PLATFORM: linux-x86_64
- APPVEYOR_BUILD_WORKER_IMAGE: ubuntu
PLATFORM: linux-clang-x86_64
- APPVEYOR_BUILD_WORKER_IMAGE: ubuntu
PLATFORM: rbpi-arm
init:
- ps: |
# set commit as build version
$commit = (($env:APPVEYOR_REPO_TAG_NAME, $env:APPVEYOR_REPO_COMMIT.SubString(0, 7)) -ne $null)[0]
Update-AppveyorBuild -Version ("{0}-{1}" -f $env:APPVEYOR_REPO_BRANCH, $commit)
$env:ROOT = (Resolve-Path "$env:APPVEYOR_BUILD_FOLDER/..").Path
install:
- sh: |
set -ex
case "$PLATFORM" in
"linux-clang-x86_64")
sudo apt-get install --yes --no-install-recommends --no-upgrade clang
export CC=clang CXX=clang++
;;
"rbpi-arm")
git clone -q --depth=1 https://github.com/raspberrypi/tools.git $ROOT/tools
# we don't need the firmware. fake it
mkdir -p $ROOT/firmware/opt/vc/include
;;
esac
before_build:
- ps: |
# download kodi
$env:KODI = "$env:ROOT/kodi"
git clone -q --branch="$env:KODI_BRANCH" --depth=1 https://github.com/xbmc/xbmc.git $env:KODI
- sh: |
unset cd pushd popd
set -ex
# generate toolchain file
params=()
case "$PLATFORM" in
"rbpi-arm")
params+=(
--with-platform=raspberry-pi2
--host=arm-linux-gnueabihf
--with-toolchain="$ROOT/tools/arm-bcm2708/arm-linux-gnueabihf"
--with-firmware="$ROOT/firmware"
--build=x86_64-linux
)
;;
esac
cd "$KODI/tools/depends"
sed -i 's/@platform_ldflags@//' target/Toolchain_binaddons.cmake.in
./bootstrap
./configure --prefix="$ROOT/kodi-build" --disable-debug ${params[@]}
sed -i 's/^$(TOOLCHAIN_FILE): /mytoolchain: /' xbmc-addons.include
make -C target/binary-addons mytoolchain
cp target/binary-addons/mytoolchain $ROOT/Toolchain_binaddons.cmake
echo "list(APPEND CMAKE_FIND_ROOT_PATH $ROOT)" >> $ROOT/Toolchain_binaddons.cmake
build_script:
# Setup Visual Studio compiler environment
- cmd: call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %MSVC_PLATFORM%
# Build addon
- ps: |
# rename pvr directory
Set-Location "$env:ROOT"
Move-Item "$env:APPVEYOR_PROJECT_SLUG" "$env:APPVEYOR_PROJECT_NAME"
# create build directory
New-Item -ItemType Directory -Force -Path "$env:ROOT/build"
Set-Location "$env:ROOT/build"
# build arguments
$params = @()
If ($isWindows) {
$overrides = "{0}/cmake/scripts/windows" -f $env:KODI
$params += '-G"NMake Makefiles"', `
"-DCMAKE_USER_MAKE_RULES_OVERRIDE=`"$overrides/CFlagOverrides.cmake`"", `
"-DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=`"$overrides/CXXFlagOverrides.cmake`""
}
Else {
$params += '-G"Unix Makefiles"'
}
If ($f = Get-Item "$env:ROOT/Toolchain_binaddons.cmake" -ea SilentlyContinue) {
$params += ("-DCMAKE_TOOLCHAIN_FILE=`"{0}`"" -f $f.FullName)
}
$params += `
"-DADDON_SRC_PREFIX=`"$env:ROOT`"", `
"-DADDONS_TO_BUILD=`"$env:APPVEYOR_PROJECT_NAME`"", `
"-DCMAKE_INSTALL_PREFIX=`"$env:ROOT/addons`"", `
"-DCMAKE_BUILD_TYPE=`"$env:CONFIG`"", `
"-DPACKAGE_ZIP=ON", `
"-DPACKAGE_DIR=`"$env:ROOT/zips`"", `
"`"$env:KODI/cmake/addons`""
# configure
Write-Host -ForegroundColor "Yellow" -Separator "`n" "Executing: ", "cmake", $params, ""
& cmake $params
# build
If ($isWindows) {
# appveyor triggers stderr writes as failure
& cmd /c 'cmake --build . --config %CONFIG% -- package-addons 2>&1'
}
Else {
& cmake --build . --config $env:CONFIG -- package-addons
}
after_build:
- ps: |
# rename and upload package
Set-Location "$env:ROOT/zips"
Move-Item "$env:APPVEYOR_PROJECT_NAME-*.zip" "$env:APPVEYOR_PROJECT_NAME-$env:PLATFORM.zip"
Get-ChildItem *.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
test: off
deploy:
# https://www.appveyor.com/docs/deployment/github/
- provider: GitHub
auth_token:
secure: Hs3QTqUrCfO4dc0ANGq33ns/IOHcjJzVbLY7yf70xE7DwGwIoVoA//OvJlMNX3wN
artifact: /$(appveyor_project_name)-.*\.zip/
draft: true
on:
appveyor_repo_tag: true # tags only