Skip to content

Instantly share code, notes, and snippets.

@yagop
Last active May 8, 2018 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yagop/e8e156ac71c0dde05ae0649c36484251 to your computer and use it in GitHub Desktop.
Save yagop/e8e156ac71c0dde05ae0649c36484251 to your computer and use it in GitHub Desktop.
Compile clang-format on Ubuntu Xenial Docker
docker run -w /root -it ubuntu:xenial-20180417 /bin/bash
apt update
apt install curl xz-utils cmake ninja-build g++ python -y
curl -o llvm-6.0.0.src.tar.xz http://releases.llvm.org/6.0.0/llvm-6.0.0.src.tar.xz
tar xvf llvm-6.0.0.src.tar.xz
cd llvm-6.0.0.src/tools/
curl -o cfe-6.0.0.src.tar.xz http://releases.llvm.org/6.0.0/cfe-6.0.0.src.tar.xz
tar xvf cfe-6.0.0.src.tar.xz
mv cfe-6.0.0.src clang
cd ..
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_STATIC=true ..
ninja clang-format
# After building
docker cp <DOCKER_ID>:/root/llvm-6.0.0.src/build/bin/clang-format /tmp
cp clang-format /usr/local/bin/clang-format
fpm --rpm-autoprov -n clang-format-static -v 6.0.0.el7 -t rpm -s dir /usr/local/bin/clang-format
This file has been truncated, but you can view the full file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment