[igt-dev] [PATCH i-g-t v2] gitlab-ci: add build for MIPS

Guillaume Tucker
2019-06-13T14:01:06Z

Add Docker image and Gitlab CI steps to run builds for the MIPS
architecture using Debian Stretch with backports.

Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
---
.gitlab-ci.yml | 28 ++++++++++++++++++++++++++++
Dockerfile.debian-mips | 39 +++++++++++++++++++++++++++++++++++++++
meson-cross-mips.txt | 12 ++++++++++++
3 files changed, 79 insertions(+)
create mode 100644 Dockerfile.debian-mips
create mode 100644 meson-cross-mips.txt

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 771143a9ea95..e390f8f472d5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -90,6 +90,17 @@ build:tests-debian-meson-arm64:
paths:
- build

+build:tests-debian-meson-mips:
+ image: $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-mips:latest
+ stage: build
+ script:
+ - export PKG_CONFIG_PATH=/usr/lib/mips-linux-gnu/pkgconfig/
+ - meson --cross-file meson-cross-mips.txt build
+ - ninja -C build
+ artifacts:
+ paths:
+ - build
+
build:tests-debian-autotools:
image: $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian:latest
stage: build
@@ -221,6 +232,23 @@ containers:igt-debian-arm64:
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-arm64 -f Dockerfile.debian-arm64 .
- docker push $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-arm64

+containers:igt-debian-mips:
+ stage: containers
+ image: docker:stable
+ only:
+ changes:
+ - Dockerfile.debian-mips
+ - .gitlab-ci.yml
+ services:
+ - docker:dind
+ variables:
+ DOCKER_HOST: tcp://docker:2375
+ DOCKER_DRIVER: overlay2
+ script:
+ - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
+ - docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-mips -f Dockerfile.debian-mips .
+ - docker push $CI_REGISTRY/$CI_PROJECT_PATH/igt-debian-mips
+
containers:igt-fedora:
stage: containers
image: docker:stable
diff --git a/Dockerfile.debian-mips b/Dockerfile.debian-mips
new file mode 100644
index 000000000000..ebe08db644ea
--- /dev/null
+++ b/Dockerfile.debian-mips
@@ -0,0 +1,39 @@
+FROM debian:stretch-backports
+
+RUN apt-get update
+RUN apt-get install -y \
+ flex \
+ bison \
+ pkg-config \
+ libatomic1 \
+ x11proto-dri2-dev \
+ python-docutils \
+ valgrind \
+ peg
+
+RUN dpkg --add-architecture mips
+RUN apt-get update
+RUN apt-get install -y \
+ gcc-mips-linux-gnu \
+ libpciaccess-dev:mips \
+ libkmod-dev:mips \
+ libprocps-dev:mips \
+ libunwind-dev:mips \
+ libdw-dev:mips \
+ zlib1g-dev:mips \
+ liblzma-dev:mips \
+ libcairo-dev:mips \
+ libpixman-1-dev:mips \
+ libudev-dev:mips \
+ libgsl-dev:mips \
+ libasound2-dev:mips \
+ libjson-c-dev:mips \
+ libcurl4-openssl-dev:mips \
+ libxrandr-dev:mips \
+ libxv-dev:mips
+
+RUN apt-get install -t stretch-backports -y \
+ meson \
+ libdrm-dev:mips \
+ qemu-user \
+ qemu-user-static
diff --git a/meson-cross-mips.txt b/meson-cross-mips.txt
new file mode 100644
index 000000000000..6350d677e0bc
--- /dev/null
+++ b/meson-cross-mips.txt
@@ -0,0 +1,12 @@
+[binaries]
+c = '/usr/bin/mips-linux-gnu-gcc'
+ar = '/usr/bin/mips-linux-gnu-gcc-ar'
+strip = '/usr/bin/mips-linux-gnu-strip'
+pkgconfig = 'pkg-config'
+exe_wrapper = 'qemu-mips'
+
+[host_machine]
+system = 'linux'
+cpu_family = 'mips'
+cpu = 'mips'
+endian = 'big'
--
2.20.1