Skip to content

Commit c9d1543

Browse files
author
Jochen Bauer
committed
added working ssl build scripts, adding libicu-dev, introducing build script
1 parent 70d6cff commit c9d1543

15 files changed

+241
-38
lines changed

Dockerfile

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ LABEL stage=qt-build-base
77
ARG USER_UID=
88
ARG USER_GID=
99

10+
# In case you have to build behind a proxy
11+
ARG PROXY=
12+
ENV http_proxy=$PROXY
13+
ENV https_proxy=$PROXY
14+
1015
# Name of the regular user. Does not look useful but can save a bit time when changing
1116
ENV QT_USERNAME=qt
1217

@@ -24,7 +29,10 @@ RUN apt-get update && apt-get -y dist-upgrade && apt-get -y --no-install-recomme
2429
build-essential \
2530
pkg-config \
2631
libgl1-mesa-dev \
27-
libssl1.0-dev \
32+
libicu-dev \
33+
# bc suggested for openssl tests
34+
bc \
35+
libssl-dev \
2836
# git is needed to build openssl in older versions
2937
git \
3038
# xcb dependencies
@@ -91,18 +99,11 @@ ENV CORE_COUNT=${CORE_COUNT}
9199

92100
# Configure, make, install
93101
ADD buildconfig/configure-${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}.sh configure.sh
102+
# before running the configuration, adding a directory to copy additional contents to the final image
103+
RUN mkdir /opt/extra-dependencies && chmod +x ./configure.sh && ./configure.sh ${CORE_COUNT} ${CI_BUILD}
94104

95-
RUN chmod +x ./configure.sh && ./configure.sh ${CORE_COUNT} ${CI_BUILD}
96-
97-
RUN if [ $CI_BUILD = 2 ]; then \
98-
echo "Suppressing all make output for CI environments to decrease log size..."; \
99-
make -j${CORE_COUNT} > /dev/null 2>&1 || echo "Running make again to see errors..." && make > /tmp/makelog 2>&1 || echo "displaying last N lines..." && tail -n 500 /tmp/makelog && exit 2; \
100-
elif [ $CI_BUILD ]; then \
101-
echo "Suppressing regular make output for CI environments to decrease log size..."; \
102-
make -j${CORE_COUNT} > /dev/null || echo "Running make again to see errors..." && make > /tmp/makelog || echo "displaying last N lines..." && tail -n 500 /tmp/makelog && exit 2; \
103-
else \
104-
make -j${CORE_COUNT}; \
105-
fi;
105+
COPY buildconfig/build.sh build.sh
106+
RUN ./build.sh ${CI_BUILD} ${CORE_COUNT}
106107

107108
# install it
108109
RUN make install
@@ -117,6 +118,7 @@ ENV ENTRYPOINT_DIR=/usr/local/bin
117118
ENV APP_BUILDDIR=/var/build
118119

119120
COPY --from=builder ${QT_PREFIX} ${QT_PREFIX}
121+
COPY --from=builder /opt/extra-dependencies/ /
120122
COPY entrypoint.sh ${ENTRYPOINT_DIR}
121123

122124
RUN chmod +x ${ENTRYPOINT_DIR}/entrypoint.sh

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ The build arguments can entirely be omitted, resulting in a build with some defa
5858
* `CI_BUILD` -- will suppress regular `make` output. If set to `2` it will stay silent, if set to `1` (or anything else) only warnings will show up. When the compiling fails, `make` is run again regularly to give you the whole output, skipping everything that has been built before, to give you the possibility to see the actual behaviour. When left undefined, all output is visible and the second run of make is *not* performed
5959
* `CORE_COUNT` -- determines the number of parallel make jobs. Adjust it to fit your machine
6060

61+
### Convenience local build script
62+
63+
In case you want to do a quick, customised build like I do it in the automated build process. Have a look at the self-explanatory script `build-dockerfile-local.sh`.
64+
6165
## Available tags
6266

6367
All currently supported versions of `Qt` should be available as tags. It was nice to make the archived versions, too, but I did not yet start to adjust the download method as archived versions are taken from a different location. This is no hard work though, so might be a nice ![first contribution](https://img.shields.io/badge/-first_contribution-006b75.svg)

build-dockerfile-local.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# Call this script like so:
3+
#./build-dockerfile-local.sh 5 6 0 everywhere-opensource 2 8
4+
QT_VERSION_MAJOR=$1
5+
QT_VERSION_MINOR=$2
6+
QT_VERSION_PATCH=$3
7+
QT_TARBALL_NAMING_SCHEME=$4
8+
CI_BUILD=$5
9+
CORE_COUNT=$6
10+
PROXY=$7
11+
# builder
12+
docker build --pull --build-arg QT_VERSION_MAJOR=$QT_VERSION_MAJOR --build-arg QT_VERSION_MINOR=$QT_VERSION_MINOR --build-arg QT_VERSION_PATCH=$QT_VERSION_PATCH --build-arg QT_TARBALL_NAMING_SCHEME=$QT_TARBALL_NAMING_SCHEME --build-arg CI_BUILD=$CI_BUILD --build-arg CORE_COUNT=$CORE_COUNT --build-arg PROXY=$PROXY --target=builder -t darkmattercoder/qt-build:builder-$QT_VERSION_MAJOR.$QT_VERSION_MINOR.$QT_VERSION_PATCH .
13+
# qt
14+
docker build --pull --cache-from darkmattercoder/qt-build:builder-$QT_VERSION_MAJOR.$QT_VERSION_MINOR.$QT_VERSION_PATCH --build-arg QT_VERSION_MAJOR=$QT_VERSION_MAJOR --build-arg QT_VERSION_MINOR=$QT_VERSION_MINOR --build-arg QT_VERSION_PATCH=$QT_VERSION_PATCH --build-arg QT_TARBALL_NAMING_SCHEME=$QT_TARBALL_NAMING_SCHEME --build-arg CI_BUILD=$CI_BUILD --build-arg CORE_COUNT=$CORE_COUNT --target=qt -t darkmattercoder/qt-build:$QT_VERSION_MAJOR.$QT_VERSION_MINOR.$QT_VERSION_PATCH .

buildconfig/build.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
set -x
3+
CI_BUILD=$1
4+
CORE_COUNT=$2
5+
TAIL_LINECOUNT=500
6+
if [ "$CI_BUILD" = 2 ]; then
7+
echo "Suppressing all make output for CI environments to decrease log size..."
8+
make -j${CORE_COUNT} > /dev/null 2>&1
9+
RESULT=$?
10+
if [ $RESULT -ne 0 ]; then
11+
echo "Running make again to see errors with less output..."
12+
make > /tmp/makelog 2>&1
13+
echo "displaying last $TAIL_LINECOUNT lines..."
14+
tail -n $TAIL_LINECOUNT /tmp/makelog
15+
exit $RESULT
16+
fi
17+
elif [ "$CI_BUILD" ]; then
18+
echo "Suppressing regular make output for CI environments to decrease log size..."
19+
make -j${CORE_COUNT} > /dev/null
20+
else
21+
make -j${CORE_COUNT}
22+
fi

buildconfig/configure-5.6.0.sh

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
#!/bin/sh
2-
# set -e
3-
# set -x
4-
# CORE_COUNT=$1
5-
# # adding compatible ssl version
6-
# git clone https://github.com/openssl/openssl.git
7-
# cd openssl
8-
# git checkout OpenSSL_1_0_1-stable
9-
# LATEST_TAG=$(git describe --match "OpenSSL_1_0_1[a-z]*" --abbrev=0)
10-
# git checkout $LATEST_TAG
11-
# ./config --prefix=/opt/openssl_build_stable -shared > /dev/null 2>&1 || ./config --prefix=/opt/openssl_build_stable -shared
12-
# make -j$CORE_COUNT > /dev/null 2>&1 || make -j$CORE_COUNT
13-
# make -j$CORE_COUNT test > /dev/null 2>&1 || make -j$CORE_COUNT test
14-
# make install > /dev/null 2>&1 || make install
15-
# cd ..
16-
# OPENSSL_LIBS='-L/opt/openssl_build_stable/lib -lssl -lcrypto' ../configure -prefix $QT_PREFIX -opensource -confirm-license -nomake examples -nomake tests -qt-xcb -openssl-linked -I /opt/openssl_build_stable/include/openssl -L /opt/openssl_build_stable/lib
17-
../configure -prefix $QT_PREFIX -opensource -confirm-license -nomake examples -nomake tests -qt-xcb
2+
set -e
3+
set -x
4+
CORE_COUNT=$1
5+
# adding compatible ssl version
6+
git clone https://github.com/openssl/openssl.git
7+
cd openssl
8+
git checkout OpenSSL_1_0_2-stable
9+
LATEST_TAG=$(git describe --match "OpenSSL_1_0_2[a-z]*" --abbrev=0)
10+
git checkout $LATEST_TAG
11+
./config --prefix=/opt/openssl_build_stable -shared > /dev/null 2>&1 || ./config --prefix=/opt/openssl_build_stable -shared
12+
make -j$CORE_COUNT > /dev/null 2>&1 || make -j$CORE_COUNT
13+
make test > /dev/null 2>&1 || make test
14+
make install > /dev/null 2>&1 || make install
15+
cd ..
16+
OPENSSL_LIBS='-L/opt/openssl_build_stable/lib -lssl -lcrypto' ../configure -prefix $QT_PREFIX -opensource -confirm-license -nomake examples -nomake tests -qt-xcb -openssl-linked -I /opt/openssl_build_stable/include -L /opt/openssl_build_stable/lib
17+
mkdir /opt/extra-dependencies/opt
18+
cp -r /opt/openssl_build_stable /opt/extra-dependencies/opt

buildconfig/configure-5.6.1-1.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
#!/bin/sh
22
# this config is so weird looking because there was a bug in the original 5.6.1 that has been hotfixed.
33
# To get the ci scheme work with this, I have to tweak it that way...
4-
../../qt-everywhere-opensource-src-5.6.1/configure -prefix $QT_PREFIX -opensource -confirm-license -nomake examples -nomake tests -qt-xcb
4+
set -e
5+
set -x
6+
CORE_COUNT=$1
7+
# adding compatible ssl version
8+
git clone https://github.com/openssl/openssl.git
9+
cd openssl
10+
git checkout OpenSSL_1_0_2-stable
11+
LATEST_TAG=$(git describe --match "OpenSSL_1_0_2[a-z]*" --abbrev=0)
12+
git checkout $LATEST_TAG
13+
./config --prefix=/opt/openssl_build_stable -shared > /dev/null 2>&1 || ./config --prefix=/opt/openssl_build_stable -shared
14+
make -j$CORE_COUNT > /dev/null 2>&1 || make -j$CORE_COUNT
15+
make test > /dev/null 2>&1 || make test
16+
make install > /dev/null 2>&1 || make install
17+
cd ..
18+
OPENSSL_LIBS='-L/opt/openssl_build_stable/lib -lssl -lcrypto' ../../qt-everywhere-opensource-src-5.6.1/configure -prefix $QT_PREFIX -opensource -confirm-license -nomake examples -nomake tests -qt-xcb -openssl-linked -I /opt/openssl_build_stable/include -L /opt/openssl_build_stable/lib
19+
mkdir /opt/extra-dependencies/opt
20+
cp -r /opt/openssl_build_stable /opt/extra-dependencies/opt

buildconfig/configure-5.6.2.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
11
#!/bin/sh
2-
../configure -prefix $QT_PREFIX -opensource -confirm-license -nomake examples -nomake tests -qt-xcb
2+
set -e
3+
set -x
4+
CORE_COUNT=$1
5+
# adding compatible ssl version
6+
git clone https://github.com/openssl/openssl.git
7+
cd openssl
8+
git checkout OpenSSL_1_0_2-stable
9+
LATEST_TAG=$(git describe --match "OpenSSL_1_0_2[a-z]*" --abbrev=0)
10+
git checkout $LATEST_TAG
11+
./config --prefix=/opt/openssl_build_stable -shared > /dev/null 2>&1 || ./config --prefix=/opt/openssl_build_stable -shared
12+
make -j$CORE_COUNT > /dev/null 2>&1 || make -j$CORE_COUNT
13+
make test > /dev/null 2>&1 || make test
14+
make install > /dev/null 2>&1 || make install
15+
cd ..
16+
OPENSSL_LIBS='-L/opt/openssl_build_stable/lib -lssl -lcrypto' ../configure -prefix $QT_PREFIX -opensource -confirm-license -nomake examples -nomake tests -qt-xcb -openssl-linked -I /opt/openssl_build_stable/include -L /opt/openssl_build_stable/lib
17+
mkdir /opt/extra-dependencies/opt
18+
cp -r /opt/openssl_build_stable /opt/extra-dependencies/opt

buildconfig/configure-5.6.3.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
11
#!/bin/sh
2-
../configure -prefix $QT_PREFIX -opensource -confirm-license -nomake examples -nomake tests -qt-xcb
2+
set -e
3+
set -x
4+
CORE_COUNT=$1
5+
# adding compatible ssl version
6+
git clone https://github.com/openssl/openssl.git
7+
cd openssl
8+
git checkout OpenSSL_1_0_2-stable
9+
LATEST_TAG=$(git describe --match "OpenSSL_1_0_2[a-z]*" --abbrev=0)
10+
git checkout $LATEST_TAG
11+
./config --prefix=/opt/openssl_build_stable -shared > /dev/null 2>&1 || ./config --prefix=/opt/openssl_build_stable -shared
12+
make -j$CORE_COUNT > /dev/null 2>&1 || make -j$CORE_COUNT
13+
make test > /dev/null 2>&1 || make test
14+
make install > /dev/null 2>&1 || make install
15+
cd ..
16+
OPENSSL_LIBS='-L/opt/openssl_build_stable/lib -lssl -lcrypto' ../configure -prefix $QT_PREFIX -opensource -confirm-license -nomake examples -nomake tests -qt-xcb -openssl-linked -I /opt/openssl_build_stable/include -L /opt/openssl_build_stable/lib
17+
mkdir /opt/extra-dependencies/opt
18+
cp -r /opt/openssl_build_stable /opt/extra-dependencies/opt

buildconfig/configure-5.9.0.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
11
#!/bin/sh
2-
../configure -prefix $QT_PREFIX -opensource -confirm-license -nomake examples -nomake tests -qt-xcb
2+
set -e
3+
set -x
4+
CORE_COUNT=$1
5+
# adding compatible ssl version
6+
git clone https://github.com/openssl/openssl.git
7+
cd openssl
8+
git checkout OpenSSL_1_0_2-stable
9+
LATEST_TAG=$(git describe --match "OpenSSL_1_0_2[a-z]*" --abbrev=0)
10+
git checkout $LATEST_TAG
11+
./config --prefix=/opt/openssl_build_stable -shared > /dev/null 2>&1 || ./config --prefix=/opt/openssl_build_stable -shared
12+
make -j$CORE_COUNT > /dev/null 2>&1 || make -j$CORE_COUNT
13+
make test > /dev/null 2>&1 || make test
14+
make install > /dev/null 2>&1 || make install
15+
cd ..
16+
OPENSSL_LIBS='-L/opt/openssl_build_stable/lib -lssl -lcrypto' ../configure -prefix $QT_PREFIX -opensource -confirm-license -nomake examples -nomake tests -qt-xcb -openssl-linked -I /opt/openssl_build_stable/include -L /opt/openssl_build_stable/lib
17+
mkdir /opt/extra-dependencies/opt
18+
cp -r /opt/openssl_build_stable /opt/extra-dependencies/opt

buildconfig/configure-5.9.1.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
11
#!/bin/sh
2-
../configure -prefix $QT_PREFIX -opensource -confirm-license -nomake examples -nomake tests -qt-xcb
2+
set -e
3+
set -x
4+
CORE_COUNT=$1
5+
# adding compatible ssl version
6+
git clone https://github.com/openssl/openssl.git
7+
cd openssl
8+
git checkout OpenSSL_1_0_2-stable
9+
LATEST_TAG=$(git describe --match "OpenSSL_1_0_2[a-z]*" --abbrev=0)
10+
git checkout $LATEST_TAG
11+
./config --prefix=/opt/openssl_build_stable -shared > /dev/null 2>&1 || ./config --prefix=/opt/openssl_build_stable -shared
12+
make -j$CORE_COUNT > /dev/null 2>&1 || make -j$CORE_COUNT
13+
make test > /dev/null 2>&1 || make test
14+
make install > /dev/null 2>&1 || make install
15+
cd ..
16+
OPENSSL_LIBS='-L/opt/openssl_build_stable/lib -lssl -lcrypto' ../configure -prefix $QT_PREFIX -opensource -confirm-license -nomake examples -nomake tests -qt-xcb -openssl-linked -I /opt/openssl_build_stable/include -L /opt/openssl_build_stable/lib
17+
mkdir /opt/extra-dependencies/opt
18+
cp -r /opt/openssl_build_stable /opt/extra-dependencies/opt

0 commit comments

Comments
 (0)