Commit a5fd609a authored by Chuck Atkins's avatar Chuck Atkins

Added an el7 build

parent 6129c831
mesa-*-.tar.xz
mesa-*.tar.xz
*.s??
FROM centos:7
MAINTAINER Chuck Atkins <chuck.atkins@kitware.com>
RUN yum install -y tar zlib gzip xz wget which
# Install development tools and X libraries
RUN yum install -y \
git grep libtool autoconf automake \
libX11-devel libXext-devel libxcb-devel \
bison flex make gcc gcc-c++ python python-mako
# Cleanup
RUN yum clean all
RUN mkdir -p /opt
# Install the most recent CMake release
RUN cd /opt && \
wget https://cmake.org/files/v3.5/cmake-3.5.2-Linux-x86_64.tar.gz && \
tar -xvf cmake-3.5.2-Linux-x86_64.tar.gz && \
rm -f cmake-3.5.2-Linux-x86_64.tar.gz
# Build and install LLVM
RUN cd /opt && \
wget http://llvm.org/releases/3.8.0/llvm-3.8.0.src.tar.xz && \
tar -xvf llvm-3.8.0.src.tar.xz && \
mkdir llvm-3.8.0.bld && \
cd llvm-3.8.0.bld && \
/opt/cmake-3.5.2-Linux-x86_64/bin/cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/llvm-3.8.0 \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DLLVM_INSTALL_UTILS=ON \
/opt/llvm-3.8.0.src && \
make -j$(grep -c "^processor" /proc/cpuinfo) install && \
cd /opt && \
rm -rf llvm-3.8.0.src.tar.xz llvm-3.8.0.src llvm-3.8.0.bld \
cmake-3.5.2-Linux-x86_64
# Add the Mesa build script
ADD build-mesa.sh /opt/build-mesa.sh
RUN chmod +x /opt/build-mesa.sh
# Setup the shared mount point
RUN mkdir /mnt/shared
# Run the Mesa build script with new compilers enabled
ENTRYPOINT /opt/build-mesa.sh
#!/bin/bash
docker build --rm -t mesa-el7-build .
#!/bin/bash
export PATH=/opt/llvm-3.8.0/bin:$PATH
cd /opt
git clone git://anongit.freedesktop.org/git/mesa/mesa mesa-source
cd mesa-source
VER=$(cat VERSION)-$(git log --pretty=format:"%h %ci" | head -1 | sed 's|-||g' | awk '{print $2"-"$1}')-el7
NOCONFIGURE=1 ./autogen.sh
##########
# Option summary:
##########
# Enable GL APIs
# --enable-opengl --disable-gles1 --disable-gles2
# Disable extra state trackers that we don't care about
# --disable-va --disable-gbm --disable-xvmc --disable-vdpau
# Turn on GLdispatch
# --enable-shared-glapi
# Set up desired library features
# --disable-texture-float
# Turn off DRI (we're not using any of it)
# --disable-dri --with-dri-drivers=
# Turn on the Gallium infrastructure
# --enable-gallium-llvm
# Use LLVM's shared libraries so we don't bloat the binaries too much
# --enable-llvm-shared-libs
# Turn on only software rasterizers
# --with-gallium-drivers=swrast,swr
# Turn off EGL
# --disable-egl --disable-gbm --with-egl-platforms=
# Turn on Gallium based OSMesa
# --enable-gallium-osmesa
# Turn on GLX (auto-determined backend)
# --enable-glx
# Setup flags for LTO to shrink resultng binaries
./configure \
--enable-opengl --disable-gles1 --disable-gles2 \
--disable-va --disable-gbm --disable-xvmc --disable-vdpau \
--enable-shared-glapi \
--disable-texture-float \
--disable-dri --with-dri-drivers= \
--enable-gallium-llvm --enable-llvm-shared-libs \
--with-gallium-drivers=swrast,swr \
--disable-egl --disable-gbm --with-egl-platforms= \
--enable-gallium-osmesa \
--enable-glx \
--prefix=/opt/mesa-${VER}
make -j$(grep -c "^processor" /proc/cpuinfo)
make install
cd /opt
# Before packaging up the install, get rid of the location-specific files
rm -rf /opt/mesa-${VER}/lib/pkgconfig /opt/mesa-${VER}/lib/*.la
# Copy in the nexessary LLVM dependencies
cp -P /opt/llvm-3.8.0/lib/libLLVM*.so* /opt/mesa-${VER}/lib
cp -P /opt/llvm-3.8.0/lib/libLTO*.so* /opt/mesa-${VER}/lib
# Make the archive
tar -cJvf mesa-${VER}.tar.xz mesa-${VER}
cp mesa-${VER}.tar.xz /mnt/shared
if [ -n "${HOSTUID}" ]
then
chown ${HOSTUID} /mnt/shared/mesa-${VER}.tar.xz
fi
if [ -n "${HOSTGID}" ]
then
chgrp ${HOSTGID} /mnt/shared/mesa-${VER}.tar.xz
fi
#!/bin/bash
docker run -i \
--volume="${PWD}:/mnt/shared:rw" \
-e HOSTUID=$(id -u) -e HOSTGID=$(id -g) \
-t mesa-el7-build
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment