do_sqlite3 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1,8 @@
1
+ == 0.9.9 2008-11-27
2
+ * Improvements
3
+ * Added cross compile rake tasks for Windows gems [Jonathan Stott, Luis Lavena]
4
+ * Added initial support for Ruby 1.9 [John Harrison]
1
5
 
6
+ * Bug Fixes
7
+ * Removed sqlite3.dll from source gem [Dan Kubb]
8
+ * Removed hard coded .bundle from source [Dirkjan Bussink]
@@ -8,7 +8,6 @@ TODO
8
8
  ext/do_sqlite3_ext.c
9
9
  ext/extconf.rb
10
10
  lib/do_sqlite3.rb
11
- lib/do_sqlite3/sqlite3.dll
12
11
  lib/do_sqlite3/transaction.rb
13
12
  lib/do_sqlite3/version.rb
14
13
  spec/integration/do_sqlite3_spec.rb
data/Rakefile CHANGED
@@ -18,10 +18,10 @@ GEM_NAME = "do_sqlite3"
18
18
  GEM_VERSION = DataObjects::Sqlite3::VERSION
19
19
  GEM_DEPENDENCIES = [["data_objects", GEM_VERSION]]
20
20
 
21
+ # TODO: remove duplicates from here that are already listed in .gitignore
21
22
  clean = %w(o bundle log a gem dSYM obj pdb lib def exp DS_Store)
22
23
 
23
24
  unless ENV["WINDOWS"]
24
- clean << "so"
25
25
  GEM_EXTRAS = { :extensions => %w[ ext/extconf.rb ], :has_rdoc => false }
26
26
  else
27
27
  GEM_EXTRAS = {}
@@ -35,7 +35,15 @@ PROJECT_DESCRIPTION = PROJECT_SUMMARY = "A DataObject.rb driver for Sqlite3"
35
35
 
36
36
  DRIVER = true
37
37
 
38
- require ROOT.parent + 'tasks/hoe'
38
+ if (tasks_dir = ROOT.parent + 'tasks').directory?
39
+ require tasks_dir + 'hoe'
40
+
41
+ # use .gitignore to identify files to clean up
42
+ File.read(ROOT.parent + '.gitignore').split(/\s+/).each do |pattern|
43
+ next if pattern.include?('/') && !pattern.gsub!(/\A(?:\.\/)?#{ROOT.basename}(?:\/|\z)/, './')
44
+ GEM_CLEAN.concat(Dir.glob(pattern.include?('/') ? pattern : "**/#{pattern}"))
45
+ end
46
+ end
39
47
 
40
48
  # Installation
41
49
 
@@ -90,3 +98,107 @@ namespace :ci do
90
98
  end
91
99
 
92
100
  task :ci => ["ci:spec"]
101
+
102
+
103
+ # Windows specific stuff. (for cross-compiling a release)
104
+ # You have been warned.
105
+ # Thanks to Luis Lavena for helping through the writing of this.
106
+ # will eventually be replaced with: http://github.com/luislavena/rake-compiler
107
+
108
+ # use the do directory for the cross-compile stuff
109
+ CCROOT = ROOT.parent
110
+
111
+ SQLITE_VERSION = '3_6_6_2'
112
+
113
+ MINGW_PATH = ENV['MINGW_PATH'] || "/usr/i586-mingw32msvc"
114
+
115
+ if (tasks_dir = ROOT.parent + 'tasks').directory?
116
+ require tasks_dir + 'win32'
117
+
118
+ SQLITE_DIR = "#{CROSS}/sqlite-#{SQLITE_VERSION}"
119
+
120
+ namespace :build do
121
+
122
+ task :externals => "win32:sqlite3"
123
+
124
+ namespace :win32 do
125
+
126
+ desc "Creates cross compiled sqlite3 libraries"
127
+ task :sqlite3 => ["#{SQLITE_DIR}/include/sqlite3.h", "#{SQLITE_DIR}/lib/libsqlite3.a"]
128
+
129
+ directory SQLITE_DIR
130
+ directory "#{SQLITE_DIR}/include"
131
+ directory "#{SQLITE_DIR}/lib"
132
+
133
+ file "#{SQLITE_DIR}/include/sqlite3.h" => ["#{SQLITE_DIR}/include", "#{STASH}/sqlite-amalgamation-#{SQLITE_VERSION}.zip"] do |t|
134
+ when_writing "creating sqlite3.h" do
135
+ cd(t.prerequisites[0]) do
136
+ sh "unzip #{t.prerequisites[1]}"
137
+ touch t.name
138
+ end
139
+ end
140
+ end
141
+
142
+ file "#{SQLITE_DIR}/lib/libsqlite3.a" => ["#{SQLITE_DIR}/lib", "#{SQLITE_DIR}/sqlite3.dll"] do |t|
143
+ when_writing "creating libsqlite3.a" do
144
+ sh "#{MINGW_PATH}/bin/dlltool --dllname #{SQLITE_DIR}/sqlite3.dll --def #{SQLITE_DIR}/sqlite3.def --output-lib #{t.name}"
145
+ end
146
+ end
147
+
148
+ file "#{SQLITE_DIR}/sqlite3.dll" => [SQLITE_DIR, "#{STASH}/sqlitedll-#{SQLITE_VERSION}.zip"] do |t|
149
+ when_writing "creating sqlite3.dll" do
150
+ cd(SQLITE_DIR) do
151
+ sh "unzip #{t.prerequisites[1]}"
152
+ touch t.name
153
+ end
154
+ end
155
+ end
156
+
157
+ # download files
158
+ file "#{STASH}/sqlite-amalgamation-#{SQLITE_VERSION}.zip" => STASH do |t|
159
+ download_file(STASH, "http://www.sqlite.org/#{File.basename(t.name)}")
160
+ end
161
+
162
+ file "#{STASH}/sqlitedll-#{SQLITE_VERSION}.zip" => STASH do |t|
163
+ download_file(STASH, "http://www.sqlite.org/#{File.basename(t.name)}")
164
+ end
165
+
166
+ # The extension. This is a task so it's rebuilt each time it is run, so we're sure to have a windows
167
+ # compiled extension.
168
+ task "lib/do_sqlite3_ext.so" => [:clean, "build:externals"] + FileList["ext/extconf.rb", "ext/*.c", "ext/*.h"] do
169
+ when_writing "Creating compiled extension" do
170
+ cd('ext') do
171
+ ruby " -I #{CROSS}/lib/ruby/1.8/i386-mingw32/ extconf.rb -- --with-sqlite3-dir=#{SQLITE_DIR}"
172
+ sh 'make'
173
+ end
174
+ mv 'ext/do_sqlite3_ext.so', 'lib'
175
+ end
176
+ end
177
+
178
+ task :extension => "lib/do_sqlite3_ext.so"
179
+
180
+ end
181
+ end
182
+
183
+ namespace :gem do
184
+ namespace :win32 do
185
+ desc "Package pre-compiled win32 gem"
186
+ task :package => "pkg/#{GEM_NAME}-#{GEM_VERSION}-x86-mswin32-60.gem"
187
+
188
+ file "pkg/#{GEM_NAME}-#{GEM_VERSION}-x86-mswin32-60.gem" => ["build:win32:extension", "pkg"] + HOE.spec.files do |t|
189
+ spec = HOE.spec.dup
190
+ spec.extensions = nil
191
+ spec.files += Dir['lib/**.so']
192
+ spec.platform = 'x86-mswin32-60'
193
+ spec.post_install_message = <<-eos
194
+ Now download http://www.sqlite.org/sqlitedll-#{SQLITE_VERSION}.zip
195
+ And place the dll somewhere in your PATH, for example C:\\ruby\\bin
196
+ eos
197
+ when_writing "Building win32 do_sqlite3 gem" do
198
+ Gem::Builder.new(spec).build
199
+ end
200
+ mv File.basename(t.name), t.name
201
+ end
202
+ end
203
+ end
204
+ end
@@ -4,10 +4,10 @@
4
4
  # of the actual extension file.
5
5
  if RUBY_PLATFORM.match(/mingw|mswin/i)
6
6
  libdir = File.expand_path(File.dirname(__FILE__)).gsub(File::SEPARATOR, File::ALT_SEPARATOR)
7
- ENV['PATH'] = File.join(libdir, "do_sqlite3;") + ENV['PATH']
7
+ ENV['PATH'] = "#{libdir};" + ENV['PATH']
8
8
  end
9
9
 
10
10
  require 'rubygems'
11
11
  require 'data_objects'
12
- require File.expand_path(File.join(File.dirname(__FILE__), 'do_sqlite3_ext.bundle'))
13
- require File.expand_path(File.join(File.dirname(__FILE__), 'do_sqlite3', 'transaction'))
12
+ require 'do_sqlite3_ext'
13
+ require 'do_sqlite3/transaction'
@@ -1,5 +1,5 @@
1
1
  module DataObjects
2
2
  module Sqlite3
3
- VERSION = "0.9.8"
3
+ VERSION = "0.9.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: do_sqlite3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernerd Schaefer
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-24 00:00:00 -08:00
12
+ date: 2008-11-27 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.9.8
23
+ version: 0.9.9
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: hoe
@@ -54,7 +54,6 @@ files:
54
54
  - ext/do_sqlite3_ext.c
55
55
  - ext/extconf.rb
56
56
  - lib/do_sqlite3.rb
57
- - lib/do_sqlite3/sqlite3.dll
58
57
  - lib/do_sqlite3/transaction.rb
59
58
  - lib/do_sqlite3/version.rb
60
59
  - spec/integration/do_sqlite3_spec.rb
Binary file