1language: c
2addons:
3  apt:
4    sources:
5      - ubuntu-toolchain-r-test
6    packages:
7      - binutils-mingw-w64-i686
8      - binutils-mingw-w64-x86-64
9      - gcc-mingw-w64
10      - gcc-mingw-w64-base
11      - gcc-mingw-w64-i686
12      - gcc-mingw-w64-x86-64
13      - gcc-multilib
14      - tcl8.6-dev
15      - libx11-dev
16      - libnotify-dev
17      - libglib2.0-dev
18      - libxss-dev
19      - xvfb
20  homebrew:
21    packages:
22      - tcl-tk
23      - libnotify
24      - glib
25#   casks:
26#     - xquartz
27jobs:
28  include:
29# Testing on Linux GCC
30    - name: "Linux/GCC/Shared"
31      os: linux
32      dist: focal
33      services:
34        - xvfb
35      compiler: gcc
36      env:
37        - BUILD_DIR=unix
38      script: &x11gui
39        - make binaries libraries tktest
40        - make install
41        - make test-classic >out-classic.txt
42        - cat out-classic.txt
43        - grep -q "Failed	0" out-classic.txt
44        - make test-ttk >out-ttk.txt
45        - cat out-ttk.txt
46        - grep -q "Failed	0" out-ttk.txt
47    - name: "Linux/GCC/Shared: NO_DEPRECATED"
48      os: linux
49      dist: focal
50      services:
51        - xvfb
52      compiler: gcc
53      env:
54        - BUILD_DIR=unix
55        - CFGOPT="CFLAGS=-DTK_NO_DEPRECATED=1"
56      script: *x11gui
57    - name: "Linux/GCC/Shared/no-xft"
58      os: linux
59      dist: focal
60      services:
61        - xvfb
62      compiler: gcc
63      env:
64        - BUILD_DIR=unix
65        - CFGOPT="--disable-xft"
66      script: *x11gui
67    - name: "Linux/GCC/Shared/no-libnotify"
68      os: linux
69      dist: focal
70      services:
71        - xvfb
72      compiler: gcc
73      env:
74        - BUILD_DIR=unix
75        - CFGOPT="--disable-libnotify"
76      script: *x11gui
77    - name: "Linux/GCC/Shared/bionic"
78      os: linux
79      dist: bionic
80      services:
81        - xvfb
82      compiler: gcc
83      env:
84        - BUILD_DIR=unix
85      script: *x11gui
86    - name: "Linux/GCC/Shared/xenial"
87      os: linux
88      dist: xenial
89      services:
90        - xvfb
91      compiler: gcc
92      env:
93        - BUILD_DIR=unix
94      script: *x11gui
95    - name: "Linux/GCC/Static"
96      os: linux
97      dist: focal
98      compiler: gcc
99      env:
100        - BUILD_DIR=unix
101        - CFGOPT="--disable-shared"
102    - name: "Linux/GCC/Debug"
103      os: linux
104      dist: focal
105      compiler: gcc
106      env:
107        - BUILD_DIR=unix
108        - CFGOPT="--enable-symbols"
109    - name: "Linux/G++/Shared"
110      os: linux
111      dist: focal
112      compiler: g++
113      env:
114        - BUILD_DIR=unix
115        - CFGOPT="CC=g++ CFLAGS=-Dregister=dont+use+register"
116    - name: "Linux/G++/Shared UTF_MAX=4"
117      os: linux
118      dist: focal
119      compiler: g++
120      env:
121        - BUILD_DIR=unix
122        - CFGOPT="CC=g++ CFLAGS=-DTCL_UTF_MAX=4"
123    - name: "Linux/G++/Shared UTF_MAX=6"
124      os: linux
125      dist: focal
126      compiler: g++
127      env:
128        - BUILD_DIR=unix
129        - CFGOPT="CC=g++ CFLAGS=-DTCL_UTF_MAX=6"
130# Newer/Older versions of GCC
131    - name: "Linux/GCC 10/Shared"
132      os: linux
133      dist: focal
134      compiler: gcc-10
135      addons:
136        apt:
137          packages:
138            - g++-10
139      env:
140        - BUILD_DIR=unix
141    - name: "Linux/GCC 5/Shared"
142      os: linux
143      dist: bionic
144      compiler: gcc-5
145      addons:
146        apt:
147          packages:
148            - g++-5
149      env:
150        - BUILD_DIR=unix
151# Testing on Linux Clang
152    - name: "Linux/Clang/Shared"
153      os: linux
154      dist: focal
155      compiler: clang
156      env:
157        - BUILD_DIR=unix
158    - name: "Linux/Clang/Shared: NO_DEPRECATED"
159      os: linux
160      dist: focal
161      compiler: clang
162      env:
163        - BUILD_DIR=unix
164        - CFGOPT="CFLAGS=-DTK_NO_DEPRECATED=1"
165    - name: "Linux/Clang/Shared/no-xft"
166      os: linux
167      dist: focal
168      compiler: clang
169      env:
170        - BUILD_DIR=unix
171        - CFGOPT="--disable-xft"
172    - name: "Linux/Clang/Static"
173      os: linux
174      dist: focal
175      compiler: clang
176      env:
177        - CFGOPT="--disable-shared"
178        - BUILD_DIR=unix
179    - name: "Linux/Clang/Debug"
180      os: linux
181      dist: focal
182      compiler: clang
183      env:
184        - BUILD_DIR=unix
185        - CFGOPT="--enable-symbols"
186# Testing on Mac, various styles
187    - name: "macOS/Xcode 12/Shared"
188      os: osx
189      osx_image: xcode12
190      env:
191        - BUILD_DIR=unix
192        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include"
193    - name: "macOS/Clang++/Xcode 12/Shared"
194      os: osx
195      osx_image: xcode12
196      env:
197        - BUILD_DIR=unix
198        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib CC=clang++ --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-D__private_extern__=extern"
199    - name: "macOS/Xcode 12/Static"
200      os: osx
201      osx_image: xcode12
202      env:
203        - BUILD_DIR=unix
204        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --disable-shared CFLAGS=-I/usr/local/opt/tcl-tk/include"
205    - name: "macOS/Xcode 12/Debug"
206      os: osx
207      osx_image: xcode12
208      env:
209        - BUILD_DIR=unix
210        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --enable-symbols CFLAGS=-I/usr/local/opt/tcl-tk/include"
211#   - name: "macOS/Xcode 12/Shared/XQuartz"
212#     os: osx
213#     osx_image: xcode12
214#     env:
215#       - BUILD_DIR=unix
216#       - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --disable-corefoundation --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib CFLAGS=-I/usr/local/opt/tcl-tk/include"
217# Older MacOS versions
218    - name: "macOS/Xcode 11/Shared"
219      os: osx
220      osx_image: xcode11.7
221      env:
222        - BUILD_DIR=unix
223        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.14"
224    - name: "macOS/Xcode 10/Shared"
225      os: osx
226      osx_image: xcode10.3
227      addons:
228        homebrew:
229          packages:
230            - tcl-tk
231          update: true
232      env:
233        - BUILD_DIR=unix
234        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.14"
235    - name: "macOS/Xcode 9/Shared"
236      os: osx
237      osx_image: xcode9.4
238      addons:
239        homebrew:
240          packages:
241            - tcl-tk
242          update: true
243      env:
244        - BUILD_DIR=unix
245        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.13"
246# Test on Windows with MSVC native
247#   - name: "Windows/MSVC/Shared"
248#     os: windows
249#     compiler: cl
250#     env: &vcenv
251#       - BUILD_DIR=win
252#       - VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build"
253#     before_install: &vcpreinst
254#       - PATH="$PATH:$VCDIR"
255#       - cd ${BUILD_DIR}
256#     install: []
257#     script:
258#       - cmd.exe //C vcvarsall.bat x64 '&&' nmake '-f' makefile.vc all tktest
259# "make dist" only
260    - name: "Linux: make dist"
261      os: linux
262      dist: focal
263      compiler: gcc
264      env:
265        - BUILD_DIR=unix
266      script:
267        - make dist
268before_install:
269  - |-
270      case $TRAVIS_OS_NAME in
271        windows)
272          choco install -y magicsplat-tcl-tk
273          ;;
274      esac
275  - cd ${BUILD_DIR}
276install:
277  - mkdir "$HOME/install dir"
278  - ./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
279script:
280  - make all tktest
281  - make install
282before_cache:
283  - |-
284      case $TRAVIS_OS_NAME in
285        osx)
286          brew cleanup
287          ;;
288      esac
289cache:
290  directories:
291  - $HOME/Library/Caches/Homebrew
292  - $HOME/AppData/Local/Temp/chocolatey
293  - $HOME/AppData/Local/Apps/Tcl86
294