diff --git a/depends/download-and-extract.sh b/depends/download-and-extract.sh new file mode 100755 index 000000000..9f82877db --- /dev/null +++ b/depends/download-and-extract.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Usage: ./download-and-extract.sh something.tar.gz https://example.com/something.tar.gz + +archive=$1 +url=$2 + +if [ ! -f $archive.tar.gz ]; then + wget -O $archive.tar.gz $url +fi + +rm -r $archive +tar -xvzf $archive.tar.gz diff --git a/depends/install_openjpeg.sh b/depends/install_openjpeg.sh index 8d5f5c010..d307a127e 100755 --- a/depends/install_openjpeg.sh +++ b/depends/install_openjpeg.sh @@ -1,19 +1,12 @@ #!/bin/bash # install openjpeg +archive=openjpeg-2.1.2 -if [ ! -f openjpeg-2.1.2.tar.gz ]; then - wget -O 'openjpeg-2.1.2.tar.gz' 'https://github.com/python-pillow/pillow-depends/blob/master/openjpeg-2.1.2.tar.gz?raw=true' +./download-and-extract.sh $archive https://github.com/python-pillow/pillow-depends/blob/master/$archive.tar.gz?raw=true -fi - -rm -r openjpeg-2.1.2 -tar -xvzf openjpeg-2.1.2.tar.gz - - -pushd openjpeg-2.1.2 +pushd $archive cmake -DCMAKE_INSTALL_PREFIX=/usr . && make -j4 && sudo make -j4 install popd - diff --git a/depends/install_webp.sh b/depends/install_webp.sh index a1a28b524..8bb664116 100755 --- a/depends/install_webp.sh +++ b/depends/install_webp.sh @@ -1,14 +1,11 @@ #!/bin/bash # install webp -if [ ! -f libwebp-0.5.2.tar.gz ]; then - wget -O 'libwebp-0.5.2.tar.gz' 'https://github.com/python-pillow/pillow-depends/blob/master/libwebp-0.5.2.tar.gz?raw=true' -fi +archive=libwebp-0.5.2 -rm -r libwebp-0.5.2 -tar -xvzf libwebp-0.5.2.tar.gz +./download-and-extract.sh $archive https://github.com/python-pillow/pillow-depends/blob/master/$archive.tar.gz?raw=true -pushd libwebp-0.5.2 +pushd $archive ./configure --prefix=/usr --enable-libwebpmux --enable-libwebpdemux && make -j4 && sudo make -j4 install