Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
150 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
version=${LUAROCKS_VERSION} | ||
luarocks_tarball=https://luarocks.github.io/luarocks/releases/luarocks-${version}.tar.gz | ||
|
||
set -e | ||
|
||
# Do we already have the correct LuaRocks built? | ||
if [ -d "$HOME/luarocks/bin" ]; then | ||
installed_version=$($HOME/luarocks/bin/luarocks --version | head -1 | awk '{print $2}') | ||
echo "Need LuaRocks $version" | ||
echo "Found LuaRocks $installed_version" | ||
|
||
if [ "$installed_version" == "$version" ]; then | ||
echo "Using cached LuaRocks directory" | ||
exit 0 | ||
fi | ||
fi | ||
|
||
echo "Installing LuaRocks $version" | ||
|
||
rm -rf $HOME/luarocks | ||
mkdir $HOME/luarocks | ||
|
||
curl -L ${luarocks_tarball} | tar xz | ||
cd luarocks-${version} | ||
./configure --prefix="$HOME/luarocks" $* | ||
make build -j${JOBS} && make install | ||
|
||
cd ../ | ||
rm -rf luarocks-${version} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
version=${VIPS_VERSION} | ||
pre_version=${VIPS_PRE_VERSION} | ||
tar_version=${VIPS_TAR_VERSION} | ||
vips_tarball=https://github.com/jcupitt/libvips/releases/download/v${version}${pre_version:+-$pre_version}/vips-${tar_version}.tar.gz | ||
|
||
set -e | ||
|
||
# Do we already have the correct vips built? | ||
if [ -d "$HOME/vips/bin" ]; then | ||
installed_version=$($HOME/vips/bin/vips --version | awk -F- '{print $2}') | ||
echo "Need vips $version" | ||
echo "Found vips $installed_version" | ||
|
||
if [[ "$installed_version" == "$version" ]]; then | ||
echo "Using cached vips directory" | ||
exit 0 | ||
fi | ||
fi | ||
|
||
echo "Installing vips $version" | ||
|
||
rm -rf $HOME/vips | ||
mkdir $HOME/vips | ||
|
||
curl -L ${vips_tarball} | tar xz | ||
cd vips-${version} | ||
CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 ./configure --prefix="$HOME/vips" $* | ||
make -j${JOBS} && make install | ||
|
||
cd ../ | ||
rm -rf vips-${version} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
sudo: false | ||
|
||
language: generic | ||
|
||
dist: trusty | ||
|
||
env: | ||
global: | ||
- LUAROCKS_VERSION=3.0.0 | ||
- VIPS_VERSION=8.7.0 | ||
- VIPS_PRE_VERSION=rc1 | ||
- VIPS_TAR_VERSION=$VIPS_VERSION | ||
- VIPS_WARNING=0 | ||
- JOBS=2 | ||
- LD_LIBRARY_PATH=$HOME/vips/lib:$LD_LIBRARY_PATH | ||
- PKG_CONFIG_PATH=$HOME/vips/lib/pkgconfig:$PKG_CONFIG_PATH | ||
- PATH=$HOME/vips/bin:$HOME/luarocks/bin:/usr/local/openresty/luajit/bin:$PATH | ||
|
||
cache: | ||
directories: | ||
- $HOME/vips | ||
- $HOME/luarocks | ||
|
||
addons: | ||
apt: | ||
sources: | ||
# Use the official APT repositories from OpenResty (which includes LuaJIT 2.1.0-beta3), | ||
# because LuaJIT on trusty is quite old. | ||
- sourceline: 'deb http://openresty.org/package/ubuntu trusty main' | ||
key_url: 'https://openresty.org/package/pubkey.gpg' | ||
packages: | ||
- openresty | ||
- libexpat1-dev | ||
- gettext | ||
- libglib2.0-dev | ||
- liborc-0.4-dev | ||
- libfftw3-dev | ||
- liblcms2-dev | ||
- libmagickwand-dev | ||
- libopenexr-dev | ||
- libcfitsio3-dev | ||
- libgif-dev | ||
- libgsf-1-dev | ||
- libmatio-dev | ||
- libopenslide-dev | ||
- libpango1.0-dev | ||
- libpoppler-glib-dev | ||
- librsvg2-dev | ||
- libwebp-dev | ||
|
||
before_install: | ||
- bash .ci/install-vips.sh | ||
- bash .ci/install-luarocks.sh | ||
--with-lua=/usr/local/openresty/luajit/ | ||
--lua-suffix=jit-2.1.0-beta3 | ||
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 | ||
- eval `luarocks path` | ||
|
||
install: | ||
- make dev | ||
|
||
script: | ||
- make lint | ||
- make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
DEV_ROCKS = "busted 2.0.rc12" "luacheck 0.22.1" | ||
BUSTED_ARGS ?= -o gtest -v | ||
TEST_CMD ?= busted $(BUSTED_ARGS) | ||
|
||
.PHONY: dev lint test | ||
|
||
dev: | ||
@for rock in $(DEV_ROCKS) ; do \ | ||
if luarocks list --porcelain $$rock | grep -q "installed" ; then \ | ||
echo $$rock already installed, skipping ; \ | ||
else \ | ||
echo $$rock not found, installing via luarocks... ; \ | ||
luarocks install $$rock ; \ | ||
fi \ | ||
done; | ||
|
||
lint: | ||
@luacheck -q . | ||
|
||
test: | ||
@$(TEST_CMD) spec/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters