xhost + # Workaround for: QXcbConnection: Could not connect to display :0
[appimagekit.git] / install-build-deps.sh
blob9e2e109297340b1c504c1ceeffcaf225e2a29ba7
1 #!/bin/bash
3 set -e
5 # Install build dependencies; TODO: Support systems that do not use apt-get (Pull Requests welcome!)
7 ARCH=$(uname -p)
8 if [ "$ARCH" == "i686" ]; then
9 ARCH=i386
13 # Install dependencies for openSUSE
14 if [ -e /usr/bin/zypper ] ; then
15 sudo zypper refresh
16 sudo zypper in -y build git-core gcc wget make glibc-devel glib2-devel libarchive-devel \
17 fuse fuse-devel zlib-devel patch cairo-devel zsync desktop-file-utils
18 #for some reason openSUSE Tumbleweed have apt-get.
19 return
22 if [ -e /usr/bin/apt-get ] ; then
23 sudo apt-get update
24 sudo apt-get -y install zsync git libarchive-dev autoconf libtool make gcc libtool libfuse-dev \
25 liblzma-dev libglib2.0-dev libssl-dev libinotifytools0-dev liblz4-dev equivs libcairo-dev desktop-file-utils
26 # libtool-bin might be required in newer distributions but is not available in precise
27 sudo cp resources/liblz4.pc /usr/lib/$ARCH-linux-gnu/pkgconfig/
30 if [ -e /usr/bin/yum ] ; then
31 # Install and enable EPEL and Devtoolset-4 by Software Collections
32 # https://www.softwarecollections.org/en/scls/rhscl/devtoolset-4/
33 if [ "$ARCH" == "x86_64" ]; then
34 yum -y install centos-release-scl-rh epel-release
35 yum -y install devtoolset-4-gcc.$ARCH
38 # Install and enable Autotools by Pavel Raiskup
39 # https://www.softwarecollections.org/en/scls/praiskup/autotools/
40 rpm -ivh https://www.softwarecollections.org/en/scls/praiskup/autotools/epel-6-$ARCH/download/praiskup-autotools-epel-6-$ARCH.noarch.rpm
41 yum -y install autotools-latest # 19 MB
43 if [ "$ARCH" == "x86_64" ]; then
44 rpm -ivh http://kikitux.net/zsync/zsync-0.6.2-1.el6.rf.x86_64.rpm
46 if [ "$ARCH" == "i386" ]; then
47 rpm -ivh ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/uibmz:/opsi:/opsi40-testing/CentOS_CentOS-6/i386/zsync-0.6.1-6.2.i386.rpm
50 yum -y install epel-release
51 yum -y install git wget make binutils fuse glibc-devel glib2-devel libarchive3-devel fuse-devel zlib-devel patch openssl-static openssl-devel vim-common cairo-devel desktop-file-utils # inotify-tools-devel lz4-devel
53 if [ "$ARCH" == "x86_64" ]; then
54 . /opt/rh/devtoolset-4/enable
56 . /opt/rh/autotools-latest/enable
60 # Install dependencies for Arch Linux
61 if [ -e /usr/bin/pacman ] ; then
62 echo "Checking arch package provides and installed packages"
63 declare -a arr=("zsync" "git" "libarchive" "autoconf" "libtool" "make"
64 "libtool" "fuse2" "xz" "glib2" "openssl" "inotify-tools" "lz4" "gcc")
65 for i in "${arr[@]}"
67 if [ ! "$(package-query -Q $i || package-query --qprovides $i -Q)" ]; then
68 TO_INSTALL="$TO_INSTALL $i"
70 done
71 if [ "$TO_INSTALL" ]; then
72 echo "Found the following missing packages:$TO_INSTALL, installing now"
73 sudo pacman -S --needed $TO_INSTALL