1bf215546Sopenharmony_ci#!/bin/bash
2bf215546Sopenharmony_ci
3bf215546Sopenharmony_ciset -ex
4bf215546Sopenharmony_ci
5bf215546Sopenharmony_cigit clone https://gitlab.freedesktop.org/mesa/piglit.git --single-branch --no-checkout /piglit
6bf215546Sopenharmony_cipushd /piglit
7bf215546Sopenharmony_cigit checkout b2c9d8f56b45d79f804f4cb5ac62520f0edd8988
8bf215546Sopenharmony_ci
9bf215546Sopenharmony_ci# TODO: Remove the following patch when piglit commit got past
10bf215546Sopenharmony_ci# 1cd716180cfb6ef0c1fc54702460ef49e5115791
11bf215546Sopenharmony_cigit apply $OLDPWD/.gitlab-ci/piglit/build-piglit_backport-s3-migration.diff
12bf215546Sopenharmony_ci
13bf215546Sopenharmony_cipatch -p1 <$OLDPWD/.gitlab-ci/piglit/disable-vs_in.diff
14bf215546Sopenharmony_cicmake -S . -B . -G Ninja -DCMAKE_BUILD_TYPE=Release $PIGLIT_OPTS $EXTRA_CMAKE_ARGS
15bf215546Sopenharmony_cininja $PIGLIT_BUILD_TARGETS
16bf215546Sopenharmony_cifind -name .git -o -name '*ninja*' -o -iname '*cmake*' -o -name '*.[chao]' | xargs rm -rf
17bf215546Sopenharmony_cirm -rf target_api
18bf215546Sopenharmony_ciif [ "x$PIGLIT_BUILD_TARGETS" = "xpiglit_replayer" ]; then
19bf215546Sopenharmony_ci    find ! -regex "^\.$" \
20bf215546Sopenharmony_ci         ! -regex "^\.\/piglit.*" \
21bf215546Sopenharmony_ci         ! -regex "^\.\/framework.*" \
22bf215546Sopenharmony_ci         ! -regex "^\.\/bin$" \
23bf215546Sopenharmony_ci         ! -regex "^\.\/bin\/replayer\.py" \
24bf215546Sopenharmony_ci         ! -regex "^\.\/templates.*" \
25bf215546Sopenharmony_ci         ! -regex "^\.\/tests$" \
26bf215546Sopenharmony_ci         ! -regex "^\.\/tests\/replay\.py" 2>/dev/null | xargs rm -rf
27bf215546Sopenharmony_cifi
28bf215546Sopenharmony_cipopd
29