FROM opensuse/leap:15.2
RUN zypper --non-interactive install  dnf
RUN dnf clean all
RUN zypper --non-interactive lr
RUN zypper --non-interactive  --gpg-auto-import-keys refresh
RUN zypper --non-interactive lr
RUN zypper --non-interactive  install -y dnf-command\(builddep\) rpmdevtools

RUN zypper --non-interactive clean
RUN zypper --non-interactive up -y && \
    zypper --non-interactive install -y  Mesa-dri-devel Mesa-dri && \
    zypper --non-interactive install -y libinput-devel && \
    zypper --non-interactive install -y \
        git \
        gcc8 \
        gcc8-c++ \
        rpm-build \
        tar \
        make \
        autoconf \
        automake \
        cmake \
        nasm \
        speexdsp-devel \
        libpulse-devel \
        libcanberra-devel \
        libcurl-devel \
        libtool \
        libQt5DBus-devel \
        pcre-devel \
        yaml-cpp-devel \
        boost-devel \
        libdbus-c++-devel \
        libQt5DBus-devel \
        libXext-devel \
        libXfixes-devel \
        yasm \
        speex-devel \
        libgsm-devel \
        chrpath \
        check \
        astyle \
        uuid-devel \
        gettext-devel \
        gcc-c++ \
        which \
        alsa-lib-devel \
        systemd-devel \
        libuuid-devel \
        uuid-devel \
        gnutls-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 \
        libQt5DBus-devel \
        libexpat-devel \
        gnome-icon-theme-symbolic \
        libgsm-devel \
        gtk3-devel \
        libappindicator-devel \
        sqlite-devel \
        libQt5Sql-devel \
        libQt5Gui-devel  \
        ffmpeg-4-libavutil-devel \
        gtk3-devel\
        qrencode-devel \
        python3-python-dateutil \
        libqt5-linguist-devel \
        libsndfile-devel \
        evolution-devel

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

ADD scripts/build-package-opensuse-leap.sh  /opt/build-package-opensuse-leap.sh

CMD /opt/build-package-opensuse-leap.sh
