diff --git a/builder/build.sh b/builder/build.sh index 63b4600..0de8309 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -1,4 +1,6 @@ -#!/bin/sh -e +#!/bin/bash + +set -e detect_quilt() { if which quilt 1>/dev/null; then @@ -13,11 +15,30 @@ ensure_crashpad_can_fetch_line_number_by_address() { fi } +fail_on_gcc_12() { + if [[ -n "$CC" && -n "$CXX" ]]; then + return; + fi + + if gcc --version | head -1 | grep -q 12; then + cat >&2 < +EOF + exit 1 + fi +} + # For build-dep to work, the apt sources need to have the source server #sudo apt-get build-dep xorg-server #sudo apt-get install cmake git libjpeg-dev libgnutls-dev +fail_on_gcc_12 # Ubuntu applies a million patches, but here we use upstream to simplify matters cd /tmp # default to the version of x in Ubuntu 18.04, otherwise caller will need to specify diff --git a/builder/dockerfile.kali_kali-rolling.build b/builder/dockerfile.kali_kali-rolling.build index 006edee..2123440 100644 --- a/builder/dockerfile.kali_kali-rolling.build +++ b/builder/dockerfile.kali_kali-rolling.build @@ -4,6 +4,8 @@ ENV KASMVNC_BUILD_OS kali ENV KASMVNC_BUILD_OS_CODENAME kali-rolling ENV XORG_VER 1.20.10 ENV DEBIAN_FRONTEND noninteractive +ENV CC=gcc-11 +ENV CXX=g++-11 RUN grep '^deb' /etc/apt/sources.list | sed 's#^deb#deb-src#' >> /etc/apt/sources.list @@ -12,6 +14,7 @@ RUN apt-get update && \ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata RUN apt-get update && apt-get -y build-dep xorg-server libxfont-dev +RUN apt-get update && apt-get -y install gcc-11 g++-11 RUN apt-get update && apt-get -y install cmake git libjpeg-dev libgnutls28-dev vim wget tightvncserver RUN apt-get update && apt-get -y install libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev libxrandr-dev libxcursor-dev @@ -20,7 +23,7 @@ RUN cd /tmp && wget https://storage.googleapis.com/downloads.webmproject.org/rel RUN cd /tmp && tar -xzf /tmp/libwebp-* RUN cd /tmp/libwebp-1.0.2 && \ ./configure --enable-static --disable-shared && \ - make && make install + make -j$(nproc) && make install RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo