1bf215546Sopenharmony_ci#!/bin/bash
2bf215546Sopenharmony_ci
3bf215546Sopenharmony_ciset -ex
4bf215546Sopenharmony_ci
5bf215546Sopenharmony_ciexport LLVM_CONFIG="llvm-config-11"
6bf215546Sopenharmony_ci
7bf215546Sopenharmony_ci$LLVM_CONFIG --version
8bf215546Sopenharmony_ci
9bf215546Sopenharmony_cigit config --global user.email "mesa@example.com"
10bf215546Sopenharmony_cigit config --global user.name "Mesa CI"
11bf215546Sopenharmony_cigit clone \
12bf215546Sopenharmony_ci    https://github.com/llvm/llvm-project \
13bf215546Sopenharmony_ci    --depth 1 \
14bf215546Sopenharmony_ci    -b llvmorg-12.0.0-rc3 \
15bf215546Sopenharmony_ci    /llvm-project
16bf215546Sopenharmony_ci
17bf215546Sopenharmony_cimkdir /libclc
18bf215546Sopenharmony_cipushd /libclc
19bf215546Sopenharmony_cicmake -S /llvm-project/libclc -B . -G Ninja -DLLVM_CONFIG=$LLVM_CONFIG -DLIBCLC_TARGETS_TO_BUILD="spirv-mesa3d-;spirv64-mesa3d-" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DLLVM_SPIRV=/usr/bin/llvm-spirv
20bf215546Sopenharmony_cininja
21bf215546Sopenharmony_cininja install
22bf215546Sopenharmony_cipopd
23bf215546Sopenharmony_ci
24bf215546Sopenharmony_ci# workaroud cmake vs debian packaging.
25bf215546Sopenharmony_cimkdir -p /usr/lib/clc
26bf215546Sopenharmony_ciln -s /usr/share/clc/spirv64-mesa3d-.spv /usr/lib/clc/
27bf215546Sopenharmony_ciln -s /usr/share/clc/spirv-mesa3d-.spv /usr/lib/clc/
28bf215546Sopenharmony_ci
29bf215546Sopenharmony_cidu -sh *
30bf215546Sopenharmony_cirm -rf /libclc /llvm-project
31