Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Sync with travis-ci/travis-cookbooks, support GHC 7.6.1

  • Loading branch information...
commit fb6b5a0506d7655906500547c8d0cc335a4da8b4 1 parent 4bcd692
@michaelklishin authored
View
10 recipes/default.rb
@@ -27,4 +27,12 @@
mode 0755
end
-include_recipe "haskell::source"
+case [node.platform, node.platform_version]
+when ["ubuntu", "11.10"] then
+ include_recipe "haskell::ghc_source"
+ include_recipe "haskell::platform_source"
+when ["ubuntu", "12.04"] then
+ include_recipe "haskell::ghc_package"
+ include_recipe "haskell::platform_package"
+end
+
View
28 recipes/ghc_package.rb
@@ -0,0 +1,28 @@
+#
+# Cookbook Name:: haskell
+# Recipe:: ghc::package
+# Copyright 2012, Travis CI development team
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+%w(ghc).each do |pkg|
+ package(pkg) do
+ action :install
+ end
+end
View
19 recipes/ghc.rb → recipes/ghc_source.rb
@@ -27,17 +27,28 @@
end
end
-link "/usr/lib/libgmp.so.3" do
- to "/usr/lib/libgmp.so"
+case [node.platform, node.platform_version]
+when ["ubuntu", "11.10"] then
+ link "/usr/lib/libgmp.so.3" do
+ to "/usr/lib/libgmp.so"
- not_if "test -L /usr/lib/libgmp.so.3"
+ not_if "test -L /usr/lib/libgmp.so.3"
+ end
+when ["ubuntu", "12.04"] then
+ package "libgmp3c2"
+
+ link "/usr/lib/libgmp.so.3" do
+ to "/usr/lib/libgmp.so.3.5.2"
+
+ not_if "test -L /usr/lib/libgmp.so.3"
+ end
end
require "tmpdir"
td = Dir.tmpdir
-local_tarball = File.join(td, "ghc-#{node.ghc.version}-i386-unknown-linux.tar.bz2")
+local_tarball = File.join(td, "ghc-#{node.ghc.version}-#{node.ghc.arch}-unknown-linux.tar.bz2")
remote_file(local_tarball) do
source "http://www.haskell.org/ghc/dist/#{node.ghc.version}/ghc-#{node.ghc.version}-#{node.ghc.arch}-unknown-linux.tar.bz2"
View
52 recipes/platform_package.rb
@@ -0,0 +1,52 @@
+#
+# Cookbook Name:: haskell
+# Recipe:: platform_package
+# Copyright 2012, Travis CI development team
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+script "initialize cabal" do
+ interpreter "bash"
+ user node.travis_build_environment.user
+ cwd node.travis_build_environment.home
+
+ environment Hash['HOME' => node.travis_build_environment.home]
+
+ code <<-SH
+ cabal update
+ cabal install c2hs
+ SH
+
+ # triggered by haskell-platform installation
+ action :nothing
+ # until http://haskell.1045720.n5.nabble.com/Cabal-install-fails-due-to-recent-HUnit-tt5715081.html#none is resolved :( MK.
+ ignore_failure true
+end
+
+package "haskell-platform" do
+ action :install
+
+ notifies :run, resources(:script => "initialize cabal")
+end
+
+cookbook_file "/etc/profile.d/cabal.sh" do
+ owner node.travis_build_environment.user
+ group node.travis_build_environment.group
+ mode 0755
+end
View
2  recipes/package.rb → recipes/platform_ppa.rb
@@ -1,6 +1,6 @@
#
# Cookbook Name:: haskell
-# Recipe:: ppa
+# Recipe:: platform_ppa
# Copyright 2012, Travis CI development team
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
View
9 recipes/platform.rb → recipes/platform_source.rb
@@ -1,6 +1,6 @@
#
# Cookbook Name:: haskell
-# Recipe:: platform
+# Recipe:: platform::source
# Copyright 2012, Travis CI development team
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -21,7 +21,12 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-include_recipe "haskell::ghc"
+case [node[:platform_name], node[:platform_version]]
+when ["ubuntu", "11.10"] then
+ include_recipe "haskell::ghc::source"
+when ["ubuntu", "12.04"] then
+ include_recipe "haskell::ghc::package"
+end
require "tmpdir"
View
4 recipes/source.rb
@@ -21,5 +21,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-include_recipe "haskell::ghc"
-include_recipe "haskell::platform"
+include_recipe "haskell::ghc_source"
+include_recipe "haskell::platform_source"
Please sign in to comment.
Something went wrong with that request. Please try again.