| 1 |
FROM centos:6.8 |
| 2 |
MAINTAINER Sergio Martins ([email protected]) |
| 3 |
|
| 4 |
WORKDIR / |
| 5 |
RUN yum update -y |
| 6 |
RUN yum install -y git wget zip texinfo bison flex svn boost-regex boost-devel |
| 7 |
|
| 8 |
RUN wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo |
| 9 |
RUN yum install -y devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++ |
| 10 |
|
| 11 |
ENV PATH=/opt/rh/devtoolset-2/root/usr/bin/:$PATH |
| 12 |
|
| 13 |
# Build GCC |
| 14 |
WORKDIR / |
| 15 |
RUN svn co svn://gcc.gnu.org/svn/gcc/tags/gcc_5_4_0_release/ |
| 16 |
WORKDIR /gcc_5_4_0_release/ |
| 17 |
RUN ./contrib/download_prerequisites |
| 18 |
RUN mkdir /gcc_5_4_0_release_build/ |
| 19 |
WORKDIR /gcc_5_4_0_release_build/ |
| 20 |
RUN ../gcc_5_4_0_release/configure --disable-multilib |
| 21 |
RUN make -j12 |
| 22 |
RUN make install |
| 23 |
RUN echo "/usr/local/lib64" > /etc/ld.so.conf.d/newStdLib.conf |
| 24 |
RUN ldconfig |
| 25 |
|
| 26 |
ENV CXX=/usr/local/bin/g++ |
| 27 |
ENV CC=/usr/local/bin/gcc |
| 28 |
|
| 29 |
# Copy appdir template |
| 30 |
ADD clazy.AppDir /clazy.AppDir/ |
| 31 |
|
| 32 |
# Build Python |
| 33 |
WORKDIR / |
| 34 |
RUN wget https://www.python.org/ftp/python/2.7.16/Python-2.7.16.tgz |
| 35 |
RUN tar xzf Python-2.7.16.tgz |
| 36 |
WORKDIR /Python-2.7.16 |
| 37 |
RUN ./configure --enable-optimizations |
| 38 |
RUN make -j8 altinstall |
| 39 |
RUN ln -sf /usr/local/bin/python2.7 /usr/local/bin/python |
| 40 |
|
| 41 |
#Build CMake |
| 42 |
WORKDIR / |
| 43 |
RUN git clone https://github.com/Kitware/CMake.git |
| 44 |
WORKDIR /CMake |
| 45 |
RUN git checkout v3.15.4 |
| 46 |
RUN ./configure --prefix=/usr/ |
| 47 |
RUN make -j8 |
| 48 |
RUN make install |
| 49 |
|
| 50 |
#Build LLVM |
| 51 |
WORKDIR / |
| 52 |
RUN wget -O - https://github.com/llvm/llvm-project/tarball/llvmorg-11.0.0 | tar xz |
| 53 |
RUN mv llvm-llvm-project-* llvm-project |
| 54 |
WORKDIR /llvm-project/ |
| 55 |
RUN echo "LLVM sha1: `git rev-parse HEAD`" > /clazy.AppDir/sha1 |
| 56 |
|
| 57 |
RUN mkdir /root/build_llvm/ |
| 58 |
WORKDIR /root/build_llvm/ |
| 59 |
RUN cmake -DCMAKE_INSTALL_PREFIX=/usr/ -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON -DCLANG_ENABLE_CLANGD=OFF /llvm-project/llvm/ |
| 60 |
RUN make -j8 |
| 61 |
RUN make install |
| 62 |
RUN make DESTDIR=/clazy.AppDir install |
| 63 |
RUN rm -rf /clazy.AppDir/usr/include/ |
| 64 |
RUN rm -rf /clazy.AppDir/usr/share/ |
| 65 |
RUN rm -rf /clazy.AppDir/usr/lib/*.a |
| 66 |
RUN rm -rf /clazy.AppDir/usr/lib/*.so* |
| 67 |
RUN rm -rf /clazy.AppDir/usr/lib/cmake |
| 68 |
RUN rm -rf /clazy.AppDir/usr/bin/ll* |
| 69 |
WORKDIR /clazy.AppDir/usr/bin/ |
| 70 |
RUN rm -rf bugpoint clang-change-namespace clang-doc clang-format verify-uselistorder c-index-test clang-include-fixer clang-query clang-rename clang-scan-deps diagtool find-all-symbols hmaptool obj2yaml sancov scan-build verify-uselistorderc-index-test clang-check clang-extdef-mapping clang-import-test clang-offload-bundler clang-refactor clang-reorder-fields clang-tidy dsymutil git-clang-format modularize opt sanstats scan-view yaml2obj |
| 71 |
RUN chmod +x * |
| 72 |
|
| 73 |
#Clone clazy |
| 74 |
WORKDIR / |
| 75 |
RUN git clone https://github.com/KDE/clazy.git |