summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 14b8707434a887374b7554143bc6be46e18db94b (plain)
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
image: debian:unstable

before_script:
  - echo 'deb-src http://deb.debian.org/debian unstable main' >> /etc/apt/sources.list
  - apt-get update
  - apt-get build-dep --yes --no-install-recommends poppler
  - apt-get install --yes --no-install-recommends ninja-build libcurl4-openssl-dev git ca-certificates locales libc++-dev libc++abi-dev clang
  - echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
  - locale-gen

variables:
  LANG: en_US.UTF-8
  LANGUAGE: en_US:en
  LC_ALL: en_US.UTF-8
  TEST_DATA_URL: https://gitlab.freedesktop.org/${CI_PROJECT_NAMESPACE}/test.git
  UPSTREAM_TEST_DATA_URL: https://@gitlab.freedesktop.org/poppler/test.git

cache:
  key: "$CI_BUILD_NAME"
  paths:
    - build/

build:
  stage: build
  script:
    - git clone --branch ${CI_COMMIT_REF_NAME} --depth 1 ${TEST_DATA_URL} test-data || git clone --depth 1 ${UPSTREAM_TEST_DATA_URL} test-data
    - mkdir -p build && cd build
    - cmake -G Ninja -DTESTDATADIR=$PWD/../test-data ..
    - ninja
    - ctest --output-on-failure

build_clang_libcpp:
  stage: build
  script:
    - git clone --branch ${CI_COMMIT_REF_NAME} --depth 1 ${TEST_DATA_URL} test-data || git clone --depth 1 ${UPSTREAM_TEST_DATA_URL} test-data
    - mkdir -p build && cd build
    - CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data ..
    - ninja
    - ctest --output-on-failure

build_gcc_49:
  stage: build
  image: ubuntu:trusty
  before_script:
    - apt-get update
    - apt-get install --yes software-properties-common
    - add-apt-repository --yes ppa:ubuntu-toolchain-r/test
    - add-apt-repository --yes ppa:george-edison55/cmake-3.x
    - add-apt-repository --yes ppa:ricotz/testing
    - add-apt-repository --yes ppa:aacid/openjp2trusty
    - apt-get update
    - apt-get install --yes build-essential cmake ninja-build gcc-4.9 g++-4.9 libjpeg-dev libopenjp2-7-dev qtbase5-dev gobject-introspection libglib2.0-dev libgtk-3-dev libgirepository1.0-dev libnss3-dev
    - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20
    - update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20
    - update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.9 20
  script:
    - mkdir -p build && cd build
    - cmake -G Ninja ..
    - ninja

build_mingw64_fedora:
  stage: build
  image: fedora
  before_script:
    - yum -y install yum-utils
    - yum-builddep -y mingw64-poppler
    - yum -y install mingw64-curl make ninja-build mingw64-openjpeg2-tools mingw32-openjpeg2-tools
    - mv /usr/x86_64-w64-mingw32/sys-root/mingw/bin/opj2_decompress.exe /usr/x86_64-w64-mingw32/sys-root/mingw/bin/opj_decompress.exe
    - mv /usr/x86_64-w64-mingw32/sys-root/mingw/bin/opj2_compress.exe /usr/x86_64-w64-mingw32/sys-root/mingw/bin/opj_compress.exe
    - mv /usr/x86_64-w64-mingw32/sys-root/mingw/bin/opj2_dump.exe /usr/x86_64-w64-mingw32/sys-root/mingw/bin/opj_dump.exe
  script:
    - sed -i '/SYSTEM/d' glib/CMakeLists.txt
    - mkdir -p build && cd build
    - mingw64-cmake -G Ninja ..
    - ninja