Blame 1-setup-linux-native.sh

24a789
#!/bin/bash
24a789
Firas Hanife 5d9776
# There are 3 types of dependencies:
c28b17
# 1. Build tools:
c28b17
# a) autoconf, automake, make, libtool (if you use autotools build system)
c28b17
# b) cmake, ninja/make (if you use CMake build system)
c28b17
# gcc/clang as primary compiler
c28b17
# intltool, gettext (for internationalization)
c28b17
# pkg-config (used for library search)
c28b17
# shared-mime-info (used to register .sif file extension in system)
c28b17
#
c28b17
# 2. Libraries:
c28b17
# glibmm (platform depended functions)
c28b17
# mlt++ imagemagick openexr libmng libpng libjpeg (various formats reading functions)
c28b17
# libxml++ libxml2 libxslt (.sif XML reading)
c28b17
# boost cairo fftw pango (image transformation and rendering functions)
c28b17
# gtkmm3 (Synfig Studio GUI)
c28b17
# libsig++ (GUI signals and events)
c28b17
# sdl2 sdl2_mixer jack (audio output and synchronization)
c28b17
#
c28b17
# 3. Runtime dependencies:
c28b17
# adwaita-icon-theme (used to render GUI icons and styles)
c28b17
# python3-lxml (lottie exporter plugin)
c28b17
7544ab
set -e
7544ab
24a789
echo "Checking dependencies..."
a9814d
if command -v apt-get >/dev/null; then
86d92c
        if [ ! -f /etc/altlinux-release ]; then
86d92c
            #
86d92c
            #  Ubuntu/Debian
86d92c
            #
86d92c
            PKG_LIST=" \
86d92c
                build-essential \
86d92c
                autoconf automake autopoint \
86d92c
                shared-mime-info \
86d92c
                libltdl3-dev \
86d92c
                libtool \
86d92c
                intltool \
86d92c
                gettext \
86d92c
                libpng-dev \
86d92c
                libfftw3-dev \
86d92c
                fontconfig \
86d92c
                libfreetype6-dev \
86d92c
                libfontconfig1-dev \
86d92c
                libxml2-dev \
86d92c
                libtiff5-dev \
550ac8
                libmlt-dev libmlt++-dev libmlt-data \
86d92c
                x11proto-xext-dev libdirectfb-dev libxfixes-dev libxinerama-dev libxdamage-dev libxcomposite-dev libxcursor-dev libxft-dev libxrender-dev libxt-dev libxrandr-dev libxi-dev libxext-dev libx11-dev \
86d92c
                libatk1.0-dev \
86d92c
                libgl1-mesa-dev \
86d92c
                imagemagick \
86d92c
                libsdl2-dev \
86d92c
                libsdl2-mixer-dev \
86d92c
                bzip2
86d92c
                git-core \
86d92c
                libmng-dev \
86d92c
                libjack-jackd2-dev \
86d92c
                libgtkmm-3.0-dev \
86d92c
                libglibmm-2.4-dev \
86d92c
                libsigc++-2.0-dev \
86d92c
                libxml++2.6-dev \
86d92c
                libboost-system-dev \
86d92c
                libmagick++-dev \
AnishGulati 562341
                libxslt-dev python-dev python3-lxml\
86d92c
            "
86d92c
        else
86d92c
            #
86d92c
            #  ALT Linux case
86d92c
            #
86d92c
            PKG_LIST=" \
86d92c
                rpm-build \
86d92c
                git-core \
86d92c
                shared-mime-info \
86d92c
                libltdl3-devel \
86d92c
                intltool \
86d92c
                gettext \
86d92c
                libpng12-devel \
86d92c
                libjpeg-devel \
86d92c
                fontconfig \
86d92c
                libfreetype-devel \
86d92c
                fontconfig-devel \
86d92c
                libxml2-devel \
86d92c
                libtiff-devel \
86d92c
                libjasper-devel \
86d92c
                libdirectfb-devel \
86d92c
                libfftw3-dev \
86d92c
                libXfixes-devel \
86d92c
                libXinerama-devel \
86d92c
                libXdamage-devel \
86d92c
                libXcomposite-devel \
86d92c
                libXcursor-devel \
86d92c
                libXft-devel \
86d92c
                libXrender-devel \
86d92c
                libXt-devel \
86d92c
                libXrandr-devel \
86d92c
                libXi-devel \
86d92c
                libXext-devel \
86d92c
                libX11-devel \
86d92c
                libatk-devel \
86d92c
                bzip2 \
86d92c
                libmng-devel \
86d92c
                libgtkmm3-devel \
86d92c
                libglibmm-devel \
86d92c
                libsigc++2-devel \
86d92c
                libxml++2-devel \
AnishGulati 562341
                libxslt-devel python-devel python3-lxml\
86d92c
            "
86d92c
        fi
Firas Hanife 5d9776
    echo "Running apt-get (you need root privileges to do that)..."
86d92c
    echo
86d92c
    sudo apt-get update -qq || true
86d92c
    sudo apt-get install -y -q $PKG_LIST
a9814d
a9814d
elif command -v dnf >/dev/null; then
24a789
    #
24a789
    #  Fedora >= 22
24a789
    #
86d92c
    PKG_LIST="git \
24a789
            intltool \
24a789
            libpng-devel \
24a789
            libjpeg-devel \
24a789
            fftw-devel \
24a789
            freetype-devel \
24a789
            fontconfig-devel \
24a789
            atk-devel \
24a789
            pango-devel \
24a789
            cairo-devel \
24a789
            gtk3-devel \
24a789
            gettext-devel \
24a789
            libxml2-devel \
24a789
            libxml++-devel \
24a789
            gcc-c++ \
24a789
            autoconf \
24a789
            automake \
24a789
            libtool \
24a789
            libtool-ltdl-devel \
24a789
            boost-devel \
24a789
            shared-mime-info \
24a789
            OpenEXR-devel \
24a789
            libmng-devel \
24a789
            ImageMagick-c++-devel \
24a789
            jack-audio-connection-kit-devel \
24a789
            mlt-devel \
24a789
            ocl-icd-devel \
24a789
            opencl-headers \
24a789
            gtkmm30-devel \
BobSynfig 4dd2cd
            glibmm24-devel \
BobSynfig 4dd2cd
            SDL2-devel \
AnishGulati d5ef4d
            SDL2_mixer-devel \
AnishGulati 562341
            libxslt-devel python-devel python3-lxml"
24a789
    if ! ( rpm -qv $PKG_LIST ); then
Firas Hanife 5d9776
        echo "Running dnf (you need root privileges to do that)..."
dd056a
        sudo dnf install $PKG_LIST || true
24a789
    fi
a9814d
a9814d
elif command -v yum >/dev/null; then
24a789
    #
24a789
    #  Fedora
24a789
    #
86d92c
    PKG_LIST="git \
24a789
            intltool \
24a789
            libpng-devel \
24a789
            libjpeg-devel \
24a789
            fftw-devel \
24a789
            freetype-devel \
24a789
            fontconfig-devel \
24a789
            atk-devel \
24a789
            pango-devel \
24a789
            cairo-devel \
24a789
            gtk3-devel \
24a789
            gettext-devel \
24a789
            libxml2-devel \
24a789
            libxml++-devel \
24a789
            gcc-c++ \
24a789
            autoconf \
24a789
            automake \
24a789
            libtool \
24a789
            libtool-ltdl-devel \
24a789
            boost-devel \
24a789
            shared-mime-info \
24a789
            OpenEXR-devel \
24a789
            libmng-devel \
24a789
            ImageMagick-c++-devel \
24a789
            jack-audio-connection-kit-devel \
24a789
            mlt-devel \
24a789
            ocl-icd-devel \
24a789
            opencl-headers \
24a789
            gtkmm30-devel \
BobSynfig 4dd2cd
            glibmm24-devel \
BobSynfig 4dd2cd
            SDL2-devel \
AnishGulati d5ef4d
            SDL2_mixer-devel \
AnishGulati 562341
            libxslt-devel python-devel python3-lxml"
24a789
    if ! ( rpm -qv $PKG_LIST ); then
Firas Hanife 5d9776
        echo "Running yum (you need root privileges to do that)..."
24a789
        su -c "yum install $PKG_LIST" || true
24a789
    fi
a9814d
24a789
elif which zypper >/dev/null; then
24a789
    #
24a789
    #  OpenSUSE
24a789
    #
86d92c
    PKG_LIST="git libpng-devel libjpeg-devel freetype-devel fontconfig-devel atk-devel pango-devel cairo-devel gtk3-devel gettext-devel libxml2-devel libxml++-devel gcc-c++ autoconf automake libtool libtool-ltdl-devel boost-devel shared-mime-info"
86d92c
    PKG_LIST="${PKG_LIST} OpenEXR-devel libmng-devel ImageMagick-c++-devel gtkmm3-devel glibmm2-devel"
86d92c
24a789
    if ! ( rpm -qv $PKG_LIST ); then
Firas Hanife 5d9776
        echo "Running zypper (you need root privileges to do that)..."
24a789
        su -c "zypper install $PKG_LIST" || true
AnishGulati 562341
AnishGulati 562341
        # Add python lxml repository -> 3rd party
AnishGulati 562341
        su -c "zypper addrepo https://download.opensuse.org/repositories/devel:languages:python/openSUSE_Tumbleweed/devel:languages:python.repo"
AnishGulati 562341
        su -c "zypper refresh"
AnishGulati 562341
        su -c "zypper install python-lxml"
24a789
    fi
a9814d
a9814d
elif command -v pacman >/dev/null; then
Abhay Raj Singh a6476f
    #
Abhay Raj Singh a6476f
    # Arch Linux
Abhay Raj Singh a6476f
    #
Abhay Raj Singh a6476f
    PKG_LIST="git \
Abhay Raj Singh a6476f
            automake autoconf \
Abhay Raj Singh a6476f
            boost \
Abhay Raj Singh a6476f
            cairo \
Abhay Raj Singh a6476f
            freetype2 \
Abhay Raj Singh a6476f
            fftw \
Abhay Raj Singh a6476f
            gtk3 \
Abhay Raj Singh a6476f
            gettext \
Abhay Raj Singh a6476f
            gtkmm3 \
Abhay Raj Singh a6476f
            glibmm \
Abhay Raj Singh a6476f
            gcc \
Abhay Raj Singh a6476f
            imagemagick \
a9814d
            pkg-config \
a9814d
            intltool \
Abhay Raj Singh a6476f
            jack \
Abhay Raj Singh a6476f
            libxml2 \
Abhay Raj Singh a6476f
            libxml++2.6 \
c28b17
            libtool \
c28b17
            libpng \
Abhay Raj Singh a6476f
            libsigc++ \
Abhay Raj Singh a6476f
            libjpeg \
Abhay Raj Singh a6476f
            libmng \
a9814d
            mlt \
Abhay Raj Singh a6476f
            openexr \
a9814d
            shared-mime-info \
c28b17
            cmake make \
c28b17
            python-lxml"
Firas Hanife 5d9776
    echo "Running pacman (you need root privileges to do that)..."
Abhay Raj Singh a6476f
    echo
Abhay Raj Singh a6476f
    sudo pacman -S --needed --noconfirm $PKG_LIST || true
Abhay Raj Singh a6476f
24a789
else
Firas Hanife 5d9776
    echo "WARNING: This build script does not work with package management systems other than yum, zypper, apt or pacman! You should install dependent packages manually."
86d92c
    echo "REQUIRED PACKAGES: "
86d92c
    echo "libpng-devel libjpeg-devel freetype-devel fontconfig-devel atk-devel pango-devel cairo-devel gtk3-devel gettext-devel libxml2-devel libxml++-devel gcc-c++ autoconf automake libtool libtool-ltdl-devel shared-mime-info OpenEXR-devel libmng-devel ImageMagick-c++-devel gtkmm30-devel glibmm24-devel"
86d92c
    echo ""
24a789
fi
24a789
echo "Done."