diff --git a/dev_setup.sh b/dev_setup.sh index 08f67a731f57..82f779ba62d9 100755 --- a/dev_setup.sh +++ b/dev_setup.sh @@ -275,55 +275,85 @@ function redhat_common_install() { } +function debian_install() { + APT_PACKAGE_LIST="git python3 python3-dev python3-setuptools libtool \ + libffi-dev libssl-dev autoconf automake bison swig libglib2.0-dev \ + portaudio19-dev mpg123 screen flac curl libicu-dev pkg-config \ + libjpeg-dev libfann-dev build-essential jq pulseaudio \ + pulseaudio-utils" + + if dpkg -V libjack-jackd2-0 > /dev/null 2>&1 && [[ -z ${CI} ]] ; then + echo " +We have detected that your computer has the libjack-jackd2-0 package installed. +Mycroft requires a conflicting package, and will likely uninstall this package. +On some systems, this can cause other programs to be marked for removal. +Please review the following package changes carefully." + read -p "Press enter to continue" + $SUDO apt-get install $APT_PACKAGE_LIST + else + $SUDO apt-get install -y $APT_PACKAGE_LIST + fi +} + + +function open_suse_install() { + $SUDO zypper install -y git python3 python3-devel libtool libffi-devel libopenssl-devel autoconf automake bison swig portaudio-devel mpg123 flac curl libicu-devel pkg-config libjpeg-devel libfann-devel python3-curses pulseaudio + $SUDO zypper install -y -t pattern devel_C_C++ +} + + +function arch_install() { + $SUDO pacman -S --needed --noconfirm git python python-pip python-setuptools python-virtualenv python-gobject python-virtualenvwrapper libffi swig portaudio mpg123 screen flac curl icu libjpeg-turbo base-devel jq pulseaudio pulseaudio-alsa + pacman -Qs '^fann$' &> /dev/null || ( + git clone https://aur.archlinux.org/fann.git + cd fann + makepkg -srciA --noconfirm + cd .. + rm -rf fann + ) +} + + +function centos_install() { + $SUDO yum install epel-release + redhat_common_install +} + +function redhat_install() { + $SUDO yum install -y wget + wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + $SUDO yum install -y epel-release-latest-7.noarch.rpm + rm epel-release-latest-7.noarch.rpm + redhat_common_install + +} + function install_deps() { echo 'Installing packages...' if found_exe zypper ; then # OpenSUSE echo "$GREEN Installing packages for OpenSUSE...$RESET" - $SUDO zypper install -y git python3 python3-devel libtool libffi-devel libopenssl-devel autoconf automake bison swig portaudio-devel mpg123 flac curl libicu-devel pkg-config libjpeg-devel libfann-devel python3-curses pulseaudio - $SUDO zypper install -y -t pattern devel_C_C++ + open_suse_install elif found_exe yum && os_is centos ; then # CentOS echo "$GREEN Installing packages for Centos...$RESET" - $SUDO yum install epel-release - redhat_common_install + centos_install elif found_exe yum && os_is rhel ; then # Redhat Enterprise Linux echo "$GREEN Installing packages for Red Hat...$RESET" - $SUDO yum install -y wget - wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - $SUDO yum install -y epel-release-latest-7.noarch.rpm - rm epel-release-latest-7.noarch.rpm - redhat_common_install + redhat_install elif os_is_like debian || os_is debian || os_is_like ubuntu || os_is ubuntu || os_is linuxmint; then # Debian / Ubuntu / Mint echo "$GREEN Installing packages for Debian/Ubuntu/Mint...$RESET" - if dpkg -V libjack-jackd2-0 > /dev/null 2>&1 && [[ -z ${CI} ]] ; then - echo " -We have detected that your computer has the libjack-jackd2-0 package installed. -Mycroft requires a conflicting package, and will likely uninstall this package. -On some systems, this can cause other programs to be marked for removal. -Please review the following package changes carefully." - read -p "Press enter to continue" - $SUDO apt-get install git python3 python3-dev python3-setuptools libtool libffi-dev libssl-dev autoconf automake bison swig libglib2.0-dev portaudio19-dev mpg123 screen flac curl libicu-dev pkg-config libjpeg-dev libfann-dev build-essential jq pulseaudio pulseaudio-utils - else - $SUDO apt-get install -y git python3 python3-dev python3-setuptools libtool libffi-dev libssl-dev autoconf automake bison swig libglib2.0-dev portaudio19-dev mpg123 screen flac curl libicu-dev pkg-config libjpeg-dev libfann-dev build-essential jq pulseaudio pulseaudio-utils - fi + debian_install elif os_is_like fedora || os_is fedora; then - echo "$GREEN Installing packages for Fedora...$RESET" # Fedora - $SUDO dnf install -y git python3 python3-devel python3-pip python3-setuptools python3-virtualenv pygobject3-devel libtool libffi-devel openssl-devel autoconf bison swig glib2-devel portaudio-devel mpg123 mpg123-plugins-pulseaudio screen curl pkgconfig libicu-devel automake libjpeg-turbo-devel fann-devel gcc-c++ redhat-rpm-config jq + echo "$GREEN Installing packages for Fedora...$RESET" + fedora_install elif found_exe pacman; then # Arch Linux echo "$GREEN Installing packages for Arch...$RESET" - $SUDO pacman -S --needed --noconfirm git python python-pip python-setuptools python-virtualenv python-gobject python-virtualenvwrapper libffi swig portaudio mpg123 screen flac curl icu libjpeg-turbo base-devel jq pulseaudio pulseaudio-alsa - pacman -Qs '^fann$' &> /dev/null || ( - git clone https://aur.archlinux.org/fann.git - cd fann - makepkg -srciA --noconfirm - cd .. - rm -rf fann - ) + arch_install else echo echo -e "${YELLOW}Could not find package manager