Fix memleak
[appimagekit/gsi.git] / install-build-deps.sh
blob2e55588707c3668488512ec2b90e7d5b77597b8f
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 -m)
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 g++ wget make glibc-devel glib2-devel libarchive-devel \
17 fuse fuse-devel zlib-devel patch cairo-devel zsync desktop-file-utils cmake
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 g++ libtool libfuse-dev \
25 liblzma-dev libglib2.0-dev libssl-dev libinotifytools0-dev liblz4-dev libcairo-dev desktop-file-utils cmake
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/
28 if cat /etc/lsb-release | grep 14.04 2>&1 >/dev/null; then
29 export CMAKE_VERSION=3.10.0
30 # sometimes, using a crowbar is easier than fiddling with PPAs
31 wget https://cmake.org/files/v3.10/cmake-"$CMAKE_VERSION"-Linux-x86_64.tar.gz -O- | tar xz --strip-components=1 -C /usr/local
35 if [ -e /usr/bin/yum ] ; then
36 # Install and enable EPEL and Devtoolset-4 by Software Collections
37 # https://www.softwarecollections.org/en/scls/rhscl/devtoolset-4/
38 if [ "$ARCH" == "x86_64" ]; then
39 yum -y install centos-release-scl-rh epel-release
40 yum -y install devtoolset-4-gcc.$ARCH devtoolset-4-gcc-c++.$ARCH
43 # Install and enable Autotools by Pavel Raiskup
44 # https://www.softwarecollections.org/en/scls/praiskup/autotools/
45 rpm -ivh https://www.softwarecollections.org/en/scls/praiskup/autotools/epel-6-$ARCH/download/praiskup-autotools-epel-6-$ARCH.noarch.rpm
46 yum -y install autotools-latest # 19 MB
48 if [ "$ARCH" == "x86_64" ]; then
49 rpm -ivh https://github.com/kikitux/blog/raw/master/zsync/zsync-0.6.2-1.el6.rf.x86_64.rpm
51 if [ "$ARCH" == "i386" ]; then
52 rpm -ivh https://github.com/kikitux/blog/raw/master/zsync/zsync-0.6.2-1.el6.rf.i686.rpm
55 yum -y install epel-release
56 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 libtool # inotify-tools-devel lz4-devel
58 export AUTOMAKE_VERSION=1.15 AUTOCONF_VERSION=2.69 CMAKE_VERSION=3.10.0
59 wget https://raw.githubusercontent.com/AppImage/AppImageBuild/master/build-automake.sh -O- | bash
60 wget https://raw.githubusercontent.com/AppImage/AppImageBuild/master/build-autoconf.sh -O- | bash
61 wget https://cmake.org/files/v3.10/cmake-"$CMAKE_VERSION"-Linux-x86_64.tar.gz -O- | tar xz --strip-components=1 -C /usr
64 # Install dependencies for Arch Linux
65 if [ -e /usr/bin/pacman ] ; then
66 echo "Checking arch package provides and installed packages"
67 declare -a arr=("zsync" "git" "libarchive" "autoconf" "libtool" "fuse2" "xz" "glib2" "openssl"
68 "inotify-tools" "lz4" "gcc" "cmake" "wget" "vim" "desktop-file-utils" "cairo")
69 for i in "${arr[@]}"
71 if [ ! "$(package-query -Q $i || package-query --qprovides $i -Q)" ]; then
72 TO_INSTALL="$TO_INSTALL $i"
74 done
75 if [ "$TO_INSTALL" ]; then
76 echo "Found the following missing packages:$TO_INSTALL, installing now"
77 sudo pacman -S --needed $TO_INSTALL