Skip to content

Commit

Permalink
Add travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcima committed Dec 15, 2019
1 parent c7f1101 commit c7519d7
Show file tree
Hide file tree
Showing 6 changed files with 326 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
language: c++

branches:
except:
- automatic

cache:
directories:
- download

matrix:
include:
- os: linux
sudo: required
dist: bionic
env:
- _BUILD=win32
- _MINGW=mingw32
- _HOST=i686-w64-mingw32
before_install:
- docker pull jpcima/arch-mingw
install:
- container=$(docker run -d -i -t -v /home:/home jpcima/arch-mingw /bin/bash)
- |
cross() {
docker exec -w "$(pwd)" -e "_BUILD=$_BUILD" -e "_MINGW=$_MINGW" -e "_HOST=$_HOST" -i -t "$container" "$@"
}
script:
- cross bash .travis/script-mingw.sh
- cp -drfv bin VL1-"$_BUILD"
- rm -f VL1-"$_BUILD"/README
- install -d release
- zip -9 -r release/VL1-"$_BUILD".zip VL1-"$_BUILD"
- os: linux
sudo: required
dist: bionic
env:
- _BUILD=win64
- _MINGW=mingw64
- _HOST=x86_64-w64-mingw32
before_install:
- docker pull jpcima/arch-mingw
install:
- container=$(docker run -d -i -t -v /home:/home jpcima/arch-mingw /bin/bash)
- |
cross() {
docker exec -w "$(pwd)" -e "_BUILD=$_BUILD" -e "_MINGW=$_MINGW" -e "_HOST=$_HOST" -i -t "$container" "$@"
}
script:
- cross bash .travis/script-mingw.sh
- cp -drfv bin VL1-"$_BUILD"
- rm -f VL1-"$_BUILD"/README
- install -d release
- zip -9 -r release/VL1-"$_BUILD".zip VL1-"$_BUILD"
- os: osx
osx_image: xcode9.2
sudo: required
env:
- _BUILD=macos
script:
- bash .travis/script-macos.sh
- cp -av bin VL1-"$_BUILD"
- rm -f VL1-"$_BUILD"/README
- install -d release
- zip -9 -r release/VL1-"$_BUILD".zip VL1-"$_BUILD"
- os: linux
sudo: required
dist: trusty
env:
- _BITS=64
- _BUILD=linux64
before_install:
- sudo apt-get update -qq
install:
- sudo apt-get install checkinstall libcairo2-dev
script:
- bash .travis/script-linux.sh
- cp -drfv bin VL1-"$_BUILD"
- rm -f VL1-"$_BUILD"/README
- install -d release
- zip -9 -r release/VL1-"$_BUILD".zip VL1-"$_BUILD"
- echo "A classic analog phaser effect" > description-pak
- sudo checkinstall --type=debian --install=no --default --pkgname=VL1 --pkgversion="`git describe --abbrev=0 | sed 's/^v//'``git log -n 1 --pretty=format:"+%cd~git%h" --date=short master | sed 's/-//g'`" --pkgarch=amd64 --pkgrelease=0jpc1 --pkglicense=BSL-1.0 --pkggroup=sound --maintainer="[email protected]" --nodoc
- sudo mv -f *.deb release/VL1-"$_BUILD".deb

before_script:
- sed -i~ 's%/usr/local%/usr%g' plugins/*/Makefile

before_deploy:
- |
if test "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false"; then
export TRAVIS_TAG=automatic
git tag -f "$TRAVIS_TAG"
fi
deploy:
provider: releases
api_key: "$GITHUB_TOKEN"
file: release/*
file_glob: true
skip_cleanup: true
prerelease: true
overwrite: true
on:
branch: master

env:
global:
secure: "0QJkHPls0C1hwI/2tnmFlF33zA8fQia1qLCmIdGDh6GNx0CFX54o2E41Ne9U3rAHd3PAjmObWV3S9IRHLOdcNHUfx1T1a1VhIjiZHOTg3VhCD7n8YW5U9C2Fqq5MuseI3+clRBt33ndCvfp8kKH0KcFSD4ZtcjSc+2h7ln2hop70DBqTO8Dzn7ESlXnoHUQ+IdRWOvJsx2Cmjyhs7smO+zI5jDEt10MYx2tPi3WJGCGx/DO2FUUPHhxz9Pjiv83HMBReNoDfX4Mf5+a92I9B+P7TXyTIpXw8gZxh9v4LdzTvCTYGSvkOmaW5aXIPdebOrs00mKfVcb4Ybil7fRRYRMY5KU3mbOAt8k7Pifww3aiHBpJthLdoId9ENxBoGfINuRg5KMZKLkIz3yj0jpXm4I4qFeD8/vKVNY662DJxDGYBTOYAqnkse4XPlWyWGtULwPXjCn90sYRFnVa7YX28InUgdpeC//7b1Ruw7Qm0+bdo9WBg9WzTlgLYggn70MV5XHUxh2lupP01USMdExesYnsy9JK4LumtYRE2DwYz8wqX5uKy3jh2B2/IhSCBB6c6ZG5eF40MWl9dqy00zRXbICZWpmn78Nt43o4XyjlyXb5WVxz/+1NI70kPQPwUNLrpPfKXsuXV5e9Hp86X/3hD4EPjyj1UruJqvZ43rmHaQjs="
37 changes: 37 additions & 0 deletions .travis/cairo-1.16.0-subdirs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/Makefile.am b/Makefile.am
index 03fa352..7e11d24 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,10 +18,6 @@ ACLOCAL_AMFLAGS = -I build ${ACLOCAL_FLAGS}

DIST_SUBDIRS = src doc util boilerplate test perf
SUBDIRS = src doc util
-# libpng is required for our test programs
-if CAIRO_HAS_PNG_FUNCTIONS
-SUBDIRS += boilerplate test perf
-endif

configure: cairo-version.h

diff --git a/Makefile.in b/Makefile.in
index e29609c..f33a339 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -106,8 +106,6 @@ host_triplet = @host@
EXTRA_PROGRAMS =
TESTS =
check_PROGRAMS =
-# libpng is required for our test programs
-@CAIRO_HAS_PNG_FUNCTIONS_TRUE@am__append_1 = boilerplate test perf
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/build/aclocal.cairo.m4 \
@@ -718,7 +716,7 @@ MAINTAINERCLEANFILES = Makefile.in $(srcdir)/aclocal.m4 \
# $(NULL)
ACLOCAL_AMFLAGS = -I build ${ACLOCAL_FLAGS}
DIST_SUBDIRS = src doc util boilerplate test perf
-SUBDIRS = src doc util $(am__append_1)
+SUBDIRS = src doc util
DISTCHECK_CONFIGURE_FLAGS = \
--enable-gtk-doc \
--enable-test-surfaces \
23 changes: 23 additions & 0 deletions .travis/pixman-0.38.4-subdirs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/Makefile.am b/Makefile.am
index e33b2b9..7e27aa3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = pixman demos test
+SUBDIRS = pixman

pkgconfigdir=$(libdir)/pkgconfig
pkgconfig_DATA=pixman-1.pc
diff --git a/Makefile.in b/Makefile.in
index ab55851..930579a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -381,7 +381,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = pixman demos test
+SUBDIRS = pixman
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pixman-1.pc
GPGKEY = 3892336E
39 changes: 39 additions & 0 deletions .travis/script-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

# ---------------------------------------------------------------------------------------------------------------------
# stop on error

set -e

# ---------------------------------------------------------------------------------------------------------------------
# print shell commands

set -x

# ---------------------------------------------------------------------------------------------------------------------
# set variables

test ! -z "$_BITS"

# ---------------------------------------------------------------------------------------------------------------------
# setup

export PKG_CONFIG="pkg-config"

case "$_BITS" in
32)
export PKG_CONFIG_LIBDIR="/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig"
;;
64)
export PKG_CONFIG_LIBDIR="/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig"
;;
esac

export CFLAGS="-m$_BITS"
export CXXFLAGS="-m$_BITS"
export LDFLAGS="-m$_BITS"

# ---------------------------------------------------------------------------------------------------------------------
# build the plugin

LINUX=true make $MAKE_ARGS
71 changes: 71 additions & 0 deletions .travis/script-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/bash

# ---------------------------------------------------------------------------------------------------------------------
# stop on error

set -e

# ---------------------------------------------------------------------------------------------------------------------
# print shell commands

set -x

# ---------------------------------------------------------------------------------------------------------------------
# download sources in the cache directory

install -d download

LIBPNG_VERSION=1.6.37
PIXMAN_VERSION=0.38.4
CAIRO_VERSION=1.16.0

download_file() {
test -f "$1" || wget -q -O "$1" "$2"
}

download_file {download/,https://download.sourceforge.net/libpng/}libpng-"$LIBPNG_VERSION".tar.xz
download_file {download/,https://www.cairographics.org/releases/}pixman-"$PIXMAN_VERSION".tar.gz
download_file {download/,https://www.cairographics.org/releases/}cairo-"$CAIRO_VERSION".tar.xz

# ---------------------------------------------------------------------------------------------------------------------
# setup

export PKG_CONFIG="pkg-config --static"
export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig"

export PATH=/opt/local/bin:"$PATH"

export CFLAGS="-I/opt/local/include -arch i386 -arch x86_64"
export CXXFLAGS="-I/opt/local/include -arch i386 -arch x86_64"
export LDFLAGS="-L/opt/local/lib -arch i386 -arch x86_64"

# ---------------------------------------------------------------------------------------------------------------------
# dependencies

build_auto_dep() {
cd "$1"
shift
./configure --enable-silent-rules --enable-static --disable-shared --prefix=/opt/local "$@"
make $MAKE_ARGS
sudo make install
cd ..
}

# extract
tar xJf download/libpng-"$LIBPNG_VERSION".tar.xz
tar xzf download/pixman-"$PIXMAN_VERSION".tar.gz
tar xJf download/cairo-"$CAIRO_VERSION".tar.xz

# patch
patch -d pixman-"$PIXMAN_VERSION" -p1 -i "`pwd`"/.travis/pixman-0.38.4-subdirs.patch
patch -d cairo-"$CAIRO_VERSION" -p1 -i "`pwd`"/.travis/cairo-1.16.0-subdirs.patch

# build
build_auto_dep libpng-"$LIBPNG_VERSION"
build_auto_dep pixman-"$PIXMAN_VERSION"
build_auto_dep cairo-"$CAIRO_VERSION" --enable-xlib=no --enable-xlib-xrender=no --enable-xcb=no --enable-ft=no --enable-fc=no --enable-gobject=no

# ---------------------------------------------------------------------------------------------------------------------
# build the plugin

MACOS=true make $MAKE_ARGS
47 changes: 47 additions & 0 deletions .travis/script-mingw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# ---------------------------------------------------------------------------------------------------------------------
# stop on error

set -e

# ---------------------------------------------------------------------------------------------------------------------
# print shell commands

set -x

# ---------------------------------------------------------------------------------------------------------------------
# set variables

test ! -z "$_MINGW"
test ! -z "$_HOST"

# ---------------------------------------------------------------------------------------------------------------------
# setup

export AR="$_HOST"-ar
export RANLIB="$_HOST"-ranlib
export CC="$_HOST"-gcc
export CXX="$_HOST"-g++
export STRIP="$_HOST"-strip
export WINDRES="$_HOST"-windres
export PKG_CONFIG="$_HOST"-pkg-config

export PKG_CONFIG="$PKG_CONFIG --static"

export PATH=/opt/"$_MINGW"/"$_HOST"/bin:/opt/"$_MINGW"/bin:"$PATH"

export CFLAGS="-I/opt/$_MINGW/include"
export CXXFLAGS="-I/opt/$_MINGW/include"
export LDFLAGS="-L/opt/$_MINGW/lib"

# ---------------------------------------------------------------------------------------------------------------------
# prepare

# invoke the Windows ttl generator using wine
sed -i 's/"$GEN"/wine "$GEN"/g' dpf/utils/generate-ttl.sh

# ---------------------------------------------------------------------------------------------------------------------
# build the plugin

CROSS_COMPILING=true WINDOWS=true make $MAKE_ARGS

0 comments on commit c7519d7

Please sign in to comment.