Skip to content

Commit

Permalink
Reform usage of Travis CI
Browse files Browse the repository at this point in the history
We use the new docker-based infrastructure of Travis which allows faster
and responsiver continuous integration jobs.
  • Loading branch information
foretspaisibles committed Jul 21, 2015
1 parent 1b687c4 commit 144f182
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 66 deletions.
19 changes: 17 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
language: c
script: sh -ex ./Library/Ancillary/travisci main
before_script: sudo sh -ex ./Library/Ancillary/travisci before
sudo: false
addons:
apt:
packages:
- gawk
- gnupg
- graphicsmagick
- graphicsmagick
- m4
- noweb
- ocaml
- ocaml-findlib
- texlive-font-utils
- texlive-lang-french
- texlive-latex-base
install: sh -ex ./Library/Ancillary/autoinstall bmake
script: sh -ex ./Library/Ancillary/travisci
86 changes: 86 additions & 0 deletions Library/Ancillary/autoinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/bin/sh

### autoinstall -- Autoinstall bmake or bsdowl

# BSD Owl Scripts (https://github.com/michipili/bsdowl)
# This file is part of BSD Owl Scripts
#
# Copyright © 2015 Michael Grünewald
#
# This file must be used under the terms of the CeCILL-B.
# This source file is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt

: ${prefix:=${HOME}/.local}
: ${srcdir:=${HOME}/.local/sources}

autoinstall_bsdowl_version='3.0.0-20150401'


autoinstall_bmake()
{
install -d "${srcdir}"
cd "${srcdir}"

curl -s http://void.crufty.net/ftp/pub/sjg/bmake.tar.gz\
| tar xzfC - "${srcdir}"

curl -s http://void.crufty.net/ftp/pub/sjg/mk.tar.gz\
| tar xzfC - "${srcdir}/bmake"

./bmake/boot-strap --prefix="${prefix}" --install
./bmake/boot-strap --prefix="${prefix}" op=install
}

autoinstall_bsdowl()
{
local version

version="${autoinstall_bsdowl_version}"
install -d "${srcdir}"
cd "${srcdir}"

curl -L -s https://github.com/michipili/bsdowl/releases/download/v${version}/bsdowl-${version}.tar.xz | tar xJf -
cd bsdowl-${version}
autoconf
./configure --prefix="${prefix}"
bmake build
bmake install
}

autoinstall_usage()
{
iconv -c -f utf-8 <<EOF
Usage: autoinstall [-h][-s SRCDIR] [-p PREFIX] bsdowl bmake
Install bmake and bsdowl
Options:
-h Display this help message.
-p PREFIX [${prefix}]
Use PREFIX as installation prefix.
-s SRCDIR [${srcdir}]
Download sources to SRCDIR.
EOF
}

while getopts "hs:p:" OPTION; do
case "${OPTION}" in
h) autoinstall_usage; exit 0;;
s) srcdir="${OPTARG}";;
p) prefix="${OPTARG}";;
?) autoinstall_usage; exit 64;;
esac
done
shift $(expr $OPTIND - 1)
for package in "$@"; do
case "${package}" in
bmake|bsdmake);;
*) autoinstall_usage; exit 64;;
esac
done
for package in "$@"; do
autoinstall_${package}
done

### End of file `autoinstall'
33 changes: 33 additions & 0 deletions Library/Ancillary/rebase
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh -e

### rebase -- Rebase topic branches

# BSD Owl Scripts (https://github.com/michipili/bsdowl)
# This file is part of BSD Owl Scripts
#
# Copyright © 2015 Michael Grünewald
#
# This file must be used under the terms of the CeCILL-B.
# This source file is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt

topic_branch_list()
{
git branch | sed -n -e 's/^..//;/topic/p'
}


topic_branch_rebase()
{
local branch

while read "branch"; do
git rebase --onto master remaster "${branch}"
done
}

topic_branch_list | topic_branch_rebase

### End of file `rebase'
77 changes: 18 additions & 59 deletions Library/Ancillary/travisci
Original file line number Diff line number Diff line change
Expand Up @@ -13,64 +13,23 @@
# are also available at
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt

depends='graphicsmagick gawk m4 ocaml texlive-latex-base'
recommends='gnupg graphicsmagick noweb texlive-font-utils texlive-lang-french'
extras='ocaml ocaml-native-compilers camlp4-extra opam'
opam='depext ocamlfind'

repo_src="deb-src http://ftp.debian.org/debian/ unstable main"
repo_extras="deb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe"
repo_ocaml="avsm/ocaml42+opam12"

set -a
OPAMYES=1
set +a


action_before()
{
echo "${repo_src}" >> /etc/apt/sources.list
add-apt-repository "${repo_extras}"
add-apt-repository --yes "ppa:${repo_ocaml}"
apt-get -qq update
apt-get -qq install apt-src
apt-get -qq install ${depends} ${recommends} ${extras}
apt-src -bi install bmake
}

action_main()
{
opam init -a git://github.com/ocaml/opam-repository
eval $(opam config env)
opam install ${opam}

autoconf
./configure\
--with-gpg\
--with-gm\
--with-tex\
--with-ocaml\
--with-noweb\
--with-credentials=sudo\
--enable-test-findlib\
--disable-test-noweb\
--disable-test-gpg\
--disable-test-texmf

bmake build
bmake test
bmake install
}

action_usage()
{
1>&2 echo "Failure: $1: action not supported."
exit 1
}

case $1 in
before|main) action_$1;;
*) action_usage $1;;
esac
INSTALL_PREFIX="${HOME}/.local"
autoconf
./configure\
--prefix="${INSTALL_PREFIX}"\
--with-gpg\
--with-gm\
--with-tex\
--with-ocaml\
--with-noweb\
--with-credentials=sudo\
--enable-test-findlib\
--disable-test-noweb\
--disable-test-gpg\
--disable-test-texmf
bmake build
bmake test
bmake install
test -f "${INSTALL_PREFIX}/share/bsdowl/bps.bpsconfig.mk"

### End of file `travis-tool'
1 change: 0 additions & 1 deletion Library/Make/bsdowl.test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
TEST_SEQUENCE?= clean obj depend build doc install

TEST_ENV+= DESTDIR='/tmp/${USER}${PACKAGEDIR}$${TESTDIR}$${ARCHITECTUREDIR}$${CONFIGURATIONDIR}'
TEST_ENV+= PREFIX='/usr/local'
TEST_ENV+= USE_SWITCH_CREDENTIALS='no'
TEST_ENV+= MAKEOBJDIRPREFIX='/tmp/${USER}${PACKAGEDIR}$${TESTDIR}$${ARCHITECTUREDIR}$${CONFIGURATIONDIR}'
TEST_ENV+= PACKAGELIBRARYCONFIGURATION='${SRCDIR}/testsuite/Library/Configuration'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/michipili/bsdowl.svg)](https://travis-ci.org/michipili/bsdowl)
[![Build Status](https://travis-ci.org/michipili/bsdowl.svg?branch=master)](https://travis-ci.org/michipili/bsdowl?branch=master)

# BSD Owl Scripts

Expand Down
3 changes: 3 additions & 0 deletions testsuite/ocaml/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
SUBDIR= test_program
SUBDIR+= test_library
SUBDIR+= test_complex

.if "${WITH_TESTSUITE_FINDLIB}" == "yes"
SUBDIR+= test_toplevel
.endif

.include "generic.subdir.mk"

Expand Down
10 changes: 7 additions & 3 deletions testsuite/ocaml/test_complex/TestComplexMultiple.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ CONFIGURATIONLIST= Debug Profile Release
TARGETLIST= realclean distclean clean
TARGETLIST+= obj depend build doc install

prefix= /opt/bsdowl

.export: prefix

${TARGETLIST}: .PHONY
.for configuration in ${CONFIGURATIONLIST}
cd ${.CURDIR} && ${MAKE} -f ${.CURDIR}/TestComplex.mk\
Expand All @@ -26,9 +30,9 @@ ${TARGETLIST}: .PHONY
${.TARGET}
.endfor

LIBDIR= /usr/local/lib/golden_ratio
BINDIR= /usr/local/bin
DOCDIR= /usr/local/share/doc/golden_ratio
LIBDIR= ${prefix}/lib/golden_ratio
BINDIR= ${prefix}/bin
DOCDIR= ${prefix}/share/doc/golden_ratio

.for configuration in ${CONFIGURATIONLIST}
testdir:= ${MAKEOBJDIRPREFIX}/${configuration}
Expand Down

0 comments on commit 144f182

Please sign in to comment.