FROM opensuse/leap:15.5

RUN zypper refresh

RUN zypper --non-interactive install -y \
        dnf \
        dnf-command\(builddep\) \
        rpmdevtools \
        Mesa-dri-devel Mesa-dri \
        git \
        gcc10 \
        gcc10-c++ \
        rpm-build \
        tar \
        make \
        autoconf \
        automake \
        nasm \
        speexdsp-devel \
        libpulse-devel \
        libcanberra-devel \
        libcurl-devel \
        libtool \
        pcre-devel \
        yaml-cpp-devel \
        libXext-devel \
        libXfixes-devel \
        yasm \
        speex-devel \
        libgsm-devel \
        chrpath \
        check \
        astyle \
        gettext-devel \
        which \
        alsa-lib-devel \
        systemd-devel \
        libuuid-devel \
        uuid-devel \
        libopus-devel \
        patch \
        jsoncpp-devel \
        webkit2gtk3-devel \
        libcryptopp-devel \
        libva-devel \
        libvdpau-devel \
        msgpack-c-devel \
        msgpack-cxx-devel \
        clutter-devel \
        openssl-devel \
        clutter-gtk-devel \
        libnma-devel \
        libcryptopp-devel \
        libexpat-devel \
        gnome-icon-theme-symbolic \
        libgsm-devel \
        gtk3-devel \
        libappindicator-devel \
        sqlite-devel \
        ffmpeg-4-libavutil-devel \
        gtk3-devel\
        qrencode-devel \
        python3-python-dateutil \
        python3-html5lib \
        libsndfile-devel \
        libdrm \
        gperf \
        bison \
        flex \
        ffmpeg ffmpeg-devel \
        nodejs20 \
        mozilla-nss-devel \
        python-xml \
        python3-six \
        python3-importlib-metadata \
        libxcb* \
        libxkb* \
        libX11-devel \
        libXrender-devel \
        libfreetype6 \
        xcb-util-image-devel \
        xcb-util-keysyms-devel \
        xcb-util-renderutil-devel \
        xcb-util-wm-devel \
        xorg-x11-devel \
        xz \
        xkeyboard-config \
        libnotify \
        argon2-devel \
        libxshmfence-devel \
        xproto-devel \
        xcb-proto-devel \
        xcb-* \
        xorg-* \
        vulkan-devel \
        ninja \
        gstreamer-devel \
        gstreamer-plugins-good \
        gstreamer-plugins-bad-devel \
        gstreamer-plugins-base-devel \
        cmake \
        wget

RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 50
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 50

ADD extras/packaging/gnu-linux/scripts/build-package-rpm.sh /opt/build-package-rpm.sh

ENV CC=gcc
ENV CXX=g++
CMD ["/opt/build-package-rpm.sh"]
