forked from optimal-image/optimal-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-vips.sh
executable file
·80 lines (75 loc) · 1.84 KB
/
install-vips.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
73
74
75
76
77
78
79
80
#!/usr/bin/env bash
readonly VIPS_VERSION="8.6.5"
readonly VIPS_SOURCE="https://github.com/libvips/libvips/releases/download"
readonly VIPS_DIR=vips-${VIPS_VERSION}
readonly IS_UBUNTU=$(cat /etc/*-release | grep -o -m 1 ubuntu)
readonly IS_ALPINE=$(cat /etc/*-release | grep -o -m 1 alpine)
function install_on_alpine {
apk add --update \
ca-certificates \
wget \
build-base \
glib-dev \
libxml2-dev \
libjpeg-turbo-dev \
libexif-dev \
tiff-dev \
libgsf-dev \
libpng-dev \
expat-dev \
&& wget "${VIPS_SOURCE}/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.gz" -O - | tar -zx \
&& cd ${VIPS_DIR}/ \
&& ./configure \
--prefix=/usr \
--disable-debug \
--disable-static \
--disable-introspection \
--disable-dependency-tracking \
--enable-silent-rules \
--without-python \
--without-orc \
--without-fftw \
&& make -s \
&& make install \
&& cd ../ \
&& rm -rf ${VIPS_DIR}/
}
function install_on_ubuntu {
sudo apt-get -qq update \
&& sudo apt-get install -y --no-install-recommends \
ca-certificates \
wget \
build-essential \
glib2.0-dev \
libxml2-dev \
libjpeg-turbo8-dev \
libexif-dev \
libtiff5-dev \
libgsf-1-dev \
libpng-dev \
libexpat-dev \
&& wget "${VIPS_SOURCE}/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.gz" -O - | tar -zx \
&& cd ${VIPS_DIR}/ \
&& ./configure \
--prefix=/usr \
--disable-debug \
--disable-static \
--disable-introspection \
--disable-dependency-tracking \
--enable-silent-rules \
--without-python \
--without-orc \
--without-fftw \
&& make -s \
&& sudo make install \
&& cd ../ \
&& rm -rf ${VIPS_DIR}/
}
if [[ ! -z "$IS_UBUNTU" ]]; then
install_on_ubuntu
elif [[ ! -z "$IS_ALPINE" ]]; then
install_on_alpine
else
echo "Unsupported operating system!"
exit 1
fi