FROM opensuse/leap:15.4

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 \
        libdbus-c++-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-devel \
        clutter-devel \
        openssl-devel \
        clutter-gtk-devel \
        libnma-devel \
        libcryptopp-devel \
        libdbus-c++-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 \
        nodejs12 \
        mozilla-nss-devel \
        python-xml \
        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"]
