forked from Imagick/imagick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimagemagick_dependency.sh
executable file
·78 lines (63 loc) · 1.96 KB
/
imagemagick_dependency.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
#!/bin/sh
#give an error if the download fails.
set -e
imagemagick_fetch_and_build () {
local version=$1
echo "version is ${version}"
im_dir=${HOME}/im/imagemagick-${version}
case $version in
git7)
;;
git6)
;;
dev)
;;
*)
# Both individual commits, and tagged versions are cacheable
if [ -d "${im_dir}" ]; then
echo "Using cached directory ${im_dir}"
return
fi
;;
esac
case $version in
git7)
wget -O ImageMagick-7.tar.gz https://github.com/ImageMagick/ImageMagick/archive/master.tar.gz
tar xvfz ImageMagick-7.tar.gz
cd ImageMagick-master
;;
git6)
wget -O ImageMagick-6.tar.gz https://github.com/ImageMagick/ImageMagick/archive/ImageMagick-6.tar.gz
tar xvfz ImageMagick-6.tar.gz
cd ImageMagick-ImageMagick-6
;;
dev)
svn co https://www.imagemagick.org/subversion/ImageMagick/branches/ImageMagick-6/ imagemagick-dev
cd imagemagick-dev
;;
*)
echo "version is ${version}"
set +e
#this can error
start_str=${version:0:6}
set -e
if [ "${start_str}" == "commit" ]; then
sha=${version:7:47}
wget -O "ImageMagick-${sha}.tar.gz" "https://github.com/ImageMagick/ImageMagick/archive/${sha}.tar.gz"
tar xvfz ImageMagick-${sha}.tar.gz
cd "ImageMagick-${sha}"
else
wget "https://launchpad.net/imagemagick/main/${version}/+download/ImageMagick-${version}.tar.gz"
tar xvfz ImageMagick-${version}.tar.gz
cd ImageMagick-*
fi
;;
esac
#ignore compile warnings/errors
set +e
./configure --prefix="${HOME}/im/imagemagick-${version}" --without-magick-plus-plus --without-perl --disable-openmp --with-gvc=no
make -j 8
make install
cd ..
}
imagemagick_fetch_and_build $1