1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Add Dockerfile for building AppImage

This commit is contained in:
David Rosca 2018-05-01 22:59:49 +02:00
parent 94eb3161af
commit dd8d8b9007
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
5 changed files with 175 additions and 0 deletions

44
linux/appimage/Dockerfile Normal file
View File

@ -0,0 +1,44 @@
# Build:
# docker build -t falkon-appimage-build .
# Run:
# docker run -v $OUT_DIRECTORY:/out -it falkon-appimage-build $FALKON_TARBALL_URL
FROM centos:7
RUN yum -y install \
wget \
fontconfig \
xz \
openssl-devel \
libX11-devel \
xcb-util-devel \
centos-release-scl \
make \
gettext \
squashfs-tools \
chrpath \
which \
mesa-libGL-devel \
mesa-libEGL-devel \
libXcomposite-devel \
libXcursor-devel \
alsa-lib-devel \
libXi-devel \
libXtst-devel \
libXrandr-devel
RUN yum -y install devtoolset-4-gcc-c++
RUN wget -O cmake-install https://cmake.org/files/v3.11/cmake-3.11.1-Linux-x86_64.sh && \
chmod +x cmake-install && \
./cmake-install --skip-license --prefix=/usr && \
rm cmake-install
COPY setup.sh /root/setup.sh
COPY qt-installer-noninteractive.qs /root/qt-installer-noninteractive.qs
RUN scl enable devtoolset-4 /root/setup.sh
COPY build.sh /root/build.sh
COPY build-appimage.sh /root/build-appimage.sh
ENTRYPOINT ["/root/build.sh"]

View File

@ -43,6 +43,7 @@ LDFLAGS="${LDFLAGS:--Wl,-z,relro }"; export LDFLAGS ;
optPrint(){ optPrint(){
printf "\n\t\t${ITL1}VALID OPTIONS ARE${ITL0}:\n printf "\n\t\t${ITL1}VALID OPTIONS ARE${ITL0}:\n
--sourcedir=[path] --sourcedir=[path]
--outdir=[path]
--qmake=[path to executable] --qmake=[path to executable]
--disable-debug | -D --disable-debug | -D
--runtime=[path] --runtime=[path]
@ -77,6 +78,9 @@ ${BLD1}--sourcedir=${BLD0}
${UDR1}example:--sourcedir="/home/build/falkon"${UDR0} ${UDR1}example:--sourcedir="/home/build/falkon"${UDR0}
${BLD1}--outdir=${BLD0}
Where to copy final AppImage.
${BLD1}--runtime=[path]${BLD0} ${BLD1}--runtime=[path]${BLD0}
@ -127,6 +131,10 @@ while [ $# != 0 ] ;do
SOURCE_DIR=$(getVal "${CFG_OPT}") SOURCE_DIR=$(getVal "${CFG_OPT}")
export SOURCE_DIR export SOURCE_DIR
;; ;;
--outdir=*)
OUT_DIR=$(getVal "${CFG_OPT}")
export OUT_DIR
;;
--disable-debug|-D) --disable-debug|-D)
unset DEBUG_BUILD unset DEBUG_BUILD
;; ;;
@ -357,6 +365,9 @@ nowBldImg
if [[ $? == 0 ]] && [[ -x bin/Falkon.AppImage ]]; then if [[ $? == 0 ]] && [[ -x bin/Falkon.AppImage ]]; then
printf "\\033c" printf "\\033c"
printf "Done!\nThe compiled files are in "${PWD}"/bin\n" printf "Done!\nThe compiled files are in "${PWD}"/bin\n"
if [ ! -z "$OUT_DIR" ]; then
cp bin/Falkon.AppImage "$OUT_DIR"
fi
fi fi
exit 0 exit 0

26
linux/appimage/build.sh Executable file
View File

@ -0,0 +1,26 @@
#!/usr/bin/env bash
FALKON_URL=$1
RUNTIME_URL="https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-x86_64"
if [ -z "$FALKON_URL" ]; then
echo "No url specified!"
exit 1
fi
source /root/env.sh
source /opt/rh/devtoolset-4/enable
cd /root
wget $RUNTIME_URL -O runtime
wget $FALKON_URL -O falkon.tar.xz
tar xf falkon.tar.xz
cd falkon-*
/root/build-appimage.sh \
--sourcedir=`pwd` \
--outdir=/out \
--runtime=/root/runtime \
--qmake=$QTDIR/bin/qmake

View File

@ -0,0 +1,57 @@
function Controller() {
installer.autoRejectMessageBoxes();
installer.installationFinished.connect(function() {
gui.clickButton(buttons.NextButton);
})
}
Controller.prototype.WelcomePageCallback = function() {
gui.clickButton(buttons.NextButton, 2000);
}
Controller.prototype.CredentialsPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.IntroductionPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.TargetDirectoryPageCallback = function()
{
gui.currentPageWidget().TargetDirectoryLineEdit.setText("/root/Qt");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ComponentSelectionPageCallback = function() {
var widget = gui.currentPageWidget();
widget.deselectAll();
widget.selectComponent("qt.qt5.5101.gcc_64");
widget.selectComponent("qt.qt5.5101.qtscript");
widget.selectComponent("qt.qt5.5101.qtwebengine");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.LicenseAgreementPageCallback = function() {
gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
gui.clickButton(buttons.NextButton);
}
Controller.prototype.StartMenuDirectoryPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ReadyForInstallationPageCallback = function()
{
gui.clickButton(buttons.NextButton);
}
Controller.prototype.FinishedPageCallback = function() {
var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm
if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
checkBoxForm.launchQtCreatorCheckBox.checked = false;
}
gui.clickButton(buttons.FinishButton);
}

37
linux/appimage/setup.sh Executable file
View File

@ -0,0 +1,37 @@
#!/usr/bin/env bash
QT_INSTALL_URL="https://download.qt.io/official_releases/qt/5.10/5.10.1/qt-opensource-linux-x64-5.10.1.run"
EXTRA_CMAKE_MODULES_URL="https://download.kde.org/stable/frameworks/5.45/extra-cmake-modules-5.45.0.tar.xz"
KI18N_URL="https://download.kde.org/stable/frameworks/5.45/ki18n-5.45.0.tar.xz"
QTDIR="/root/Qt/5.10.1/gcc_64"
# Install Qt
cd /root
wget $QT_INSTALL_URL -O qt-installer
chmod u+x qt-installer
./qt-installer --script qt-installer-noninteractive.qs --platform minimal -v
echo "export QTDIR=$QTDIR" > /root/env.sh
# Install ECM
cd /root
wget $EXTRA_CMAKE_MODULES_URL -O extra-cmake-modules.tar.xz
tar xf extra-cmake-modules.tar.xz
cd extra-cmake-modules-*
mkdir build && cd build
cmake -DBUILD_TESTING=OFF -DBUILD_QCH=OFF -DCMAKE_PREFIX_PATH=$QTDIR/lib/cmake -DCMAKE_INSTALL_PREFIX=$QTDIR -DCMAKE_INSTALL_LIBDIR=lib ..
make && make install
# Install KI18n
cd /root
wget $KI18N_URL -O ki18n.tar.xz
tar xf ki18n.tar.xz
cd ki18n-*
mkdir build && cd build
cmake -DBUILD_TESTING=OFF -DBUILD_QCH=OFF -DCMAKE_PREFIX_PATH=$QTDIR/lib/cmake -DCMAKE_INSTALL_PREFIX=$QTDIR -DCMAKE_INSTALL_LIBDIR=lib ..
make && make install
# Cleanup
cd /root
rm -r qt-installer* extra-cmake-modules* ki18n* setup.sh