From d8c06cd99e2b46b00da53850570aed6b6d52da27 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 19 May 2013 09:19:29 +0200 Subject: add Travis-CI integration Travis-CI [1] is a continous integration cloud service. It is free for open-source projects and tigthly integrated tiwh GitHub so there is really no reason for us not use it. :) For now we are going to do a total of 4 builds, mainly to test ffmpeg/libav API breakage: * ffmpeg-stable, libass-stable * ffmpeg-git, libass-stable * libav-stable, libass-stable * libav-git, libass-stable The compiler that is currently used is clang for two reasons: * running 8 build targets would be quite wasteful and take a long time * clang is less tested and used during development than gcc (especially on linux) Currently Travis doesn't support OS X environments alongside Linux ones [2]. When it will, we will add a fifth build target to test OS X compilation breakage. README was moved to markdown to add the little build status image. I ran some tests with my GitHub fork and couldn't get images to show up using ReStructured Text. [1]: https://github.com/travis-ci/travis-ci [2]: travis-ci/travis-ci#216 --- travis-deps | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100755 travis-deps (limited to 'travis-deps') diff --git a/travis-deps b/travis-deps new file mode 100755 index 0000000000..029c0f3992 --- /dev/null +++ b/travis-deps @@ -0,0 +1,92 @@ +#!/usr/bin/ruby + +class TravisDepsBuilder + def self.make(name) + info = build_map[name] + raise "unrecognized dependency identifier '#{name}'" unless info + instance = new(name, info[:url], info[:action]) + instance.deps + instance.build + end + + attr_reader :name, :url, :action + + def initialize(name, url=nil, action=nil) + @name, @url, @action = name, url, action + end + + def build + send(@action) + end + + def deps; end + + private + def git + sh "git clone --depth=1 #{url} #{name}" + compile name + end + + def stable + filename = File.basename(url) + sh "wget #{url}" + sh "tar -xzvf #{filename}" + dirname = File.basename(url, ".tar.gz" ) + compile dirname + end + + def compile(dirname) + sh "cd #{dirname} && ./configure && make && sudo make install" + sh "cd $TRAVIS_BUILD_DIR" + end + + def sh(command) + `#{command}` + end +end + +class Libav < TravisDepsBuilder + def self.build_map + { + "libav-stable" => { + :action => :stable, + :url => 'http://libav.org/releases/libav-9.6.tar.gz' + }, + "libav-git" => { + :action => :git, + :url => "git://git.libav.org/libav.git" + }, + "ffmpeg-stable" => { + :action => :stable, + :url => 'http://www.ffmpeg.org/releases/ffmpeg-1.2.1.tar.gz' + }, + "ffmpeg-git" => { + :action => :git, + :url => "git://github.com/FFmpeg/FFmpeg.git" + } + } + end +end + +class Libass < TravisDepsBuilder + def self.build_map + { + "libass-stable" => { + :action => :stable, + :url => 'http://libass.googlecode.com/files/libass-0.10.1.tar.gz' + } + } + end +end + +class Dependencies < TravisDepsBuilder + def deps + sh "sudo apt-get update -y" + sh "sudo apt-get install pkg-config fontconfig libfribidi-dev yasm -y" + end +end + +Dependencies.new(:deps).deps + +Libass.make(ARGV[0]) +Libav.make(ARGV[1]) -- cgit v1.2.3