Commit 8dfd384e authored by Peio Rigaux's avatar Peio Rigaux

* Parallelized qt build and install (with make -j)

* Parallelized compression for rpm package (with pigz)
* Fixed dependencies in docker files
* Fixed qt configure in RPM spec file (added font support with fontconfig, accessibility options, text-to-speech...)
* Little sed + xargs hack to workaround some distros refusing to build with python2 shebangs
* Change Qt git repo for building docker image to https in order to pass firewall and avoid timeout while cloning
parent a96b70ad
Pipeline #17572 passed with stages
in 48 minutes and 16 seconds
FROM gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-centos:7
MAINTAINER Peio Rigaux <peio.rigaux@belledonne-communications.com>
#QT Dependenciesi (pigz is used to parallelize compression)
RUN sudo yum install -y libxkbcommon* libxcb pigz
# Build qt5.12.5
RUN git clone -b master --single-branch https://gitlab.linphone.org/BC/public/linphone-desktop.git && \
./linphone-desktop/tools/build_qt_rpm && \
sudo rpm -i ./linphone-desktop/rpm-linphone-qt-5.12.5/rpmbuild/RPMS/x86_64/*.rpm && \
sudo mv ./linphone-desktop/rpm-linphone-qt-5.12.5/rpmbuild/RPMS/x86_64/*.rpm / && \
sudo rm -rf ./linphone-desktop
# Configure AppImages dependencies
RUN sudo yum install -y fuse fuse-libs wget
RUN echo 'source /opt/rh/devtoolset-8/enable' >> /home/bc/.bashrc
RUN echo 'source /opt/rh/devtoolset-8/enable' >> /home/bc/.shrc
# This tells /bin/sh to load '~/.shrc' on starting
ENV ENV=~/.shrc
ENV Qt5_DIR=/opt/com.belledonne-communications/linphone/lib/cmake
ENV PATH=$PATH:/opt/com.belledonne-communications/linphone/bin
USER bc
WORKDIR /home/bc
ENV PS1='\[\e[34m\]\u@bc-dev-centos7>\[\e[0m\] '
CMD bash
FROM gitlab.linphone.org:4567/bc/public/linphone-desktop/bc-dev-centos7-qt:5.12.5
MAINTAINER Peio Rigaux <peio.rigaux@belledonne-communications.com>
#Appimage deps
RUN sudo yum install -y wget fuse fuse-libs
FROM gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-debian:9
MAINTAINER Peio Rigaux <peio.rigaux@belledonne-communications.com>
#Tools for QT buid script
RUN sudo apt-get update && sudo apt-get install -y python3 pigz
#QT Dependencies
RUN sudo apt-get update && sudo apt-get install -y libxkbcommon*
# Build qt5.12.5
RUN git clone -b master --single-branch https://gitlab.linphone.org/BC/public/linphone-desktop.git && \
./linphone-desktop/tools/build_qt_rpm && \
find "./linphone-desktop/rpm-linphone-qt-5.12.5/rpmbuild/RPMS/x86_64/" -iname "*.rpm" -exec sudo fakeroot alien -d {} + && \
find "." -maxdepth 1 -iname "*.deb" -exec sudo dpkg -i {} + && \
rm -rf ./linphone-desktop
ENV Qt5_DIR=/opt/com.belledonne-communications/linphone/lib/cmake
ENV PATH=$PATH:/opt/com.belledonne-communications/linphone/bin
#Appimage deps
RUN sudo apt-get install -y wget fuse fuse-libs
USER bc
WORKDIR /home/bc
ENV PS1='\[\e[34m\]\u@bc-dev-centos7>\[\e[0m\] '
CMD bash
FROM gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-debian:9
MAINTAINER Peio Rigaux <peio.rigaux@belledonne-communications.com>
#Tools for QT buid script
RUN sudo apt-get update && sudo apt-get install -y python3 pigz
#QT Dependencies
#atspi and dbus may be used to enable qt accessibility for screan reader
#xkbcommon is needed for special keyboard features
#flite1-dev, libspeechd-dev speech-dispatcher are needed for text to speech
#libfontconfig1-dev is needed to load correct fonts (support of ideograms, etc..)
RUN sudo apt-get update && sudo apt-get install -y libxkbcommon* flite1-dev libspeechd-dev speech-dispatcher libfontconfig1-dev qdbus-qt5 libqt5dbus5 libdbus-1-dev libdbus-glib-1-dev libatspi2.0-0 libatspi2.0-dev
#needed fot qt to find dbus
ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
# Build qt5.12.5
RUN git clone -b master --single-branch https://gitlab.linphone.org/BC/public/linphone-desktop.git && \
./linphone-desktop/tools/build_qt_rpm && \
find "./linphone-desktop/rpm-linphone-qt-5.12.5/rpmbuild/RPMS/x86_64/" -iname "*.rpm" -exec sudo fakeroot alien -d {} + && \
find "." -maxdepth 1 -iname "*.deb" -exec sudo dpkg -i --force-overwrite {} + && \
rm -rf ./linphone-desktop
ENV Qt5_DIR=/opt/com.belledonne-communications/linphone/lib/cmake
ENV PATH=$PATH:/opt/com.belledonne-communications/linphone/bin
#Appimage deps
RUN sudo apt-get install -y wget fuse libfuse2 gnupg2
USER bc
WORKDIR /home/bc
ENV PS1='\[\e[34m\]\u@bc-dev-centos7>\[\e[0m\] '
CMD bash
FROM gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-ubuntu:18.04
MAINTAINER Peio Rigaux <peio.rigaux@belledonne-communications.com>
#Tools for QT buid script
RUN sudo apt-get update && sudo apt-get install -y python3 pigz
#QT Dependencies
#atspi and dbus may be used to enable qt accessibility for screan reader
#xkbcommon is needed for special keyboard features
#flite1-dev, libspeechd-dev speech-dispatcher are needed for text to speech
#libfontconfig1-dev is needed to load correct fonts (support of ideograms, etc..)
RUN sudo apt-get update && sudo apt-get install -y libxkbcommon* flite1-dev libspeechd-dev speech-dispatcher libfontconfig1-dev qdbus-qt5 libqt5dbus5 libdbus-1-dev libdbus-glib-1-dev libatspi2.0-0 libatspi2.0-dev
#needed fot qt to find dbus
ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
# Build qt5.12.5
RUN git clone -b master --single-branch https://gitlab.linphone.org/BC/public/linphone-desktop.git && \
./linphone-desktop/tools/build_qt_rpm && \
find "./linphone-desktop/rpm-linphone-qt-5.12.5/rpmbuild/RPMS/x86_64/" -iname "*.rpm" -exec sudo fakeroot alien -d {} + && \
find "." -maxdepth 1 -iname "*.deb" -exec sudo dpkg -i --force-overwrite {} + && \
rm -rf ./linphone-desktop
ENV Qt5_DIR=/opt/com.belledonne-communications/linphone/lib/cmake
ENV PATH=$PATH:/opt/com.belledonne-communications/linphone/bin
#Appimage deps
RUN sudo apt-get install -y wget fuse libfuse2 gnupg2
USER bc
WORKDIR /home/bc
CMD bash
FROM gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-ubuntu:rolling
MAINTAINER Peio Rigaux <peio.rigaux@belledonne-communications.com>
#Tools for QT buid script
RUN sudo apt-get update && sudo apt-get install -y python3 pigz
#QT Dependencies
#atspi and dbus may be used to enable qt accessibility for screan reader
#xkbcommon is needed for special keyboard features
#flite1-dev, libspeechd-dev speech-dispatcher are needed for text to speech
#libfontconfig1-dev is needed to load correct fonts (support of ideograms, etc..)
RUN sudo apt-get update && sudo apt-get install -y libxkbcommon* flite1-dev libspeechd-dev speech-dispatcher libfontconfig1-dev qdbus-qt5 libqt5dbus5 libdbus-1-dev libdbus-glib-1-dev libatspi2.0-0 libatspi2.0-dev
#needed fot qt to find dbus
ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
# Build qt5.12.5
RUN git clone -b master --single-branch https://gitlab.linphone.org/BC/public/linphone-desktop.git && \
./linphone-desktop/tools/build_qt_rpm && \
find "./linphone-desktop/rpm-linphone-qt-5.12.5/rpmbuild/RPMS/x86_64/" -iname "*.rpm" -exec sudo fakeroot alien -d {} + && \
find "." -maxdepth 1 -iname "*.deb" -exec sudo dpkg -i --force-overwrite {} + && \
rm -rf ./linphone-desktop
ENV Qt5_DIR=/opt/com.belledonne-communications/linphone/lib/cmake
ENV PATH=$PATH:/opt/com.belledonne-communications/linphone/bin
#Appimage deps
RUN sudo apt-get install -y wget fuse libfuse2 gnupg2
USER bc
WORKDIR /home/bc
CMD bash
# -*- rpm-spec -*-
%define _qt5_version 5.10
%define _qt5_version 5.12.5
%define _qt5_dir /opt/com.belledonne-communications/linphone
%define _qt5_archdatadir %{_qt5_dir}
......@@ -33,8 +33,14 @@ Requires: %{name} = %{version}-%{release}
Qt is a software toolkit for developing applications.
%prep
%setup -n %{name}-%{version}
#Notes for Qt 5.12 and above
#qt-xcb includes libxcb-* but libxcb
#qt-xkbcommon cannot be used anymore
#-xkbcommon enables xkb support using system libs
%build
./configure \
-opensource \
......@@ -45,13 +51,18 @@ Qt is a software toolkit for developing applications.
-silent \
-nomake examples \
-nomake tests \
-dbus \
-feature-dbus \
-feature-accessibility \
-qt-freetype \
-qt-harfbuzz \
-qt-libjpeg \
-qt-libpng \
-qt-pcre \
-qt-xcb \
-qt-xkbcommon \
-xkbcommon \
-system-freetype \
-feature-freetype -fontconfig \
-skip wayland \
-system-zlib \
-archdatadir %{_qt5_archdatadir} \
......@@ -63,38 +74,24 @@ Qt is a software toolkit for developing applications.
-prefix %{_qt5_dir} \
-translationdir %{_qt5_translationdir}
make
make -j12
%install
make install INSTALL_ROOT=%{buildroot}
find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/#!\/usr\/bin\/python/#!\/usr\/bin\/python3/g'
make install INSTALL_ROOT=%{buildroot} -j12
# Some files got ambiguous python shebangs, we fix them to avoid install errors
# Because in centos8 shebangs like #!/usr/bin/python are FORBIDDEN (see https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error)
%files
%defattr(-,root,root,-)
%license LICENSE.LGPL* LGPL_EXCEPTION.txt LICENSE.FDL
%license LICENSE.LGPL* LICENSE.FDL
%{_qt5_archdatadir}/phrasebooks/*.qph
%{_qt5_archdatadir}/qml/
%{_qt5_bindir}/
%{_qt5_docdir}/global/
%{_qt5_libdir}/libQt5*.so.5*
%{_qt5_plugindir}/audio/*.so
%{_qt5_plugindir}/bearer/*.so
%{_qt5_plugindir}/canbus/*.so
%{_qt5_plugindir}/designer/libqquickwidget.so
%{_qt5_plugindir}/egldeviceintegrations/*.so
%{_qt5_plugindir}/gamepads/libevdevgamepad.so
%{_qt5_plugindir}/generic/*.so
%{_qt5_plugindir}/geometryloaders/*.so
%{_qt5_plugindir}/iconengines/libqsvgicon.so
%{_qt5_plugindir}/imageformats/*.so
%{_qt5_plugindir}/mediaservice/libqtmedia_audioengine.so
%{_qt5_plugindir}/platforminputcontexts/*.so
%{_qt5_plugindir}/platforms/*.so
%{_qt5_plugindir}/playlistformats/libqtmultimedia_m3u.so
%{_qt5_plugindir}/qmltooling/*.so
%{_qt5_plugindir}/renderplugins/libscene2d.so
%{_qt5_plugindir}/sceneparsers/*.so
%{_qt5_plugindir}/sqldrivers/*.so
%{_qt5_plugindir}/xcbglintegrations/*.so
%{_qt5_libdir}/libQt5*.so*
%{_qt5_plugindir}/*/*.so*
%{_qt5_translationdir}/
%files devel
......
......@@ -3,8 +3,8 @@
# See: http://wiki.qt.io/Building_Qt_5_from_Git
# See: http://doc.qt.io/qt-5/configure-options.html
REPO_URL='git://code.qt.io/qt/qt5.git'
QT_VERSION='5.10'
REPO_URL='https://gitlab.linphone.org/BC/public/external/qt/qt5.git'
QT_VERSION='5.12.5'
RPM_NAME=linphone-qt-${QT_VERSION}
......@@ -12,7 +12,6 @@ REPO_FOLDER=linphone-qt
RPM_FOLDER=rpm-${RPM_NAME}
# ==============================================================================
RED='\e[1;31m'
NC='\e[0m'
......@@ -22,10 +21,12 @@ cd "${SCRIPT_DIR}/.."
# ==============================================================================
if [ ! -d "${REPO_FOLDER}/.git" ]; then
git clone "${REPO_URL}" "${REPO_FOLDER}"
#Simplest way to use paralle fetch if available
#Otherwise we would have to parse the git version number
git clone "${REPO_URL}" "${REPO_FOLDER}" --recursive -j 12 || git clone "${REPO_URL}" "${REPO_FOLDER}"
fi
cd "${REPO_FOLDER}"
while test $# -gt 0
do
case "$1" in
......@@ -40,6 +41,7 @@ do
done
git checkout "${QT_VERSION}"
git submodule foreach --recursive 'if [ -n "$(git branch -a | grep 5.12.5)" ]; then git checkout 5.12.5; fi'
if [[ $? != 0 ]] ; then
printf "${RED}Unable to checkout ${QT_VERSION}.${NC}\n"
exit 1
......@@ -72,6 +74,8 @@ fi
cd ..
mkdir -p ${RPM_FOLDER}/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
tar --transform "s/^${REPO_FOLDER}/${RPM_NAME}/" -czvf ${RPM_FOLDER}/rpmbuild/SOURCES/${RPM_NAME}.tar.gz ${REPO_FOLDER}/
#use pigz to parallelize compression
tar --transform "s/^${REPO_FOLDER}/${RPM_NAME}/" -c ${REPO_FOLDER}/ | pigz -p 24 > ${RPM_FOLDER}/rpmbuild/SOURCES/${RPM_NAME}.tar.gz
#tar --transform "s/^${REPO_FOLDER}/" -czvf ${RPM_FOLDER}/rpmbuild/SOURCES/${RPM_NAME}.tar.gz ${REPO_FOLDER}/
rpmbuild -bb --define "_topdir $PWD/${RPM_FOLDER}/rpmbuild" build/rpm/qt5.spec
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