Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 82 additions & 56 deletions scripts/appimage/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,35 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
FROM centos/devtoolset-7-toolchain-centos7 as intermediate
FROM almalinux:9 AS intermediate

ARG QT_VERSION=5.15.13
ARG KF5_VERSION=v5.115.0
ARG KDDockWidgets_VERSION=2.0
ARG QT_VERSION=6.8.3
ARG QT_VERSION_SHORT=6.8
ARG KF6_VERSION=v6.16.0
ARG KDDockWidgets_VERSION=v2.2.5
ARG QCustomPlot_VERSION=2.1.1
ARG rust_demangler_VERSION=0.1.23
ARG rust_demangler_VERSION=0.1.24
ARG d_demangler_VERSION=0.0.2
ARG KGraphViewer_VERSION=v2.4.3a
ARG KGraphViewer_VERSION=v25.04.3
ARG KDiagram_VERSION=v3.0.1

USER root

# install dependencies
RUN sed -i 's#enabled=1#enabled=0#' /etc/yum/pluginconf.d/fastestmirror.conf && \
yum install -y deltarpm && \
yum update -y && yum install -y epel-release centos-release-scl && \
yum install -y \
devtoolset-11 devtoolset-11-elfutils-devel devtoolset-11-elfutils-debuginfod flex bison file \
rh-perl530-perl rh-perl530-perl-IO-Socket-SSL rh-perl530-perl-YAML \
gperf wget cmake3 which rh-git227-git python3 libzstd-devel \
RUN dnf update -y && dnf install -y 'dnf-command(config-manager)' && dnf config-manager --set-enabled crb && dnf update -y && \
dnf install -y \
glibc-langpack-en gcc-toolset-14 elfutils-devel elfutils-libelf-devel elfutils-debuginfod-client-devel flex bison file \
perl perl-IO-Socket-SSL perl-YAML \
gperf wget cmake3 which git python3 libzstd-devel \
polkit-devel libxslt-devel docbook-style-xsl \
# install Qt build dependencies, see: https://wiki.qt.io/Building_Qt_5_from_Git
# install Qt build dependencies, see: https://wiki.qt.io/Building_Qt_6_from_Git
# qtbase
libxcb libxcb-devel xcb-util xcb-util-devel mesa-libGL-devel libxkbcommon-devel libudev-devel \
xcb-util-keysyms-devel libxkbcommon-x11-devel libinput-devel xcb-util-image-devel \
mesa-libgbm-devel xcb-util-wm-devel xcb-util-renderutil-devel libSM-devel \
postgresql-devel unixODBC-devel pcre2-devel openssl11-devel openssl11 cups-devel \
libinput-devel xcb-util-image-devel xcb-util-wm-devel xcb-util-keysyms-devel xcb-util-cursor-devel \
mesa-libgbm-devel xcb-util-renderutil-devel libSM-devel libxkbcommon-x11-devel \
postgresql-devel unixODBC-devel pcre2-devel openssl-devel openssl cups-devel \
# gtk widget theme support
gtk3-devel \
# kshimgen
glibc-static \
gtk3-devel libcanberra-devel \
# kfilemetadata
libattr-devel \
# kio
Expand All @@ -44,43 +42,58 @@ RUN sed -i 's#enabled=1#enabled=0#' /etc/yum/pluginconf.d/fastestmirror.conf &&
# kgraphviewer
boost boost-devel graphviz-devel \
# appimages
fuse fuse-libs bzip2 \
fuse fuse-libs bzip2 rsync \
# elfutils
libmicrohttpd-devel libsqlite3x-devel libarchive-devel && \
ln -s /usr/bin/cmake3 /usr/bin/cmake && \
rm -Rf /var/cache/yum
libmicrohttpd-devel sqlite-devel libarchive-devel \
# wayland
ninja-build meson expat-devel doxygen xmlto \
# sonnet
hunspell-devel \
# kwallet
gpgme-devel gpgmepp-devel libgcrypt-devel libsecret-devel && \
rm -Rf /var/dnf/yum

FROM intermediate AS builder

ENV LD_LIBRARY_PATH=/opt/rh/devtoolset-11/root/usr/lib64:/opt/rh/devtoolset-11/root/usr/lib:/opt/rh/devtoolset-11/root/usr/lib64/dyninst:/opt/rh/devtoolset-11/root/usr/lib/dyninst:/opt/rh/devtoolset-11/root/usr/lib64:/opt/rh/devtoolset-11/root/usr/lib:/opt/rh/httpd24/root/usr/lib64:/opt/rh/rh-perl530/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
ENV PATH=/opt/rh/devtoolset-11/root/usr/bin:/opt/rh/rh-git227/root/usr/bin:/opt/rh/rh-perl530/root/usr/local/bin:/opt/rh/rh-perl530/root/usr/bin${PATH:+:${PATH}}

RUN . /opt/rh/devtoolset-11/enable && wget https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \
tar -xvf qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \
mkdir build && cd build && \
../qt-everywhere-src-${QT_VERSION}/configure -opensource -confirm-license -force-debug-info -separate-debug-info \
-xcb -xcb-xlib -bundled-xcb-xinput -skip qtwebengine -skip qtdatavis3d -skip qtmultimedia -skip qtquick3d \
-skip qtquickcontrols -skip qtquickcontrols2 -skip qtquicktimeline -skip qt3d -skip qtdeclarative \
-skip qtscript -skip qtcharts -skip qtdoc -skip qtwebsockets -skip qtgamepad -skip qtgraphicaleffects \
-skip qtpurchasing -skip qtserialbus -skip qtserialport -skip qtwebchannel -skip qtwebglplugin \
-skip qtwebview -skip qtlocation -skip qtspeech -skip qtwinextras \
-release -ssl -no-compile-examples -cups -I /usr/include/openssl11 -prefix /usr -linker gold && \
make -j$(nproc) && make install
ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-14/root/usr/lib64:/opt/rh/gcc-toolset-14/root/usr/lib:/opt/rh/gcc-toolset-14/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-14/root/usr/lib/dyninst:/opt/rh/gcc-toolset-14/root/usr/lib64:/opt/rh/gcc-toolset-14/root/usr/lib
ENV PATH=/opt/rh/gcc-toolset-14/root/usr/bin${PATH:+:${PATH}}

# Set environment variables for locale
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8

RUN . /opt/rh/gcc-toolset-14/enable

# qt
RUN cd /opt && mkdir qt && cd qt && wget https://download.qt.io/official_releases/qt/${QT_VERSION_SHORT}/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \
tar -xvf qt-everywhere-src-${QT_VERSION}.tar.xz && \
mkdir build && cd build && ../qt-everywhere-src-${QT_VERSION}/configure -opensource -confirm-license -force-debug-info -separate-debug-info \
-xcb -xcb-xlib -bundled-xcb-xinput \
-skip qtwebengine,qtwebsockets,qtwebchannel,qtquick3d,qtdatavis3d,qt3d,qtdeclarative \
-skip qtmultimedia,qtquicktimeline,qtgraphs,qtlottie \
-skip qtcharts,qtdoc,qtserialbus \
-skip qtserialport,qtwebview,qtlocation,qtspeech,qtgraphs \
-skip qtmqtt,qtopcua,qtquick3dphysics,qtquickeffectmaker,qtvirtualkeyboard,qtscxml \
-skip qtremoteobjects,qtsensors,qtpositioning,qthttpserver,qtgrpc,qtconnectivity,qtcoap \
-skip qtactiveqt,qtlanguageserver,qtshadertools,qtnetworkauth \
-release -ssl -nomake examples -cups -I /usr/include/openssl11 -prefix /usr -linker gold && \
ninja install && cd /opt && rm -Rf qt

# qcustomplot
RUN cd /opt && mkdir qcustomplot && cd qcustomplot && \
wget https://www.qcustomplot.com/release/${QCustomPlot_VERSION}/QCustomPlot.tar.gz && tar -xf QCustomPlot.tar.gz && \
cd qcustomplot && cp qcustomplot.h /usr/include && \
wget https://www.qcustomplot.com/release/${QCustomPlot_VERSION}/QCustomPlot-sharedlib.tar.gz && \
tar -xf QCustomPlot-sharedlib.tar.gz && ls && cd qcustomplot-sharedlib/sharedlib-compilation \
&& qmake . && make -j$(nproc) && mv libqcustomplot.so* /usr/lib
&& qmake . && make -j$(nproc) && mv libqcustomplot.so* /usr/lib && cd /opt && rm -Rf qcustomplot

# rust demangle
RUN cd /opt/ && mkdir rust && cd rust && wget https://sh.rustup.rs -O rustup.sh && \
chmod +x rustup.sh && ./rustup.sh -y && \
git clone -b ${rust_demangler_VERSION} https://github.com/rust-lang/rustc-demangle && \
cd rustc-demangle && $HOME/.cargo/bin/cargo build -p rustc-demangle-capi --release && \
cp target/release/librustc_demangle.so /usr/lib/
cp target/release/librustc_demangle.so /usr/lib/ && cd /opt && rm -Rf rust

# dlang demangle
RUN cd /opt && mkdir dlang && cd dlang && \
Expand All @@ -93,35 +106,36 @@ RUN cd /opt && mkdir dlang && cd dlang && \
# link libphobos2 statically
sed -i 's/defaultlib=libphobos2.so/defaultlib=:libphobos2.a/' Makefile && \
make && mv libd_demangle.so /usr/lib/ && \
deactivate && mv /usr/bin/gpg{~,} && mv /usr/bin/gpg2{~,}
deactivate && mv /usr/bin/gpg{~,} && mv /usr/bin/gpg2{~,} && \
cd /opt && rm -Rf dlang

# kdesrc-build dependencies
RUN yum install -y libcanberra-devel gpgme-devel && \
cpan YAML::Syck JSON::XS YAML::XS
RUN cpan YAML::Syck JSON::XS YAML::XS

# kde frameworks
RUN cd /opt && git clone https://invent.kde.org/sdk/kdesrc-build.git
COPY kdesrc-buildrc /opt/kdesrc-build/

RUN ldconfig && \
cd /opt/kdesrc-build && \
sed -i -e "s/FULL_NPROC/$(nproc)/g" \
-e "s/HALF_NPROC/$(($(nproc)/2))/g" -e "s/%VERSION%/${KF5_VERSION}/g" kdesrc-buildrc && \
-e "s/HALF_NPROC/$(($(nproc)/2))/g" -e "s/%VERSION%/${KF6_VERSION}/g" kdesrc-buildrc && \
./kdesrc-build --metadata-only && \
# fix compile error in kwallet
./kdesrc-build --include-dependencies qca && \
./kdesrc-build --ignore-modules=gpgme --include-dependencies threadweaver kconfigwidgets kcoreaddons \
kitemviews kitemmodels solid breeze-icons \
kwindowsystem knotifications kiconthemes karchive syntax-highlighting kio kparts && \
# without extra dependencies
./kdesrc-build --revision ${KGraphViewer_VERSION} --no-include-dependencies kgraphviewer
./kdesrc-build --revision ${KGraphViewer_VERSION} --no-include-dependencies kgraphviewer && \
./kdesrc-build --revision ${KDiagram_VERSION} --no-include-dependencies kdiagram && \
cd /opt && rm -Rf /opt/kdesrc-build/

# kddockwidgets
RUN cd /opt && git clone --recursive https://github.com/KDAB/KDDockWidgets.git -b ${KDDockWidgets_VERSION} && \
cd KDDockWidgets && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=/usr -DKDDockWidgets_EXAMPLES=0 -DKDDockWidgets_FRONTENDS="qtwidgets" .. && \
make -j$(nproc) && make install

# build new elfutils version
RUN cd /opt && wget https://sourceware.org/elfutils/ftp/0.190/elfutils-0.190.tar.bz2 && bzip2 -d elfutils-0.190.tar.bz2 && tar -xf elfutils-0.190.tar && cd elfutils-0.190 && ./configure --libdir=/usr/local/lib64 && make && make install
RUN cd /opt && mkdir kddw && cd kddw && git clone --recursive https://github.com/KDAB/KDDockWidgets.git -b ${KDDockWidgets_VERSION} && \
cd KDDockWidgets && mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DKDDockWidgets_EXAMPLES=0 -DKDDockWidgets_FRONTENDS="qtwidgets" -DKDDockWidgets_QT6=ON -G Ninja .. && \
ninja install && cd /opt && rm -Rf kddw

FROM builder AS stripped

Expand All @@ -140,11 +154,18 @@ RUN cd /opt && wget https://github.com/linuxdeploy/linuxdeploy/releases/download

FROM intermediate AS kdesrc-build

ENV LD_LIBRARY_PATH=/opt/rh/devtoolset-11/root/usr/lib64:/opt/rh/devtoolset-11/root/usr/lib:/opt/rh/devtoolset-11/root/usr/lib64/dyninst:/opt/rh/devtoolset-11/root/usr/lib/dyninst:/opt/rh/devtoolset-11/root/usr/lib64:/opt/rh/devtoolset-11/root/usr/lib:/opt/rh/httpd24/root/usr/lib64:/opt/rh/rh-perl530/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}:/usr/lib
ENV PATH=/opt/rh/devtoolset-11/root/usr/bin:/opt/rh/rh-git227/root/usr/bin:/opt/rh/rh-perl530/root/usr/local/bin:/opt/rh/rh-perl530/root/usr/bin${PATH:+:${PATH}}
ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-14/root/usr/lib64:/opt/rh/gcc-toolset-14/root/usr/lib:/opt/rh/gcc-toolset-14/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-14/root/usr/lib/dyninst:/opt/rh/gcc-toolset-14/root/usr/lib64:/opt/rh/gcc-toolset-14/root/usr/lib:/opt/rh/rh-perl530/root/usr/lib64:/usr/lib
ENV PATH=/opt/rh/gcc-toolset-14/root/usr/bin:/opt/rh/rh-git227/root/usr/bin:/opt/rh/rh-perl530/root/usr/local/bin:/opt/rh/rh-perl530/root/usr/bin${PATH:+:${PATH}}

# Set environment variables for locale
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8

RUN git config --global --add safe.directory /github/workspace

COPY --from=stripped /usr /usr
COPY --from=stripped /usr/local/lib64 /opt/rh/devtoolset-11/root/lib64
COPY --from=stripped /usr/local/lib64 /opt/rh/gcc-toolset-14/root/lib64

# set the entrypoint to the build script so that the build script will be run by github actions
CMD ["/github/workspace/scripts/appimage/build_appimage.sh", "/github/workspace", "/github/workspace/build"]
Expand All @@ -163,8 +184,13 @@ RUN cd / && wget https://github.com/cli/cli/releases/download/v2.49.2/gh_2.49.2

FROM intermediate AS debuginfo

ENV LD_LIBRARY_PATH=/opt/rh/devtoolset-11/root/usr/lib64:/opt/rh/devtoolset-11/root/usr/lib:/opt/rh/devtoolset-11/root/usr/lib64/dyninst:/opt/rh/devtoolset-11/root/usr/lib/dyninst:/opt/rh/devtoolset-11/root/usr/lib64:/opt/rh/devtoolset-11/root/usr/lib:/opt/rh/httpd24/root/usr/lib64:/opt/rh/rh-perl530/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}:/usr/lib
ENV PATH=/opt/rh/devtoolset-11/root/usr/bin:/opt/rh/rh-git227/root/usr/bin:/opt/rh/rh-perl530/root/usr/local/bin:/opt/rh/rh-perl530/root/usr/bin${PATH:+:${PATH}}
ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-14/root/usr/lib64:/opt/rh/gcc-toolset-14/root/usr/lib:/opt/rh/gcc-toolset-14/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-14/root/usr/lib/dyninst:/opt/rh/gcc-toolset-14/root/usr/lib64:/opt/rh/gcc-toolset-14/root/usr/lib:/usr/lib
ENV PATH=/opt/rh/gcc-toolset-14/root/usr/bin${PATH:+:${PATH}}

# Set environment variables for locale
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8

COPY --from=debugcollector /qt-debuginfo-x86_64.tar.bz2 /
COPY --from=debugcollector /gh_2.49.2_linux_amd64/bin/gh /usr/bin/
Expand Down
11 changes: 6 additions & 5 deletions scripts/appimage/build_appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@ fi

gitversion=$(git -C "$srcdir" describe)

. /opt/rh/devtoolset-11/enable
. /opt/rh/gcc-toolset-14/enable

mkdir -p "$buildir" && cd "$buildir"
# KGraphViewer triggers strange crashes in the AppImage, disable it
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_PREFIX_PATH=/opt/rh/devtoolset-11/root/ \
-DCMAKE_PREFIX_PATH=/opt/rh/gcc-toolset-14/root/ \
-DCMAKE_DISABLE_FIND_PACKAGE_KGraphViewerPart=ON \
-DAPPIMAGE_BUILD=ON "-DCMAKE_INSTALL_PREFIX=/usr" "$srcdir"
-DAPPIMAGE_BUILD=ON -DCMAKE_INSTALL_PREFIX=/usr -DQT6_BUILD=ON "$srcdir"

make -j$(nproc)
rm -Rf appdir
DESTDIR=appdir make install

tar -cjvf "/github/workspace/hotspot-debuginfo-$gitversion-x86_64.tar.bz2" \
--transform="s#appdir/#hotspot-debuginfo-$gitversion/#" \
appdir/usr/bin/hotspot appdir/usr/lib64/libexec/hotspot-perfparser
appdir/usr/bin/hotspot appdir/usr/libexec/hotspot-perfparser

# FIXME: Do in CMakeLists.txt
mkdir -p "appdir/usr/share/applications/"
Expand Down Expand Up @@ -68,7 +69,7 @@ mkdir -p appdir/usr/plugins/wayland-shell-integration/
cp /usr/plugins/wayland-shell-integration/libxdg-shell.so appdir/usr/plugins/wayland-shell-integration/

linuxdeploy --appdir appdir --plugin qt \
-e "./appdir/usr/lib64/libexec/hotspot-perfparser" \
-e "./appdir/usr/libexec/hotspot-perfparser" \
-e "./appdir/usr/bin/hotspot" \
-l "/usr/lib64/libz.so.1" \
-l /usr/lib64/libharfbuzz.so.0 \
Expand Down
53 changes: 47 additions & 6 deletions scripts/appimage/kdesrc-buildrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# This is a sample kdesrc-build configuration file appropriate for KDE
# Frameworks 5-based build environments.
# Frameworks 6-based build environments.
#
# See the kdesrc-buildrc-sample for explanations of what the options do, or
# view the manpage or kdesrc-build documentation at
# https://docs.kde.org/?application=kdesrc-build
#
# SPDX-FileCopyrightText: Milian Wolff <milian.wolff@kdab.com>
# SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
# SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
global
branch-group kf5-qt5
branch-group kf6-qt6
install-dir /usr # Where to install KF5-based software
# Uncomment this and edit value to choose a different Qt5
qt-install-dir /usr # Where to find Qt5
Expand All @@ -33,12 +33,12 @@ global
end global

# Instead of specifying modules here, the current best practice is to refer to
# KF5 module lists maintained with kdesrc-build by the KF5 developers. As new
# modules are added or modified, the kdesrc-build KF5 module list is altered to
# KF module lists maintained with kdesrc-build by the KF developers. As new
# modules are added or modified, the kdesrc-build KF module list is altered to
# suit, and when you update kdesrc-build you will automatically pick up the
# needed changes.

include ${module-definitions-dir}/kf5-qt5.ksb
include ${module-definitions-dir}/kf6-qt6.ksb

# If you wish to maintain the module list yourself that is possible, simply
# look at the files pointed to above and use the "module-set" declarations that
Expand All @@ -51,6 +51,39 @@ end options
# It is possible to change the options for modules loaded from the file
# included above (since it's not possible to add a module that's already been
# included), e.g.

options kcoreaddons
cmake-options -DKCOREADDONS_USE_QML=OFF -DBUILD_PYTHON_BINDINGS=OFF
end options

options kwidgetsaddons
cmake-options -DBUILD_PYTHON_BINDINGS=OFF
end options

options kguiaddons
cmake-options -DBUILD_PYTHON_BINDINGS=OFF
end options

options knotifications
cmake-options -DBUILD_PYTHON_BINDINGS=OFF
end options

options kjobwidgets
cmake-options -DBUILD_PYTHON_BINDINGS=OFF
end options

options kxmlgui
cmake-options -DBUILD_PYTHON_BINDINGS=OFF
end options

options kiconthemes
cmake-options -DKICONTHEMES_USE_QTQUICK=OFF
end options

options kwindowsystem
cmake-options -DKWINDOWSYSTEM_QML=OFF
end options

options kconfig
cmake-options -DKCONFIG_USE_QML=OFF
end options
Expand All @@ -63,6 +96,14 @@ options sonnet
cmake-options -DSONNET_USE_QML=OFF
end options

options ktextwidgets
cmake-options -DWITH_TEXT_TO_SPEECH=OFF
end options

options extra-cmake-modules
tag %VERSION%
end options

options breeze-icons
cmake-options -DBINARY_ICONS_RESOURCE=ON
end options
Loading