Skip to content

Commit

Permalink
CentOS 7 -> Rocky Linux 8
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin committed Aug 10, 2023
1 parent f7bff01 commit b23fe27
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 78 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ on:
jobs:

linux:
name: CentOS 7
name: Rocky Linux 8
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository }}/centos_env
Expand All @@ -51,7 +51,7 @@ jobs:

defaults:
run:
shell: scl enable rh-python38 -- scl enable llvm-toolset-7.0 -- scl enable devtoolset-10 -- bash --noprofile --norc -eo pipefail {0}
shell: scl enable gcc-toolset-12 -- bash --noprofile --norc -eo pipefail {0}

strategy:
matrix:
Expand Down
6 changes: 3 additions & 3 deletions Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ void PremultiplyLine(uchar *dst, const uchar *src, int intsCount) {
}
const auto va = [&] {
const auto list = std::array{
"libva-drm.so.1",
"libva-x11.so.1",
"libva.so.1",
"libva-drm.so.2",
"libva-x11.so.2",
"libva.so.2",
"libdrm.so.2",
};
for (const auto lib : list) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,21 +411,11 @@ bool NotificationData::init(
_notification->set_icon(
Gio::ThemedIcon::create(base::IconName().toStdString()));

// glib 2.42+, we keep glib 2.40+ compatibility
static const auto set_priority = [] {
// reset dlerror after dlsym call
const auto guard = gsl::finally([] { dlerror(); });
return reinterpret_cast<decltype(&g_notification_set_priority)>(
dlsym(RTLD_DEFAULT, "g_notification_set_priority"));
}();

if (set_priority) {
// for chat messages, according to
// https://docs.gtk.org/gio/enum.NotificationPriority.html
set_priority(_notification->gobj(), G_NOTIFICATION_PRIORITY_HIGH);
}
// for chat messages, according to
// https://docs.gtk.org/gio/enum.NotificationPriority.html
_notification->set_priority(Gio::Notification::Priority::HIGH);

// glib 2.70+, we keep glib 2.40+ compatibility
// glib 2.70+, we keep glib 2.56+ compatibility
static const auto set_category = [] {
// reset dlerror after dlsym call
const auto guard = gsl::finally([] { dlerror(); });
Expand Down
78 changes: 19 additions & 59 deletions Telegram/build/docker/centos_env/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,25 @@

# syntax=docker/dockerfile:1

FROM centos:7 AS builder-base
ENV LANG en_US.UTF-8
FROM rockylinux:8 AS builder-base
ENV LANG C.UTF-8
ENV LIBRARY_PATH /usr/local/lib64:/usr/local/lib:/lib64:/lib:/usr/lib64:/usr/lib
ENV LD_LIBRARY_PATH $LIBRARY_PATH
ENV PKG_CONFIG_PATH /usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig

RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
&& yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm \
&& yum -y install centos-release-scl \
&& yum -y install git rh-python38-python-pip rh-python38-python-devel \
autoconf automake libtool patch gperf flex \
fontconfig-devel freetype-devel libX11-devel at-spi2-core-devel alsa-lib-devel \
pulseaudio-libs-devel mesa-libGL-devel mesa-libEGL-devel mesa-libgbm-devel \
libdrm-devel vulkan-devel libva-devel libvdpau-devel boost169-devel fmt-devel \
gtk3-devel perl-XML-Parser pkgconfig bison yasm file which xorg-x11-util-macros \
devtoolset-10-make devtoolset-10-gcc devtoolset-10-gcc-c++ \
devtoolset-10-binutils llvm-toolset-7.0 llvm-toolset-7.0-clang-devel \
llvm-toolset-7.0-llvm-devel \
&& yum clean all

# Fix a bug with argument naming in CentOS 7 glibc
RUN sed -i 's/char \*__block/char */' /usr/include/unistd.h

SHELL [ "bash", "-c", ". /opt/rh/rh-python38/enable; . /opt/rh/devtoolset-10/enable; exec bash -c \"$@\"", "-s"]
RUN dnf -y install epel-release \
&& dnf config-manager --set-enabled powertools \
&& dnf -y install autoconf automake libtool pkgconfig make patch git \
python3.11-pip python3.11-devel gperf flex bison clang lld yasm \
file which perl-open perl-XML-Parser xorg-x11-util-macros \
gcc-toolset-12-gcc gcc-toolset-12-gcc-c++ gcc-toolset-12-binutils \
libffi-devel fontconfig-devel freetype-devel libX11-devel wayland-devel \
alsa-lib-devel pulseaudio-libs-devel mesa-libGL-devel mesa-libEGL-devel \
mesa-libgbm-devel libdrm-devel vulkan-devel libva-devel libvdpau-devel \
glib2-devel at-spi2-core-devel gtk3-devel boost1.78-devel fmt-devel \
&& dnf clean all

SHELL [ "bash", "-c", ". /opt/rh/gcc-toolset-12/enable; exec bash -c \"$@\"", "-s"]

WORKDIR {{ LibrariesPath }}

Expand All @@ -52,7 +47,7 @@ FROM builder-base AS builder
ENV AR gcc-ar
ENV RANLIB gcc-ranlib
ENV NM gcc-nm
ENV CFLAGS {% if DEBUG %}-g{% endif %} -O3 {% if LTO %}{{ CFLAGS_LTO }}{% endif %} -pipe -fPIC -fstack-protector-all -fstack-clash-protection -fcf-protection -DNDEBUG -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS
ENV CFLAGS {% if DEBUG %}-g{% endif %} -O3 {% if LTO %}{{ CFLAGS_LTO }}{% endif %} -pipe -fPIC -fstack-protector-all -fstack-clash-protection -fcf-protection -DNDEBUG -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS
ENV CXXFLAGS $CFLAGS

FROM builder AS patches
Expand All @@ -74,16 +69,6 @@ RUN git clone -b nasm-2.15.05 --depth=1 {{ GIT }}/netwide-assembler/nasm.git \
&& cd .. \
&& rm -rf nasm

FROM builder AS libffi
RUN git clone -b v3.4.2 --depth=1 {{ GIT }}/libffi/libffi.git \
&& cd libffi \
&& ./autogen.sh \
&& ./configure --enable-static --disable-docs \
&& make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/libffi-cache" install \
&& cd .. \
&& rm -rf libffi

FROM builder AS zlib
RUN git clone -b v1.2.11 --depth=1 {{ GIT }}/madler/zlib.git \
&& cd zlib \
Expand Down Expand Up @@ -467,23 +452,6 @@ RUN git clone -b libXcomposite-0.4.5 --depth=1 {{ GIT_FREEDESKTOP }}/libxcomposi
&& cd .. \
&& rm -rf libxcomposite

FROM builder AS wayland
COPY --link --from=libffi {{ LibrariesPath }}/libffi-cache /

RUN git clone -b 1.21.0 --depth=1 {{ GIT_FREEDESKTOP }}/wayland.git \
&& cd wayland \
&& meson build \
--buildtype=plain \
--default-library=both \
-Dtests=false \
-Ddocumentation=false \
-Ddtd_validation=false \
-Dicon_directory=/usr/share/icons \
&& meson compile -C build \
&& DESTDIR="{{ LibrariesPath }}/wayland-cache" meson install -C build \
&& cd .. \
&& rm -rf wayland

FROM builder AS nv-codec-headers
RUN git clone -b n11.1.5.1 --depth=1 {{ GIT }}/FFmpeg/nv-codec-headers.git \
&& DESTDIR="{{ LibrariesPath }}/nv-codec-headers-cache" make -C nv-codec-headers install \
Expand Down Expand Up @@ -700,8 +668,6 @@ RUN git clone -b xkbcommon-1.3.1 --depth=1 {{ GIT }}/xkbcommon/libxkbcommon.git
&& rm -rf libxkbcommon

FROM patches AS glibmm
COPY --link --from=libffi {{ LibrariesPath }}/libffi-cache /

RUN git clone -b 2.77.0 --depth=1 {{ GIT }}/GNOME/glibmm.git \
&& cd glibmm \
&& git apply ../patches/glibmm.patch \
Expand All @@ -721,7 +687,6 @@ RUN git clone -b 2.77.0 --depth=1 {{ GIT }}/GNOME/glibmm.git \
&& rm -rf glibmm

FROM builder AS gobject-introspection
COPY --link --from=libffi {{ LibrariesPath }}/libffi-cache /
COPY --link --from=glibmm {{ LibrariesPath }}/glibmm-cache /

RUN git clone -b 1.76.1 --depth=1 {{ GIT }}/GNOME/gobject-introspection.git \
Expand All @@ -733,7 +698,6 @@ RUN git clone -b 1.76.1 --depth=1 {{ GIT }}/GNOME/gobject-introspection.git \
&& rm -rf gobject-introspection

FROM patches AS qt
COPY --link --from=libffi {{ LibrariesPath }}/libffi-cache /
COPY --link --from=zlib {{ LibrariesPath }}/zlib-cache /
COPY --link --from=libproxy {{ LibrariesPath }}/libproxy-cache /
COPY --link --from=lcms2 {{ LibrariesPath }}/lcms2-cache /
Expand All @@ -745,7 +709,6 @@ COPY --link --from=xcb-image {{ LibrariesPath }}/xcb-image-cache /
COPY --link --from=xcb-keysyms {{ LibrariesPath }}/xcb-keysyms-cache /
COPY --link --from=xcb-render-util {{ LibrariesPath }}/xcb-render-util-cache /
COPY --link --from=xcb-cursor {{ LibrariesPath }}/xcb-cursor-cache /
COPY --link --from=wayland {{ LibrariesPath }}/wayland-cache /
COPY --link --from=openssl {{ LibrariesPath }}/openssl-cache /
COPY --link --from=xkbcommon {{ LibrariesPath }}/xkbcommon-cache /

Expand All @@ -767,7 +730,6 @@ RUN git clone -b {{ QT_TAG }} --depth=1 https://code.qt.io/qt/qt5.git qt_{{ QT }
-qt-pcre \
-no-icu \
-no-feature-xcb-sm \
-no-feature-egl-extension-platform-wayland \
-static \
-dbus-runtime \
-openssl-linked \
Expand Down Expand Up @@ -840,7 +802,6 @@ RUN cmake --build out --config Debug --parallel \
{%- endif %}

FROM builder-base
COPY --link --from=libffi {{ LibrariesPath }}/libffi-cache /
COPY --link --from=zlib {{ LibrariesPath }}/zlib-cache /
COPY --link --from=xz {{ LibrariesPath }}/xz-cache /
COPY --link --from=protobuf {{ LibrariesPath }}/protobuf protobuf
Expand Down Expand Up @@ -872,7 +833,6 @@ COPY --link --from=libXrandr {{ LibrariesPath }}/libXrandr-cache /
COPY --link --from=libXrender {{ LibrariesPath }}/libXrender-cache /
COPY --link --from=libXdamage {{ LibrariesPath }}/libXdamage-cache /
COPY --link --from=libXcomposite {{ LibrariesPath }}/libXcomposite-cache /
COPY --link --from=wayland {{ LibrariesPath }}/wayland-cache /
COPY --link --from=ffmpeg {{ LibrariesPath }}/ffmpeg-cache /
COPY --link --from=openal {{ LibrariesPath }}/openal-cache /
COPY --link --from=openssl {{ LibrariesPath }}/openssl-cache /
Expand All @@ -891,9 +851,9 @@ COPY --link --from=webrtc_debug {{ LibrariesPath }}/tg_owt/out/Debug tg_owt/out/
WORKDIR ../tdesktop
ENV QT {{ QT }}
ENV OPENSSL_ROOT_DIR {{ OPENSSL_PREFIX }}
ENV BOOST_INCLUDEDIR /usr/include/boost169
ENV BOOST_LIBRARYDIR /usr/lib64/boost169
ENV BOOST_INCLUDEDIR /usr/include/boost1.78
ENV BOOST_LIBRARYDIR /usr/lib64/boost1.78

VOLUME [ "/usr/src/tdesktop" ]
ENTRYPOINT [ "scl", "enable", "rh-python38", "--", "scl", "enable", "llvm-toolset-7.0", "--", "scl", "enable", "devtoolset-10", "--" ]
ENTRYPOINT [ "scl", "enable", "gcc-toolset-12", "--" ]
CMD [ "/usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh" ]

0 comments on commit b23fe27

Please sign in to comment.