Skip to content

Commit

Permalink
First version of rake deps
Browse files Browse the repository at this point in the history
  • Loading branch information
steveklabnik committed Feb 28, 2011
1 parent 98d0170 commit ec1db38
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .rvmrc
@@ -0,0 +1,47 @@
#!/usr/bin/env bash

# This is an RVM Project .rvmrc file, used to automatically load the ruby
# development environment upon cd'ing into the directory

# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
environment_id="ruby-1.9.2-p136@shoes"

#
# First we attempt to load the desired environment directly from the environment
# file, this is very fast and efficicent compared to running through the entire
# CLI and selector. If you want feedback on which environment was used then
# insert the word 'use' after --create as this triggers verbose mode.
#
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] ; then
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
else
# If the environment file has not yet been created, use the RVM CLI to select.
rvm --create "$environment_id"
fi

#
# If you use an RVM gemset file to install a list of gems (*.gems), you can have
# it be automatically loaded, uncomment the following and adjust the filename if
# necessary.
#
# filename=".gems"
# if [[ -s "$filename" ]] ; then
# rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
# fi

#
# If you use bundler and would like to run bundle each time you enter the
# directory you can uncomment the following code.
#
# # Ensure that Bundler is installed, install it if it is not.
# if ! command -v bundle ; then
# printf "The rubygem 'bundler' is not installed, installing it now.\n"
# gem install bundler
# fi
#
# # Bundle while redcing excess noise.
# printf "Bundling your gems this may take a few minutes on a fresh clone.\n"
# bundle | grep -v 'Using' | grep -v 'complete' | sed '/^$/d'
#

5 changes: 5 additions & 0 deletions Gemfile
@@ -0,0 +1,5 @@
source "http://rubygems.org"

group :development do
gem "mechanize"
end
12 changes: 12 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,12 @@
GEM
remote: http://rubygems.org/
specs:
mechanize (1.0.0)
nokogiri (>= 1.2.1)
nokogiri (1.4.4)

PLATFORMS
ruby

DEPENDENCIES
mechanize
42 changes: 42 additions & 0 deletions Rakefile
Expand Up @@ -128,3 +128,45 @@ end
task :installer do
Builder.make_installer
end

# This is the list of dependancies that Shoes needs. The keys are the filenames
# in the deps directory, and the values are the URLs where they can be downloaded.
deps_list = {
"deps/pkg-config-0.20.tar.gz" => "http://pkg-config.freedesktop.org/releases/pkg-config-0.20.tar.gz",
"deps/libpng-1.4.1.tar.gz" => "http://sourceforge.net/projects/libpng/files/libpng14/older-releases/1.4.1/libpng-1.4.1.tar.gz/download",
"deps/giflib-4.1.6.tar.gz" => "http://sourceforge.net/projects/giflib/files/giflib%204.x/giflib-4.1.6/giflib-4.1.6.tar.gz/download",
"deps/gettext-0.17.tar.gz" => "http://ftp.gnu.org/gnu/gettext/gettext-0.17.tar.gz",
"deps/libiconv-1.13.tar.gz" => "http://ftp.gnu.org/gnu/libiconv/libiconv-1.13.tar.gz",
"deps/pixman-0.18.0.tar.gz" => "http://cgit.freedesktop.org/pixman/snapshot/pixman-0.18.0.tar.gz",
"deps/pango-1.28.0.tar.gz" => "http://ftp.gnome.org/pub/GNOME/sources/pango/1.28/pango-1.28.0.tar.gz",
"deps/pa_stable_v19_20071207.tar.gz" => "http://portaudio.com/archives/pa_stable_v19_20071207.tar.gz",
"deps/cairo-1.8.10.tar.gz" => "http://cairographics.org/releases/cairo-1.8.10.tar.gz",
"deps/jpegsrc.v8a.tar.gz" => "http://ijg.org/files/jpegsrc.v8a.tar.gz",
"deps/glib-2.24.0.tar.gz" => "http://ftp.gnome.org/pub/gnome/sources/glib/2.24/glib-2.24.0.tar.gz",
"deps/ruby-1.9.1-p378.tar.gz" => "http://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.1-p378.tar.gz"
}

desc "Build dependencies on Snow Leopard"
task "deps" => deps_list.keys do

#ENV['SOMETHING'] = "HELLO"

# For some reason, the pixman downloads with quotes.
if File.exists?("deps/\"pixman-0.18.0.tar.gz\"")
mv "deps/\"pixman-0.18.0.tar.gz\"", "deps/pixman-0.18.0.tar.gz"
end

end

require 'mechanize'
agent = Mechanize.new

deps_list.each do |name, url|
file name do
puts "downloading #{url}"
mkdir_p 'deps'
cd "deps" do
agent.get(url).save
end
end
end

0 comments on commit ec1db38

Please sign in to comment.