forked from AppImage/AppImageKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-build-deps.sh
executable file
·72 lines (61 loc) · 2.69 KB
/
install-build-deps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
set -e
# Install build dependencies; TODO: Support systems that do not use apt-get (Pull Requests welcome!)
ARCH=$(uname -p)
if [ "$ARCH" == "i686" ]; then
ARCH=i386
fi
if [ -e /usr/bin/apt-get ] ; then
apt-get update
sudo apt-get -y install zsync git libarchive-dev autoconf libtool make gcc libtool libfuse-dev \
liblzma-dev libglib2.0-dev libssl-dev libinotifytools0-dev liblz4-dev equivs libcairo-dev
# libtool-bin might be required in newer distributions but is not available in precise
sudo cp resources/liblz4.pc /usr/lib/$ARCH-linux-gnu/pkgconfig/
fi
if [ -e /usr/bin/yum ] ; then
# Install and enable EPEL and Devtoolset-4 by Software Collections
# https://www.softwarecollections.org/en/scls/rhscl/devtoolset-4/
if [ "$ARCH" == "x86_64" ]; then
yum -y install centos-release-scl-rh epel-release
yum -y install devtoolset-4-gcc.$ARCH
fi
# Install and enable Autotools by Pavel Raiskup
# https://www.softwarecollections.org/en/scls/praiskup/autotools/
rpm -ivh https://www.softwarecollections.org/en/scls/praiskup/autotools/epel-6-$ARCH/download/praiskup-autotools-epel-6-$ARCH.noarch.rpm
yum -y install autotools-latest # 19 MB
if [ "$ARCH" == "x86_64" ]; then
rpm -ivh http://kikitux.net/zsync/zsync-0.6.2-1.el6.rf.x86_64.rpm
fi
if [ "$ARCH" == "i386" ]; then
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
fi
yum -y install epel-release
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 # inotify-tools-devel lz4-devel
if [ "$ARCH" == "x86_64" ]; then
. /opt/rh/devtoolset-4/enable
fi
. /opt/rh/autotools-latest/enable
# Unlike Ubuntu, CentOS does not provide .a, so we need to build it
#wget http://tukaani.org/xz/xz-5.2.2.tar.gz
#tar xzfv xz-5.2.2.tar.gz
#cd xz-5.2.2
#./configure --enable-static && make && make install
#rm /usr/local/lib/liblzma.so* /usr/*/liblzma.so || true # Don't want the dynamic one
#cd -
fi
# Install dependencies for Arch Linux
if [ -e /usr/bin/pacman ] ; then
echo "Checking arch package provides and installed packages"
declare -a arr=("zsync" "git" "libarchive" "autoconf" "libtool" "make"
"libtool" "fuse2" "xz" "glib2" "openssl" "inotify-tools" "lz4" "gcc")
for i in "${arr[@]}"
do
if [ ! "$(package-query -Q $i || package-query --qprovides $i -Q)" ]; then
TO_INSTALL="$TO_INSTALL $i"
fi
done
if [ "$TO_INSTALL" ]; then
echo "Found the following missing packages:$TO_INSTALL, installing now"
sudo pacman -S --needed $TO_INSTALL
fi
fi