Skip to content

Commit daaec87

Browse files
committed
rebuild cached vips on version change
1 parent 1bc7f0f commit daaec87

File tree

2 files changed

+28
-19
lines changed

2 files changed

+28
-19
lines changed

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,16 @@ addons:
4545
- libwebp-dev
4646

4747
before_install:
48-
- bash install-vips.sh
48+
- bash install-vips.sh \
49+
--disable-debug \
50+
--disable-dependency-tracking \
51+
--disable-introspection \
52+
--disable-static \
53+
--enable-gtk-doc-html=no \
54+
--enable-gtk-doc=no \
55+
--enable-pyvips8=no \
56+
--without-orc \
57+
--without-python
4958
- yes '' | pecl install vips
5059

5160
install: composer install --prefer-dist

install-vips.sh

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -e
4-
if [ ! -d "$HOME/vips/lib" ]; then
5-
wget $VIPS_SITE/$VIPS_VERSION/vips-$VIPS_VERSION_FULL.tar.gz
6-
tar xf vips-$VIPS_VERSION_FULL.tar.gz
7-
cd vips-$VIPS_VERSION_FULL
8-
CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 ./configure --prefix=$HOME/vips \
9-
--disable-debug \
10-
--disable-dependency-tracking \
11-
--disable-introspection \
12-
--disable-static \
13-
--enable-gtk-doc-html=no \
14-
--enable-gtk-doc=no \
15-
--enable-pyvips8=no \
16-
--without-orc \
17-
--without-python
18-
make && make install
19-
else
20-
echo 'Using cached directory.'
4+
5+
# do we already have the correct vips built? early exit if yes
6+
# we could check the configure params as well I guess
7+
if [ -d "$HOME/vips/bin" ]; then
8+
version=$($HOME/vips/bin/vips --version)
9+
escaped_version="$VIPS_VERSION_MAJOR\.$VIPS_VERSION_MINOR\.$VIPS_VERSION_MICRO"
10+
if [[ "$version" =~ ^vips-$escaped_version ]]; then
11+
echo 'Using cached directory.'
12+
exit 0
13+
fi
2114
fi
15+
16+
rm -rf $HOME/vips
17+
wget $VIPS_SITE/$VIPS_VERSION/vips-$VIPS_VERSION_FULL.tar.gz
18+
tar xf vips-$VIPS_VERSION_FULL.tar.gz
19+
cd vips-$VIPS_VERSION_FULL
20+
CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 ./configure --prefix=$HOME/vips $*
21+
make && make install

0 commit comments

Comments
 (0)