Skip to content

Commit

Permalink
Add LD_FLAGS and C_FLAGS environment variables
Browse files Browse the repository at this point in the history
Update travis config for sudo: false installation
  • Loading branch information
wjordan committed Dec 18, 2014
1 parent 17d4d95 commit 7ac589b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ language: ruby

before_install:
- ./spec/travis_build.sh > /dev/null 2>&1
- export LD_FLAGS=-L$HOME/opt/lib
- export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:$HOME/opt/lib
- export CPATH=$CPATH:$HOME/opt/include


rvm:
- 1.9.3
Expand All @@ -12,7 +16,8 @@ rvm:
- ruby-head
- jruby-head

sudo: true
cache: bundler
sudo: false

notifications:
email: false
Expand All @@ -26,4 +31,4 @@ matrix:
allow_failures:
- rvm: rbx-19mode
- rvm: ruby-head
- rvm: jruby-head
- rvm: jruby-head
4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ namespace "ffi-compiler" do
c.cflags << "-arch x86_64"
c.ldflags << "-arch x86_64"
end
c.ldflags << ENV['LD_FLAGS'] if ENV['LD_FLAGS']
c.cflags << ENV['C_FLAGS'] if ENV['C_FLAGS']
end
end
task :compile => ["ffi-compiler:default"]
Expand All @@ -37,4 +39,4 @@ task :default => [:clean, :compile, :spec]

CLEAN.include('ext/**/*{.o,.log,.so,.bundle}')
CLEAN.include('lib/**/*{.o,.log,.so,.bundle}')
CLEAN.include('ext/**/Makefile')
CLEAN.include('ext/**/Makefile')
2 changes: 2 additions & 0 deletions ext/webp_ffi/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ FFI::Compiler::CompileTask.new('webp_ffi') do |c|
c.cflags << "-arch x86_64"
c.ldflags << "-arch x86_64"
end
c.ldflags << ENV['LD_FLAGS'] if ENV['LD_FLAGS']
c.cflags << ENV['C_FLAGS'] if ENV['C_FLAGS']
end
5 changes: 2 additions & 3 deletions spec/travis_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
wget http://downloads.webmproject.org/releases/webp/libwebp-0.4.2.tar.gz
tar xvzf libwebp-0.4.2.tar.gz
cd libwebp-0.4.2
./configure
make && sudo make install
sudo ln -fs /usr/local/lib/libwebp.* /usr/lib/
./configure --prefix=$HOME/opt
make && make install

0 comments on commit 7ac589b

Please sign in to comment.