Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Installation messages for cross compiled gems
Browse files Browse the repository at this point in the history
  • Loading branch information
dbussink committed Jan 5, 2010
1 parent a1d440e commit 152a22d
Show file tree
Hide file tree
Showing 17 changed files with 100 additions and 22 deletions.
13 changes: 0 additions & 13 deletions TODO.markdown
Expand Up @@ -4,19 +4,6 @@ DataObjects TODO
This is a semistructured document describing what the future plans
are for DataObjects. The list is ordered somewhat by priority.

Reader should be Enumerable
---------------------------

Make reader implement the Enumerable interface for a more Ruby'ish feel.
This also should provide a Reader#to_a to create a big Array of data. We need
to add shared specs that show this behavior.

Use Rubinius' compat.h
----------------------
This makes DataObjects a lot friendlier to Rubinius and doesn't have any impact
on MRI. DataObjects is already using strings properly, so adding this should
be very easy.

Use native parameter binding
----------------------------

Expand Down
2 changes: 1 addition & 1 deletion data_objects/data_objects.gemspec
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |s|

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Dirkjan Bussink"]
s.date = %q{2010-01-04}
s.date = %q{2010-01-05}
s.description = %q{Provide a standard and simplified API for communicating with RDBMS from Ruby}
s.email = %q{d.bussink@gmail.com}
s.extra_rdoc_files = [
Expand Down
1 change: 1 addition & 0 deletions data_objects/spec/spec_helper.rb
Expand Up @@ -3,6 +3,7 @@
require 'data_objects/spec/bacon'
require 'mocha/api'
require 'mocha/object'
require 'win32console' if RUBY_PLATFORM =~ /mingw|mswin/

module DataObjects::Pooling
class << self
Expand Down
2 changes: 1 addition & 1 deletion do_mysql/do_mysql.gemspec
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |s|

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Dirkjan Bussink"]
s.date = %q{2010-01-04}
s.date = %q{2010-01-05}
s.description = %q{Implements the DataObjects API for MySQL}
s.email = %q{d.bussink@gmail.com}
s.extensions = ["ext/do_mysql/extconf.rb"]
Expand Down
3 changes: 3 additions & 0 deletions do_mysql/ext/do_mysql/extconf.rb
Expand Up @@ -2,6 +2,9 @@

require 'mkmf'

# Allow for custom compiler to be specified.
RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']

# All instances of mysql_config on PATH ...
def mysql_config_paths
ENV['PATH'].split(File::PATH_SEPARATOR).collect do |path|
Expand Down
1 change: 1 addition & 0 deletions do_mysql/spec/spec_helper.rb
Expand Up @@ -5,6 +5,7 @@
require 'date'
require 'ostruct'
require 'fileutils'
require 'win32console' if RUBY_PLATFORM =~ /mingw|mswin/

driver_lib = File.expand_path('../../lib', __FILE__)
$LOAD_PATH.unshift(driver_lib) unless $LOAD_PATH.include?(driver_lib)
Expand Down
23 changes: 23 additions & 0 deletions do_mysql/tasks/compile.rake
Expand Up @@ -23,6 +23,29 @@ begin
ext.cross_platform = ['x86-mingw32', 'x86-mswin32-60']
ext.cross_config_options << "--with-mysql-include=#{mysql_lib}/include"
ext.cross_config_options << "--with-mysql-lib=#{mysql_lib}/lib/opt"

ext.cross_compiling do |gemspec|
gemspec.post_install_message = <<-POST_INSTALL_MESSAGE
======================================================================================================
You've installed the binary version of #{gemspec.name}.
It was built using MySQL version #{BINARY_VERSION}.
It's recommended to use the exact same version to avoid potential issues.
At the time of building this gem, the necessary DLL files where available
in the following download:
http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-noinstall-#{BINARY_VERSION}-win32.zip/from/pick
You can put the lib\\opt\\libmysql.dll available in this package in your Ruby bin
directory, for example C:\\Ruby\\bin
======================================================================================================
POST_INSTALL_MESSAGE
end

end

end
Expand Down
2 changes: 1 addition & 1 deletion do_postgres/Rakefile
Expand Up @@ -11,7 +11,7 @@ JRUBY = RUBY_PLATFORM =~ /java/
IRONRUBY = defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ironruby'
WINDOWS = Gem.win_platform? || (JRUBY && ENV_JAVA['os.name'] =~ /windows/i)
SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])
BINARY_VERSION = '8.3.8'
BINARY_VERSION = '8.3.9'

CLEAN.include(%w[ {tmp,pkg}/ **/*.{o,so,bundle,jar,log,a,gem,dSYM,obj,pdb,exp,DS_Store,rbc,db} ext/do_postgres/Makefile ext-java/target ])

Expand Down
2 changes: 1 addition & 1 deletion do_postgres/do_postgres.gemspec
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |s|

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Dirkjan Bussink"]
s.date = %q{2010-01-04}
s.date = %q{2010-01-05}
s.description = %q{Implements the DataObjects API for PostgreSQL}
s.email = %q{d.bussink@gmail.com}
s.extensions = ["ext/do_postgres/extconf.rb"]
Expand Down
3 changes: 3 additions & 0 deletions do_postgres/ext/do_postgres/extconf.rb
Expand Up @@ -2,6 +2,9 @@

require 'mkmf'

# Allow for custom compiler to be specified.
RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']

def config_value(type)
ENV["POSTGRES_#{type.upcase}"] || pg_config(type)
end
Expand Down
1 change: 1 addition & 0 deletions do_postgres/spec/spec_helper.rb
Expand Up @@ -5,6 +5,7 @@
require 'date'
require 'ostruct'
require 'fileutils'
require 'win32console' if RUBY_PLATFORM =~ /mingw|mswin/

driver_lib = File.expand_path('../../lib', __FILE__)
$LOAD_PATH.unshift(driver_lib) unless $LOAD_PATH.include?(driver_lib)
Expand Down
35 changes: 34 additions & 1 deletion do_postgres/tasks/compile.rake
Expand Up @@ -18,7 +18,7 @@ begin

ext.cross_compiling do |gemspec|
gemspec.post_install_message = "You're installing the binary version of #{gemspec.name}. It was built using PostgreSQL version #{BINARY_VERSION}. Is recommended to use the exact same version to avoid potential issues."
end
end

# automatically add build options to avoid need of manual input
if RUBY_PLATFORM =~ /mswin|mingw/ then
Expand All @@ -33,6 +33,39 @@ begin
ext.cross_config_options << "--with-pgsql-client-include=#{postgres_lib}/include"
ext.cross_config_options << "--with-pgsql-win32-include=#{postgres_lib}/include/server/port/win32"
ext.cross_config_options << "--with-pgsql-client-lib=#{postgres_lib}/lib"

ext.cross_compiling do |gemspec|
gemspec.post_install_message = <<-POST_INSTALL_MESSAGE
======================================================================================================
You've installed the binary version of #{gemspec.name}.
It was built using PostgreSQL version #{BINARY_VERSION}.
It's recommended to use the exact same version to avoid potential issues.
At the time of building this gem, the necessary DLL files where available
in the following download:
http://wwwmaster.postgresql.org/redir/107/h/binary/v#{BINARY_VERSION}/win32/postgresql-#{BINARY_VERSION}-1-binaries-no-installer.zip
You can put the following files available in this package in your Ruby bin
directory, for example C:\\Ruby\\bin
- lib\\libpq.dll
- bin\\ssleay32.dll
- bin\\libeay32.dll
- bin\\libintl-8.dll
- bin\\libiconv-2.dll
- bin\\krb5_32.dll
- bin\\comerr32.dll
- bin\\k5sprt32.dll
- bin\\gssapi32.dll
======================================================================================================
POST_INSTALL_MESSAGE
end

end

end
Expand Down
4 changes: 2 additions & 2 deletions do_postgres/tasks/retrieve.rake
Expand Up @@ -48,8 +48,8 @@ begin
cd "vendor" do
sh "unzip #{full_file} pgsql/bin/** pgsql/include/** pgsql/lib/**"
end
copy "ext/do_postgres_ext/pg_config.h", "vendor/pgsql/include/pg_config.h"
copy "ext/do_postgres_ext/pg_config.h", "vendor/pgsql/include/server/pg_config.h"
copy "ext/do_postgres/pg_config.h", "vendor/pgsql/include/pg_config.h"
copy "ext/do_postgres/pg_config.h", "vendor/pgsql/include/server/pg_config.h"

# update file timestamp to avoid Rake perform this extraction again.
touch t.name
Expand Down
2 changes: 1 addition & 1 deletion do_sqlite3/do_sqlite3.gemspec
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |s|

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Dirkjan Bussink"]
s.date = %q{2010-01-04}
s.date = %q{2010-01-05}
s.description = %q{Implements the DataObjects API for Sqlite3}
s.email = %q{d.bussink@gmail.com}
s.extensions = ["ext/do_sqlite3/extconf.rb"]
Expand Down
3 changes: 3 additions & 0 deletions do_sqlite3/ext/do_sqlite3/extconf.rb
Expand Up @@ -3,6 +3,9 @@
# Loads mkmf which is used to make makefiles for Ruby extensions
require 'mkmf'

# Allow for custom compiler to be specified.
RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']

# Use some default search paths
dir_config("sqlite3", ["/usr/local", "/opt/local", "/usr"])

Expand Down
3 changes: 2 additions & 1 deletion do_sqlite3/spec/spec_helper.rb
Expand Up @@ -5,6 +5,7 @@
require 'date'
require 'ostruct'
require 'fileutils'
require 'win32console' if RUBY_PLATFORM =~ /mingw|mswin/

driver_lib = File.expand_path('../../lib', __FILE__)
$LOAD_PATH.unshift(driver_lib) unless $LOAD_PATH.include?(driver_lib)
Expand All @@ -26,7 +27,7 @@

CONFIG = OpenStruct.new
CONFIG.scheme = 'sqlite3'
CONFIG.database = ENV['DO_SQLITE3_DATABASE'] || "#{File.expand_path(File.dirname(__FILE__))}/test.db"
CONFIG.database = ENV['DO_SQLITE3_DATABASE'] || "memory:"

CONFIG.uri = ENV["DO_SQLITE3_SPEC_URI"] || "#{CONFIG.scheme}://#{CONFIG.database}"
CONFIG.jdbc_driver = 'org.sqlite.JDBC'
Expand Down
22 changes: 22 additions & 0 deletions do_sqlite3/tasks/compile.rake
Expand Up @@ -20,6 +20,28 @@ begin
ext.cross_platform = ['x86-mingw32', 'x86-mswin32-60']
ext.cross_config_options << "--with-sqlite3-dir=#{sqlite3_lib}"

ext.cross_compiling do |gemspec|
gemspec.post_install_message = <<-POST_INSTALL_MESSAGE
=============================================================================
You've installed the binary version of #{gemspec.name}.
It was built using Sqlite3 version #{BINARY_VERSION}.
It's recommended to use the exact same version to avoid potential issues.
At the time of building this gem, the necessary DLL files where available
in the following download:
http://www.sqlite.org/sqlitedll-#{BINARY_VERSION}.zip
You can put the sqlite3.dll available in this package in your Ruby bin
directory, for example C:\\Ruby\\bin
=============================================================================
POST_INSTALL_MESSAGE
end

# automatically add build options to avoid need of manual input
if RUBY_PLATFORM =~ /mswin|mingw/ then
ext.config_options << "--with-sqlite3-dir=#{sqlite3_lib}"
Expand Down

0 comments on commit 152a22d

Please sign in to comment.