Have unified compiler flags in Dockerfile

This commit is contained in:
Ilya Fedin 2022-10-05 14:27:34 +04:00 committed by John Preston
parent 435e4f2783
commit 0c514c4b0a

View file

@ -7,13 +7,12 @@
{%- set OPENSSL_PREFIX = "/usr/local/desktop-app/openssl-1.1.1" -%} {%- set OPENSSL_PREFIX = "/usr/local/desktop-app/openssl-1.1.1" -%}
{%- set CMAKE_VER = "3.21.3" -%} {%- set CMAKE_VER = "3.21.3" -%}
{%- set CMAKE_FILE = "cmake-" ~ CMAKE_VER ~ "-Linux-x86_64.sh" -%} {%- set CMAKE_FILE = "cmake-" ~ CMAKE_VER ~ "-Linux-x86_64.sh" -%}
{%- set HFLAGS_DEBUG = "-fstack-protector-all -fstack-clash-protection -fPIC" -%} {%- set CFLAGS_DEBUG = "-g -pipe -fPIC -fstack-protector-all -fstack-clash-protection -D_GLIBCXX_ASSERTIONS" -%}
{%- set HFLAGS = HFLAGS_DEBUG ~ " -D_FORTIFY_SOURCE=2" -%}
{%- set LibrariesPath = "/usr/src/Libraries" -%} {%- set LibrariesPath = "/usr/src/Libraries" -%}
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
FROM centos:7 AS builder FROM centos:7 AS builder-base
ENV PKG_CONFIG_PATH /usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig 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 \ RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
@ -29,8 +28,7 @@ RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n
llvm-toolset-7.0-llvm-devel \ llvm-toolset-7.0-llvm-devel \
&& yum clean all && yum clean all
RUN python3 -m pip install meson RUN python3 -m pip install meson ninja
RUN python3 -m pip install ninja
# Fix a bug with argument naming in CentOS 7 glibc # Fix a bug with argument naming in CentOS 7 glibc
RUN sed -i 's/char \*__block/char */' /usr/include/unistd.h RUN sed -i 's/char \*__block/char */' /usr/include/unistd.h
@ -45,6 +43,13 @@ RUN mkdir /opt/cmake \
&& ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake \ && ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake \
&& rm {{ CMAKE_FILE }} && rm {{ CMAKE_FILE }}
FROM builder-base AS builder
ENV AR gcc-ar
ENV RANLIB gcc-ranlib
ENV NM gcc-nm
ENV CFLAGS {% if DEBUG %}-g{% endif %} -Ofast {% if DEBUG %}-flto -ffat-lto-objects{% endif %} -pipe -fPIC -fstack-protector-all -fstack-clash-protection -DNDEBUG -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS
ENV CXXFLAGS $CFLAGS
FROM builder AS patches FROM builder AS patches
RUN git clone {{ GIT }}/desktop-app/patches.git \ RUN git clone {{ GIT }}/desktop-app/patches.git \
&& cd patches \ && cd patches \
@ -75,7 +80,7 @@ RUN git clone -b v3.4.2 --depth=1 {{ GIT }}/libffi/libffi.git \
FROM builder AS zlib FROM builder AS zlib
RUN git clone -b v1.2.11 --depth=1 {{ GIT }}/madler/zlib.git \ RUN git clone -b v1.2.11 --depth=1 {{ GIT }}/madler/zlib.git \
&& cd zlib \ && cd zlib \
&& CFLAGS="-O3 {{ HFLAGS }}" ./configure --static \ && ./configure --static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/zlib-cache" install \ && make DESTDIR="{{ LibrariesPath }}/zlib-cache" install \
&& cd .. \ && cd .. \
@ -84,7 +89,7 @@ RUN git clone -b v1.2.11 --depth=1 {{ GIT }}/madler/zlib.git \
FROM builder AS xz FROM builder AS xz
RUN git clone -b v5.2.5 https://git.tukaani.org/xz.git \ RUN git clone -b v5.2.5 https://git.tukaani.org/xz.git \
&& cd xz \ && cd xz \
&& CFLAGS="{{ HFLAGS }}" cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=Release \ && cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=None \
&& cmake --build build --parallel \ && cmake --build build --parallel \
&& DESTDIR="{{ LibrariesPath }}/xz-cache" cmake --install build \ && DESTDIR="{{ LibrariesPath }}/xz-cache" cmake --install build \
&& cd .. \ && cd .. \
@ -94,8 +99,8 @@ FROM patches AS libproxy
RUN git clone -b 0.4.17 --depth=1 {{ GIT }}/libproxy/libproxy.git \ RUN git clone -b 0.4.17 --depth=1 {{ GIT }}/libproxy/libproxy.git \
&& cd libproxy \ && cd libproxy \
&& git apply ../patches/libproxy.patch \ && git apply ../patches/libproxy.patch \
&& CFLAGS="{{ HFLAGS }}" CXXFLAGS="{{ HFLAGS }}" cmake -GNinja -B build . \ && cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=None \
-DWITH_DBUS=OFF \ -DWITH_DBUS=OFF \
-DWITH_NM=OFF \ -DWITH_NM=OFF \
-DWITH_NMold=OFF \ -DWITH_NMold=OFF \
@ -108,7 +113,7 @@ FROM builder AS lcms2
RUN git clone -b lcms2.13.1 --depth=1 {{ GIT }}/mm2/Little-CMS.git \ RUN git clone -b lcms2.13.1 --depth=1 {{ GIT }}/mm2/Little-CMS.git \
&& cd Little-CMS \ && cd Little-CMS \
&& meson build \ && meson build \
--buildtype=release \ --buildtype=plain \
--default-library=both \ --default-library=both \
&& meson compile -C build \ && meson compile -C build \
&& DESTDIR="{{ LibrariesPath }}/lcms2-cache" meson install -C build \ && DESTDIR="{{ LibrariesPath }}/lcms2-cache" meson install -C build \
@ -119,7 +124,7 @@ FROM builder AS brotli
RUN git clone -b v1.0.9 --depth=1 {{ GIT }}/google/brotli.git \ RUN git clone -b v1.0.9 --depth=1 {{ GIT }}/google/brotli.git \
&& cd brotli \ && cd brotli \
&& cmake -GNinja -B build . \ && cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=None \
-DBROTLI_DISABLE_TESTS=ON \ -DBROTLI_DISABLE_TESTS=ON \
&& cmake --build build --parallel \ && cmake --build build --parallel \
&& DESTDIR="{{ LibrariesPath }}/brotli-cache" cmake --install build \ && DESTDIR="{{ LibrariesPath }}/brotli-cache" cmake --install build \
@ -130,7 +135,7 @@ FROM builder AS highway
RUN git clone -b 1.0.1 --depth=1 {{ GIT }}/google/highway.git \ RUN git clone -b 1.0.1 --depth=1 {{ GIT }}/google/highway.git \
&& cd highway \ && cd highway \
&& cmake -GNinja -B build . \ && cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=None \
-DBUILD_TESTING=OFF \ -DBUILD_TESTING=OFF \
-DHWY_ENABLE_CONTRIB=OFF \ -DHWY_ENABLE_CONTRIB=OFF \
-DHWY_ENABLE_EXAMPLES=OFF \ -DHWY_ENABLE_EXAMPLES=OFF \
@ -142,8 +147,8 @@ RUN git clone -b 1.0.1 --depth=1 {{ GIT }}/google/highway.git \
FROM builder AS mozjpeg FROM builder AS mozjpeg
RUN git clone -b v4.0.3 --depth=1 {{ GIT }}/mozilla/mozjpeg.git \ RUN git clone -b v4.0.3 --depth=1 {{ GIT }}/mozilla/mozjpeg.git \
&& cd mozjpeg \ && cd mozjpeg \
&& CFLAGS="{{ HFLAGS }}" cmake -GNinja -B build . \ && cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr/local \ -DCMAKE_INSTALL_PREFIX=/usr/local \
-DWITH_JPEG8=ON \ -DWITH_JPEG8=ON \
-DPNG_SUPPORTED=OFF \ -DPNG_SUPPORTED=OFF \
@ -156,7 +161,7 @@ FROM builder AS opus
RUN git clone -b v1.3.1 --depth=1 {{ GIT }}/xiph/opus.git \ RUN git clone -b v1.3.1 --depth=1 {{ GIT }}/xiph/opus.git \
&& cd opus \ && cd opus \
&& ./autogen.sh \ && ./autogen.sh \
&& CFLAGS="-g -O2 {{ HFLAGS }}" ./configure \ && ./configure --enable-float-approx \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/opus-cache" install \ && make DESTDIR="{{ LibrariesPath }}/opus-cache" install \
&& cd .. \ && cd .. \
@ -168,7 +173,7 @@ COPY --link --from=nasm {{ LibrariesPath }}/nasm-cache /
RUN git clone -b 1.0.0 --depth=1 {{ GIT }}/videolan/dav1d.git \ RUN git clone -b 1.0.0 --depth=1 {{ GIT }}/videolan/dav1d.git \
&& cd dav1d \ && cd dav1d \
&& meson build \ && meson build \
--buildtype=release \ --buildtype=plain \
--default-library=both \ --default-library=both \
-Denable_tools=false \ -Denable_tools=false \
-Denable_tests=false \ -Denable_tests=false \
@ -181,7 +186,7 @@ FROM builder AS libde265
RUN git clone -b v1.0.8 --depth=1 {{ GIT }}/strukturag/libde265.git \ RUN git clone -b v1.0.8 --depth=1 {{ GIT }}/strukturag/libde265.git \
&& cd libde265 \ && cd libde265 \
&& cmake -GNinja . \ && cmake -GNinja . \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=None \
-DBUILD_SHARED_LIBS=OFF \ -DBUILD_SHARED_LIBS=OFF \
-DENABLE_SDL=OFF \ -DENABLE_SDL=OFF \
&& cmake --build . --parallel \ && cmake --build . --parallel \
@ -192,7 +197,7 @@ RUN git clone -b v1.0.8 --depth=1 {{ GIT }}/strukturag/libde265.git \
FROM builder AS libvpx FROM builder AS libvpx
RUN git clone -b v1.11.0 --depth=1 {{ GIT }}/webmproject/libvpx.git \ RUN git clone -b v1.11.0 --depth=1 {{ GIT }}/webmproject/libvpx.git \
&& cd libvpx \ && cd libvpx \
&& ./configure \ && CFLAGS="$CFLAGS -fno-lto" CXXFLAGS="$CXXFLAGS -fno-lto" ./configure \
--disable-examples \ --disable-examples \
--disable-unit-tests \ --disable-unit-tests \
--disable-tools \ --disable-tools \
@ -211,7 +216,7 @@ COPY --link --from=dav1d {{ LibrariesPath }}/dav1d-cache /
RUN git clone -b v0.10.1 --depth=1 {{ GIT }}/AOMediaCodec/libavif.git \ RUN git clone -b v0.10.1 --depth=1 {{ GIT }}/AOMediaCodec/libavif.git \
&& cd libavif \ && cd libavif \
&& cmake -GNinja -B build . \ && cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=None \
-DBUILD_SHARED_LIBS=OFF \ -DBUILD_SHARED_LIBS=OFF \
-DAVIF_CODEC_DAV1D=ON \ -DAVIF_CODEC_DAV1D=ON \
&& cmake --build build --parallel \ && cmake --build build --parallel \
@ -225,7 +230,7 @@ COPY --link --from=libde265 {{ LibrariesPath }}/libde265-cache /
RUN git clone -b v1.13.0 --depth=1 {{ GIT }}/strukturag/libheif.git \ RUN git clone -b v1.13.0 --depth=1 {{ GIT }}/strukturag/libheif.git \
&& cd libheif \ && cd libheif \
&& cmake -GNinja -B build . \ && cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=None \
-DBUILD_SHARED_LIBS=OFF \ -DBUILD_SHARED_LIBS=OFF \
-DWITH_X265=OFF \ -DWITH_X265=OFF \
-DWITH_AOM=OFF \ -DWITH_AOM=OFF \
@ -245,7 +250,7 @@ COPY --link --from=highway {{ LibrariesPath }}/highway-cache /
RUN git clone -b v0.7.0 --depth=1 {{ GIT }}/libjxl/libjxl.git \ RUN git clone -b v0.7.0 --depth=1 {{ GIT }}/libjxl/libjxl.git \
&& cd libjxl \ && cd libjxl \
&& cmake -GNinja -B build . \ && cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=None \
-DBUILD_SHARED_LIBS=OFF \ -DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTING=OFF \ -DBUILD_TESTING=OFF \
-DJPEGXL_ENABLE_DEVTOOLS=OFF \ -DJPEGXL_ENABLE_DEVTOOLS=OFF \
@ -266,7 +271,10 @@ RUN git clone -b v0.7.0 --depth=1 {{ GIT }}/libjxl/libjxl.git \
FROM builder AS rnnoise FROM builder AS rnnoise
RUN git clone -b master --depth=1 {{ GIT }}/desktop-app/rnnoise \ RUN git clone -b master --depth=1 {{ GIT }}/desktop-app/rnnoise \
&& cd rnnoise \ && cd rnnoise \
&& CFLAGS="{{ HFLAGS }}" cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=Release \ && cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_C_FLAGS="$CFLAGS -DFLOAT_APPROX" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS -DFLOAT_APPROX" \
&& cmake --build build --parallel \ && cmake --build build --parallel \
&& mkdir -p "{{ LibrariesPath }}/rnnoise-cache/usr/local/include" \ && mkdir -p "{{ LibrariesPath }}/rnnoise-cache/usr/local/include" \
&& cp "include/rnnoise.h" "{{ LibrariesPath }}/rnnoise-cache/usr/local/include/" \ && cp "include/rnnoise.h" "{{ LibrariesPath }}/rnnoise-cache/usr/local/include/" \
@ -289,7 +297,7 @@ COPY --link --from=xcb-proto {{ LibrariesPath }}/xcb-proto-cache /
RUN git clone -b libxcb-1.14 --depth=1 {{ GIT_FREEDESKTOP }}/libxcb.git \ RUN git clone -b libxcb-1.14 --depth=1 {{ GIT_FREEDESKTOP }}/libxcb.git \
&& cd libxcb \ && cd libxcb \
&& CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \ && ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/xcb-cache" install \ && make DESTDIR="{{ LibrariesPath }}/xcb-cache" install \
&& cd .. \ && cd .. \
@ -318,7 +326,7 @@ COPY --link --from=xcb-util {{ LibrariesPath }}/xcb-util-cache /
RUN git clone -b 0.4.0 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-image.git \ RUN git clone -b 0.4.0 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-image.git \
&& cd libxcb-image \ && cd libxcb-image \
&& CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \ && ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/xcb-image-cache" install \ && make DESTDIR="{{ LibrariesPath }}/xcb-image-cache" install \
&& cd .. \ && cd .. \
@ -327,7 +335,7 @@ RUN git clone -b 0.4.0 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-image.
FROM builder AS xcb-keysyms FROM builder AS xcb-keysyms
RUN git clone -b 0.4.0 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-keysyms.git \ RUN git clone -b 0.4.0 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-keysyms.git \
&& cd libxcb-keysyms \ && cd libxcb-keysyms \
&& CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \ && ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/xcb-keysyms-cache" install \ && make DESTDIR="{{ LibrariesPath }}/xcb-keysyms-cache" install \
&& cd .. \ && cd .. \
@ -336,7 +344,7 @@ RUN git clone -b 0.4.0 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-keysym
FROM builder AS xcb-render-util FROM builder AS xcb-render-util
RUN git clone -b 0.3.9 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-render-util.git \ RUN git clone -b 0.3.9 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-render-util.git \
&& cd libxcb-render-util \ && cd libxcb-render-util \
&& CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \ && ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/xcb-render-util-cache" install \ && make DESTDIR="{{ LibrariesPath }}/xcb-render-util-cache" install \
&& cd .. \ && cd .. \
@ -345,7 +353,7 @@ RUN git clone -b 0.3.9 --depth=1 --recursive {{ GIT_FREEDESKTOP }}/libxcb-render
FROM builder AS libXext FROM builder AS libXext
RUN git clone -b libXext-1.3.4 --depth=1 {{ GIT_FREEDESKTOP }}/libxext.git \ RUN git clone -b libXext-1.3.4 --depth=1 {{ GIT_FREEDESKTOP }}/libxext.git \
&& cd libxext \ && cd libxext \
&& CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \ && ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/libXext-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXext-cache" install \
&& cd .. \ && cd .. \
@ -354,7 +362,7 @@ RUN git clone -b libXext-1.3.4 --depth=1 {{ GIT_FREEDESKTOP }}/libxext.git \
FROM builder AS libXtst FROM builder AS libXtst
RUN git clone -b libXtst-1.2.3 --depth=1 {{ GIT_FREEDESKTOP }}/libxtst.git \ RUN git clone -b libXtst-1.2.3 --depth=1 {{ GIT_FREEDESKTOP }}/libxtst.git \
&& cd libxtst \ && cd libxtst \
&& CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \ && ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/libXtst-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXtst-cache" install \
&& cd .. \ && cd .. \
@ -363,7 +371,7 @@ RUN git clone -b libXtst-1.2.3 --depth=1 {{ GIT_FREEDESKTOP }}/libxtst.git \
FROM builder AS libXfixes FROM builder AS libXfixes
RUN git clone -b libXfixes-5.0.3 --depth=1 {{ GIT_FREEDESKTOP }}/libxfixes.git \ RUN git clone -b libXfixes-5.0.3 --depth=1 {{ GIT_FREEDESKTOP }}/libxfixes.git \
&& cd libxfixes \ && cd libxfixes \
&& CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \ && ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/libXfixes-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXfixes-cache" install \
&& cd .. \ && cd .. \
@ -372,7 +380,7 @@ RUN git clone -b libXfixes-5.0.3 --depth=1 {{ GIT_FREEDESKTOP }}/libxfixes.git \
FROM builder AS libXrandr FROM builder AS libXrandr
RUN git clone -b libXrandr-1.5.2 --depth=1 {{ GIT_FREEDESKTOP }}/libxrandr.git \ RUN git clone -b libXrandr-1.5.2 --depth=1 {{ GIT_FREEDESKTOP }}/libxrandr.git \
&& cd libxrandr \ && cd libxrandr \
&& CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \ && ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/libXrandr-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXrandr-cache" install \
&& cd .. \ && cd .. \
@ -381,7 +389,7 @@ RUN git clone -b libXrandr-1.5.2 --depth=1 {{ GIT_FREEDESKTOP }}/libxrandr.git \
FROM builder AS libXrender FROM builder AS libXrender
RUN git clone -b libXrender-0.9.10 --depth=1 {{ GIT_FREEDESKTOP }}/libxrender.git \ RUN git clone -b libXrender-0.9.10 --depth=1 {{ GIT_FREEDESKTOP }}/libxrender.git \
&& cd libxrender \ && cd libxrender \
&& CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \ && ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/libXrender-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXrender-cache" install \
&& cd .. \ && cd .. \
@ -390,7 +398,7 @@ RUN git clone -b libXrender-0.9.10 --depth=1 {{ GIT_FREEDESKTOP }}/libxrender.gi
FROM builder AS libXdamage FROM builder AS libXdamage
RUN git clone -b libXdamage-1.1.5 --depth=1 {{ GIT_FREEDESKTOP }}/libxdamage.git \ RUN git clone -b libXdamage-1.1.5 --depth=1 {{ GIT_FREEDESKTOP }}/libxdamage.git \
&& cd libxdamage \ && cd libxdamage \
&& CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \ && ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/libXdamage-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXdamage-cache" install \
&& cd .. \ && cd .. \
@ -399,7 +407,7 @@ RUN git clone -b libXdamage-1.1.5 --depth=1 {{ GIT_FREEDESKTOP }}/libxdamage.git
FROM builder AS libXcomposite FROM builder AS libXcomposite
RUN git clone -b libXcomposite-0.4.5 --depth=1 {{ GIT_FREEDESKTOP }}/libxcomposite.git \ RUN git clone -b libXcomposite-0.4.5 --depth=1 {{ GIT_FREEDESKTOP }}/libxcomposite.git \
&& cd libxcomposite \ && cd libxcomposite \
&& CFLAGS="-g -O2 {{ HFLAGS }}" ./autogen.sh --enable-static \ && ./autogen.sh --enable-static \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/libXcomposite-cache" install \ && make DESTDIR="{{ LibrariesPath }}/libXcomposite-cache" install \
&& cd .. \ && cd .. \
@ -411,7 +419,7 @@ COPY --link --from=libffi {{ LibrariesPath }}/libffi-cache /
RUN git clone -b 1.21.0 --depth=1 {{ GIT_FREEDESKTOP }}/wayland.git \ RUN git clone -b 1.21.0 --depth=1 {{ GIT_FREEDESKTOP }}/wayland.git \
&& cd wayland \ && cd wayland \
&& meson build \ && meson build \
--buildtype=release \ --buildtype=plain \
--default-library=both \ --default-library=both \
-Dtests=false \ -Dtests=false \
-Ddocumentation=false \ -Ddocumentation=false \
@ -438,9 +446,11 @@ RUN git init ffmpeg \
&& git fetch --depth=1 origin cc33e73618a981de7fd96385ecb34719de031f16 \ && git fetch --depth=1 origin cc33e73618a981de7fd96385ecb34719de031f16 \
&& git reset --hard FETCH_HEAD \ && git reset --hard FETCH_HEAD \
&& ./configure \ && ./configure \
--extra-cflags="-DCONFIG_SAFE_BITSTREAM_READER=1 {{ HFLAGS }}" \ --extra-cflags="-DCONFIG_SAFE_BITSTREAM_READER=1" \
--extra-cxxflags="-DCONFIG_SAFE_BITSTREAM_READER=1 {{ HFLAGS }}" \ --extra-cxxflags="-DCONFIG_SAFE_BITSTREAM_READER=1" \
--disable-debug \ --disable-debug \
--disable-optimizations \
--disable-inline-asm \
--disable-programs \ --disable-programs \
--disable-doc \ --disable-doc \
--disable-network \ --disable-network \
@ -557,7 +567,7 @@ FROM builder AS pipewire
RUN git clone -b 0.3.25 --depth=1 {{ GIT }}/PipeWire/pipewire.git \ RUN git clone -b 0.3.25 --depth=1 {{ GIT }}/PipeWire/pipewire.git \
&& cd pipewire \ && cd pipewire \
&& meson build \ && meson build \
--buildtype=release \ --buildtype=plain \
-Dtests=disabled \ -Dtests=disabled \
-Dexamples=disabled \ -Dexamples=disabled \
-Dspa-plugins=disabled \ -Dspa-plugins=disabled \
@ -571,8 +581,8 @@ COPY --link --from=pipewire {{ LibrariesPath }}/pipewire-cache /
RUN git clone -b 1.22.2 --depth=1 {{ GIT }}/kcat/openal-soft.git \ RUN git clone -b 1.22.2 --depth=1 {{ GIT }}/kcat/openal-soft.git \
&& cd openal-soft \ && cd openal-soft \
&& CFLAGS="{{ HFLAGS }}" CXXFLAGS="{{ HFLAGS }}" cmake -GNinja -B build . \ && cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=None \
-DLIBTYPE:STRING=STATIC \ -DLIBTYPE:STRING=STATIC \
-DALSOFT_EXAMPLES=OFF \ -DALSOFT_EXAMPLES=OFF \
-DALSOFT_UTILS=OFF \ -DALSOFT_UTILS=OFF \
@ -602,7 +612,7 @@ COPY --link --from=xcb {{ LibrariesPath }}/xcb-cache /
RUN git clone -b xkbcommon-1.3.1 --depth=1 {{ GIT }}/xkbcommon/libxkbcommon.git \ RUN git clone -b xkbcommon-1.3.1 --depth=1 {{ GIT }}/xkbcommon/libxkbcommon.git \
&& cd libxkbcommon \ && cd libxkbcommon \
&& meson build \ && meson build \
--buildtype=release \ --buildtype=plain \
--default-library=both \ --default-library=both \
-Denable-docs=false \ -Denable-docs=false \
-Denable-wayland=false \ -Denable-wayland=false \
@ -632,7 +642,7 @@ RUN git clone -b 2.10.7 --depth=1 {{ GIT }}/libsigcplusplus/libsigcplusplus.git
&& cd libsigcplusplus \ && cd libsigcplusplus \
&& export ACLOCAL_PATH="/usr/local/share/aclocal" \ && export ACLOCAL_PATH="/usr/local/share/aclocal" \
&& NOCONFIGURE=1 ./autogen.sh \ && NOCONFIGURE=1 ./autogen.sh \
&& CFLAGS="-g -O2 {{ HFLAGS }}" CXXFLAGS="-g -O2 {{ HFLAGS }}" ./configure \ && ./configure \
--enable-maintainer-mode \ --enable-maintainer-mode \
--enable-static \ --enable-static \
--disable-documentation \ --disable-documentation \
@ -651,7 +661,7 @@ RUN git clone -b 2.40.0 --depth=1 {{ GIT }}/GNOME/glibmm.git \
&& git apply ../patches/glibmm.patch \ && git apply ../patches/glibmm.patch \
&& export ACLOCAL_PATH="/usr/local/share/aclocal" \ && export ACLOCAL_PATH="/usr/local/share/aclocal" \
&& NOCONFIGURE=1 ./autogen.sh \ && NOCONFIGURE=1 ./autogen.sh \
&& CC="gcc -flto {{ HFLAGS }}" CXX="g++ -flto {{ HFLAGS }}" AR=gcc-ar RANLIB=gcc-ranlib ./configure \ && ./configure \
--enable-maintainer-mode \ --enable-maintainer-mode \
--enable-static \ --enable-static \
--disable-documentation \ --disable-documentation \
@ -684,10 +694,7 @@ RUN git clone -b {{ QT_TAG }} --depth=1 git://code.qt.io/qt/qt5.git qt_{{ QT }}
&& find ../../patches/qtbase_{{ QT }} -type f -print0 | sort -z | xargs -r0 git apply \ && find ../../patches/qtbase_{{ QT }} -type f -print0 | sort -z | xargs -r0 git apply \
&& cd .. \ && cd .. \
&& ./configure -prefix "{{ QT_PREFIX }}" \ && ./configure -prefix "{{ QT_PREFIX }}" \
-release \ CMAKE_BUILD_TYPE=None \
{%- if DEBUG %}
-force-debug-info \
{%- endif %}
-opensource \ -opensource \
-confirm-license \ -confirm-license \
-libproxy \ -libproxy \
@ -717,7 +724,7 @@ RUN git clone https://chromium.googlesource.com/breakpad/breakpad.git \
&& cd src/third_party/lss \ && cd src/third_party/lss \
&& git checkout e1e7b0ad8e \ && git checkout e1e7b0ad8e \
&& cd ../../.. \ && cd ../../.. \
&& ./configure \ && env -u CFLAGS -u CXXFLAGS ./configure \
&& make -j$(nproc) \ && make -j$(nproc) \
&& make DESTDIR="{{ LibrariesPath }}/breakpad-cache" install \ && make DESTDIR="{{ LibrariesPath }}/breakpad-cache" install \
&& cd .. \ && cd .. \
@ -740,11 +747,11 @@ RUN git init tg_owt \
&& git reset --hard FETCH_HEAD \ && git reset --hard FETCH_HEAD \
&& git submodule update --init --recursive --depth=1 \ && git submodule update --init --recursive --depth=1 \
&& rm -rf .git \ && rm -rf .git \
&& cmake -G"Ninja Multi-Config" -B out . \ && env -u CFLAGS -u CXXFLAGS cmake -G"Ninja Multi-Config" -B out . \
-DCMAKE_C_FLAGS_RELEASE="-O3 -DNDEBUG {{ HFLAGS }}" \ -DCMAKE_C_FLAGS_RELEASE="$CFLAGS" \
-DCMAKE_C_FLAGS_DEBUG="-g {{ HFLAGS_DEBUG }}" \ -DCMAKE_C_FLAGS_DEBUG="{{ CFLAGS_DEBUG }}" \
-DCMAKE_CXX_FLAGS_RELEASE="-O3 -DNDEBUG {{ HFLAGS }}" \ -DCMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
-DCMAKE_CXX_FLAGS_DEBUG="-g {{ HFLAGS_DEBUG }}" \ -DCMAKE_CXX_FLAGS_DEBUG="{{ CFLAGS_DEBUG }}" \
-DTG_OWT_SPECIAL_TARGET=linux \ -DTG_OWT_SPECIAL_TARGET=linux \
-DTG_OWT_LIBJPEG_INCLUDE_PATH=/usr/local/include \ -DTG_OWT_LIBJPEG_INCLUDE_PATH=/usr/local/include \
-DTG_OWT_OPENSSL_INCLUDE_PATH={{ OPENSSL_PREFIX }}/include \ -DTG_OWT_OPENSSL_INCLUDE_PATH={{ OPENSSL_PREFIX }}/include \
@ -765,7 +772,7 @@ RUN cmake --build out --config Debug --parallel \
&& find out -mindepth 1 -maxdepth 1 ! -name Debug -exec rm -rf {} \; && find out -mindepth 1 -maxdepth 1 ! -name Debug -exec rm -rf {} \;
{%- endif %} {%- endif %}
FROM builder FROM builder-base
COPY --link --from=libffi {{ LibrariesPath }}/libffi-cache / COPY --link --from=libffi {{ LibrariesPath }}/libffi-cache /
COPY --link --from=zlib {{ LibrariesPath }}/zlib-cache / COPY --link --from=zlib {{ LibrariesPath }}/zlib-cache /
COPY --link --from=xz {{ LibrariesPath }}/xz-cache / COPY --link --from=xz {{ LibrariesPath }}/xz-cache /