aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.dockerignore3
-rw-r--r--docker-compose.yml8
-rw-r--r--docker/stretch/Dockerfile165
-rwxr-xr-xscripts/install-qt.sh7
4 files changed, 41 insertions, 142 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 000000000..a949bb5a2
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,3 @@
+*
+!docker/*
+!scripts/*
diff --git a/docker-compose.yml b/docker-compose.yml
index bff8f5d87..251b09679 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -4,11 +4,11 @@ services:
stretch:
image: ${DOCKER_USER:-qbsbuild}/qbsdev:stretch
build:
- dockerfile: Dockerfile
- context: docker/stretch/
+ dockerfile: docker/stretch/Dockerfile
+ context: .
args:
- QT_VERSION: 5.11.3
- QBS_VERSION: 1.13.0
+ QT_VERSION: 5.12.4
+ QTCREATOR_VERSION: 4.9.2
working_dir: /qbs
volumes:
- .:/qbs
diff --git a/docker/stretch/Dockerfile b/docker/stretch/Dockerfile
index d7258f97f..736bd1ef7 100644
--- a/docker/stretch/Dockerfile
+++ b/docker/stretch/Dockerfile
@@ -3,123 +3,14 @@
# installer. We do it in a separate stage to keep the number of dependencies low
# in the final Docker image.
#
-FROM debian:9 as build-qt-linux-x86_64
-ARG QT_VERSION
-
-# Downloader dependencies
-RUN apt-get update -qq && \
- apt-get install -qq -y --no-install-recommends \
- ca-certificates \
- xz-utils \
- wget
-
-# Download
-RUN mkdir -p /qt/source && \
- wget -nv --continue --tries=20 --waitretry=10 --retry-connrefused \
- --no-dns-cache --timeout 300 -qO- \
- https://download.qt.io/official_releases/qt/${QT_VERSION%??}/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz \
- | tar --strip-components=1 -C /qt/source -xJf-
-
-# Build dependencies
-RUN apt-get update -qq && \
- apt-get install -qq -y --no-install-recommends \
- autoconf \
- automake \
- autopoint \
- binutils \
- bison \
- build-essential \
- flex \
- intltool \
- libclang-3.9-dev \
- libgdk-pixbuf2.0-dev \
- libffi-dev \
- libfontconfig1-dev \
- libfreetype6-dev \
- libgmp-dev \
- libicu-dev \
- libmpc-dev \
- libmpfr-dev \
- libtool \
- libtool-bin \
- libx11-dev \
- libxext-dev \
- libxfixes-dev \
- libxi-dev \
- libxrender-dev \
- libxcb1-dev \
- libx11-xcb-dev \
- libxcb-glx0-dev \
- libz-dev \
- python \
- openssl
-
-ENV LLVM_INSTALL_DIR=/usr/lib/llvm-3.9
-
-# Build Qt
-RUN mkdir -p qt/build && \
- cd qt/build && \
- ../source/configure \
- -prefix /opt/qt5-linux-x86_64 \
- -release \
- -shared \
- -opensource \
- -confirm-license \
- -nomake examples \
- -nomake tests \
- -platform linux-g++ \
- -no-use-gold-linker \
- -R . \
- -sysconfdir /etc/xdg \
- -qt-freetype -qt-harfbuzz -qt-pcre -qt-sqlite -qt-xcb -qt-zlib \
- -no-cups -no-dbus -no-pch -no-libudev \
- -no-feature-accessibility -no-opengl \
- -skip qtactiveqt \
- -skip qt3d \
- -skip qtcanvas3d \
- -skip qtcharts \
- -skip qtconnectivity \
- -skip qtdatavis3d \
- -skip qtdoc \
- -skip qtgamepad \
- -skip qtgraphicaleffects \
- -skip qtimageformats \
- -skip qtlocation \
- -skip qtmultimedia \
- -skip qtnetworkauth \
- -skip qtquickcontrols \
- -skip qtquickcontrols2 \
- -skip qtpurchasing \
- -skip qtremoteobjects \
- -skip qtscxml \
- -skip qtsensors \
- -skip qtserialbus \
- -skip qtspeech \
- -skip qtsvg \
- -skip qttranslations \
- -skip qtwayland \
- -skip qtvirtualkeyboard \
- -skip qtwebchannel \
- -skip qtwebengine \
- -skip qtwebsockets \
- -skip qtwebview \
- -skip qtwinextras \
- -skip qtxmlpatterns \
- -skip qtx11extras
-
-RUN cd qt/build && \
- make -j $(nproc --all) | stdbuf -o0 tr -cd '\n' | stdbuf -o0 tr '\n' '.' && \
- make install
-
-# Build a stable Qbs release
FROM debian:9
LABEL Description="Debian development environment for Qbs with Qt and various dependencies for testing Qbs modules and functionality"
-ARG QBS_VERSION=1.13.0
+ARG QT_VERSION
+ARG QTCREATOR_VERSION
# Allow colored output on command line.
ENV TERM=xterm-color
-
#
# Make it possible to change UID/GID in the entrypoint script. The docker
# container usually runs as root user on Linux hosts. When the Docker container
@@ -131,7 +22,8 @@ ENV TERM=xterm-color
ARG USER_UID=1000
ARG USER_NAME=devel
RUN apt-get update -qq && \
- apt-get install -qq -y \
+ apt-get install -qq -y --no-install-recommends \
+ ca-certificates \
gosu \
sudo && \
groupadd -g ${USER_UID} ${USER_NAME} && \
@@ -139,46 +31,43 @@ RUN apt-get update -qq && \
usermod -a -G sudo ${USER_NAME} && \
echo "%devel ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers
-COPY entrypoint.sh entrypoint.sh
+COPY docker/stretch/entrypoint.sh entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
-# Qbs build dependencies
-RUN apt-get update -qq && \
- apt-get install -qq -y --no-install-recommends \
+
+# Build and run dependencies for Qbs
+RUN apt-get install -qq -y --no-install-recommends \
build-essential \
- ca-certificates \
+ curl \
git \
+ help2man \
libclang-3.9 \
- libicu57 \
- pkg-config \
+ libdbus-1-3 \
+ libgl1-mesa-glx \
+ libfreetype6 \
+ libfontconfig1 \
+ libgl1-mesa-dev \
make \
- help2man \
+ pkg-config \
python-pip \
- wget && \
+ p7zip-full && \
pip install beautifulsoup4 lxml # for building the documentation
-# Install Qt installation from build stage
-COPY --from=build-qt-linux-x86_64 /opt/qt5-linux-x86_64 /opt/qt5-linux-x86_64
-ENV PATH=/opt/qt5-linux-x86_64/bin:${PATH}
-RUN echo "export PATH=/opt/qt5-linux-x86_64/bin:\${PATH}" > /etc/profile.d/qt.sh
+ENV LLVM_INSTALL_DIR=/usr/lib/llvm-3.9
+
+COPY scripts/install-qt.sh install-qt.sh
+
+RUN ./install-qt.sh --version ${QT_VERSION} qtbase qtdeclarative qtscript qttools qtx11extras icu && \
+ ./install-qt.sh --version ${QTCREATOR_VERSION} qtcreator && \
+ echo "export PATH=/opt/Qt/${QT_VERSION}/gcc_64/bin:/opt/Qt/Tools/QtCreator/bin:\${PATH}" > /etc/profile.d/qt.sh
-# Download and build Qbs
-RUN mkdir -p /qbs && \
- wget -nv --continue --tries=20 --waitretry=10 --retry-connrefused \
- --no-dns-cache --timeout 300 -qO- \
- http://download.qt.io/official_releases/qbs/${QBS_VERSION}/qbs-src-${QBS_VERSION}.tar.gz \
- | tar --strip-components=1 -C /qbs -xzf- && \
- cd /qbs && \
- qmake -r qbs.pro && \
- make -j $(nproc --all) && \
- make install INSTALL_ROOT=/ && \
- rm -rf /qbs
+ENV PATH=/opt/Qt/${QT_VERSION}/gcc_64/bin:/opt/Qt/Tools/QtCreator/bin:${PATH}
# Configure Qbs
USER $USER_NAME
RUN qbs-setup-toolchains --detect && \
- qbs-setup-qt /opt/qt5-linux-x86_64/bin/qmake qt5-linux-x86_64 && \
- qbs config defaultProfile qt5-linux-x86_64
+ qbs-setup-qt /opt/Qt/${QT_VERSION}/gcc_64/bin/qmake qt && \
+ qbs config defaultProfile qt
# Switch back to root user for the entrypoint script.
USER root
diff --git a/scripts/install-qt.sh b/scripts/install-qt.sh
index c2793b3ce..c395cb6a7 100755
--- a/scripts/install-qt.sh
+++ b/scripts/install-qt.sh
@@ -288,6 +288,13 @@ for COMPONENT in ${COMPONENTS}; do
echo "[Paths]" > ${CONF_FILE}
echo "Prefix = .." >> ${CONF_FILE}
+ # Adjust the license to be able to run qmake
+ # sed with -i requires intermediate file on Mac OS
+ PRI_FILE="${INSTALL_DIR}/${VERSION}/${SUBDIR}/mkspecs/qconfig.pri"
+ sed -i.bak 's/Enterprise/OpenSource/g' "${PRI_FILE}"
+ sed -i.bak 's/licheck.*//g' "${PRI_FILE}"
+ rm "${PRI_FILE}.bak"
+
# Print the directory so that the caller can
# adjust the PATH variable.
echo $(dirname "${CONF_FILE}")