tiny_tds 1.3.0-x86-mingw32 → 2.0.0.pre1-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +2 -5
- data/Gemfile +4 -1
- data/README.md +13 -38
- data/Rakefile +26 -83
- data/VERSION +1 -1
- data/appveyor.yml +7 -4
- data/circle.yml +2 -4
- data/ext/tiny_tds/extconf.rb +33 -336
- data/lib/tiny_tds.rb +9 -4
- data/lib/tiny_tds/bin.rb +38 -19
- data/lib/tiny_tds/gem.rb +32 -0
- data/{ports/patches → patches}/freetds/1.00.27/0001-mingw_missing_inet_pton.diff +0 -0
- data/patches/libiconv/1.14/1-avoid-gets-error.patch +17 -0
- data/tasks/native_gem.rake +14 -0
- data/tasks/package.rake +8 -0
- data/tasks/ports.rake +84 -0
- data/tasks/ports/freetds.rb +37 -0
- data/tasks/ports/libiconv.rb +43 -0
- data/tasks/ports/openssl.rb +75 -0
- data/tasks/ports/recipe.rb +52 -0
- data/tasks/test.rake +9 -0
- data/test/bin/install-openssl.sh +2 -2
- data/test/bin/setup.sh +1 -1
- data/test/gem_test.rb +179 -0
- metadata +46 -12
@@ -0,0 +1,52 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'mini_portile2'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'rbconfig'
|
5
|
+
|
6
|
+
module Ports
|
7
|
+
class Recipe < MiniPortile
|
8
|
+
def cook
|
9
|
+
checkpoint = "ports/#{name}-#{version}-#{host}.installed"
|
10
|
+
|
11
|
+
unless File.exist? checkpoint
|
12
|
+
super
|
13
|
+
FileUtils.touch checkpoint
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def configure_defaults
|
20
|
+
[
|
21
|
+
"--host=#{@host}",
|
22
|
+
'--disable-static',
|
23
|
+
'--enable-shared'
|
24
|
+
]
|
25
|
+
end
|
26
|
+
|
27
|
+
def windows?
|
28
|
+
host =~ /mswin|mingw32/
|
29
|
+
end
|
30
|
+
|
31
|
+
def system_host
|
32
|
+
RbConfig::CONFIG['host']
|
33
|
+
end
|
34
|
+
|
35
|
+
def cross_build?
|
36
|
+
host != system_host
|
37
|
+
end
|
38
|
+
|
39
|
+
def get_patches(libname, version)
|
40
|
+
patches = []
|
41
|
+
|
42
|
+
patch_path = File.expand_path(
|
43
|
+
File.join('..','..','..','patches',libname,version),
|
44
|
+
__FILE__
|
45
|
+
)
|
46
|
+
|
47
|
+
patches.concat(Dir[File.join(patch_path, '*.patch')].sort)
|
48
|
+
patches.concat(Dir[File.join(patch_path, '*.diff')].sort)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
data/tasks/test.rake
ADDED
data/test/bin/install-openssl.sh
CHANGED
@@ -10,9 +10,9 @@ fi
|
|
10
10
|
wget https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
|
11
11
|
tar -xzf openssl-$OPENSSL_VERSION.tar.gz
|
12
12
|
cd openssl-$OPENSSL_VERSION
|
13
|
-
./config --prefix=/
|
13
|
+
./config --prefix=/opt/local --openssldir=/opt/local
|
14
14
|
make
|
15
|
-
make
|
15
|
+
make install_sw install_ssldirs
|
16
16
|
cd ..
|
17
17
|
rm -rf openssl-$OPENSSL_VERSION
|
18
18
|
rm openssl-$OPENSSL_VERSION.tar.gz
|
data/test/bin/setup.sh
CHANGED
data/test/gem_test.rb
ADDED
@@ -0,0 +1,179 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'test_helper'
|
3
|
+
require 'tiny_tds/gem'
|
4
|
+
|
5
|
+
class GemTest < MiniTest::Spec
|
6
|
+
gem_root ||= File.expand_path '../..', __FILE__
|
7
|
+
|
8
|
+
describe TinyTds::Gem do
|
9
|
+
|
10
|
+
# We're going to muck with some system globals so lets make sure
|
11
|
+
# they get set back later
|
12
|
+
original_host = RbConfig::CONFIG['host']
|
13
|
+
original_pwd = Dir.pwd
|
14
|
+
|
15
|
+
after do
|
16
|
+
RbConfig::CONFIG['host'] = original_host
|
17
|
+
Dir.chdir original_pwd
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#root_path' do
|
21
|
+
let(:root_path) { TinyTds::Gem.root_path }
|
22
|
+
|
23
|
+
it 'should be the root path' do
|
24
|
+
root_path.must_equal gem_root
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should be the root path no matter the cwd' do
|
28
|
+
Dir.chdir '/'
|
29
|
+
|
30
|
+
root_path.must_equal gem_root
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '#ports_root_path' do
|
35
|
+
let(:ports_root_path) { TinyTds::Gem.ports_root_path }
|
36
|
+
|
37
|
+
it 'should be the ports path' do
|
38
|
+
ports_root_path.must_equal File.join(gem_root,'ports')
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'should be the ports path no matter the cwd' do
|
42
|
+
Dir.chdir '/'
|
43
|
+
|
44
|
+
ports_root_path.must_equal File.join(gem_root,'ports')
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '#ports_bin_paths' do
|
49
|
+
let(:ports_bin_paths) { TinyTds::Gem.ports_bin_paths }
|
50
|
+
|
51
|
+
describe 'when the ports directories exist' do
|
52
|
+
let(:fake_bin_paths) do
|
53
|
+
ports_host_root = File.join(gem_root, 'ports', 'fake-host-with-dirs')
|
54
|
+
[
|
55
|
+
File.join('a','bin'),
|
56
|
+
File.join('a','inner','bin'),
|
57
|
+
File.join('b','bin')
|
58
|
+
].map do |p|
|
59
|
+
File.join(ports_host_root, p)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
before do
|
64
|
+
RbConfig::CONFIG['host'] = 'fake-host-with-dirs'
|
65
|
+
fake_bin_paths.each do |path|
|
66
|
+
FileUtils.mkdir_p(path)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
after do
|
71
|
+
FileUtils.remove_entry_secure(
|
72
|
+
File.join(gem_root, 'ports', 'fake-host-with-dirs'), true
|
73
|
+
)
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'should return all the bin directories' do
|
77
|
+
ports_bin_paths.sort.must_equal fake_bin_paths.sort
|
78
|
+
end
|
79
|
+
|
80
|
+
it 'should return all the bin directories regardless of cwd' do
|
81
|
+
Dir.chdir '/'
|
82
|
+
ports_bin_paths.sort.must_equal fake_bin_paths.sort
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
describe 'when the ports directories are missing' do
|
87
|
+
before do
|
88
|
+
RbConfig::CONFIG['host'] = 'fake-host-without-dirs'
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'should return no directories' do
|
92
|
+
ports_bin_paths.must_be_empty
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'should return no directories regardless of cwd' do
|
96
|
+
Dir.chdir '/'
|
97
|
+
ports_bin_paths.must_be_empty
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
describe '#ports_lib_paths' do
|
103
|
+
let(:ports_lib_paths) { TinyTds::Gem.ports_lib_paths }
|
104
|
+
|
105
|
+
describe 'when the ports directories exist' do
|
106
|
+
let(:fake_lib_paths) do
|
107
|
+
ports_host_root = File.join(gem_root, 'ports', 'fake-host-with-dirs')
|
108
|
+
[
|
109
|
+
File.join('a','lib'),
|
110
|
+
File.join('a','inner','lib'),
|
111
|
+
File.join('b','lib')
|
112
|
+
].map do |p|
|
113
|
+
File.join(ports_host_root, p)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
before do
|
118
|
+
RbConfig::CONFIG['host'] = 'fake-host-with-dirs'
|
119
|
+
fake_lib_paths.each do |path|
|
120
|
+
FileUtils.mkdir_p(path)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
after do
|
125
|
+
FileUtils.remove_entry_secure(
|
126
|
+
File.join(gem_root, 'ports', 'fake-host-with-dirs'), true
|
127
|
+
)
|
128
|
+
end
|
129
|
+
|
130
|
+
it 'should return all the lib directories' do
|
131
|
+
ports_lib_paths.sort.must_equal fake_lib_paths.sort
|
132
|
+
end
|
133
|
+
|
134
|
+
it 'should return all the lib directories regardless of cwd' do
|
135
|
+
Dir.chdir '/'
|
136
|
+
ports_lib_paths.sort.must_equal fake_lib_paths.sort
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
describe 'when the ports directories are missing' do
|
141
|
+
before do
|
142
|
+
RbConfig::CONFIG['host'] = 'fake-host-without-dirs'
|
143
|
+
end
|
144
|
+
|
145
|
+
|
146
|
+
it 'should return no directories' do
|
147
|
+
ports_lib_paths.must_be_empty
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'should return no directories regardless of cwd' do
|
151
|
+
Dir.chdir '/'
|
152
|
+
ports_lib_paths.must_be_empty
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
describe '#ports_host' do
|
158
|
+
{
|
159
|
+
'i686-pc-linux-gnu' => 'i686-pc-linux-gnu',
|
160
|
+
'x86_64-pc-linux-gnu' => 'x86_64-pc-linux-gnu',
|
161
|
+
'i686-w64-mingw32' => 'i686-w64-mingw32',
|
162
|
+
'x86_64-w64-mingw32' => 'x86_64-w64-mingw32',
|
163
|
+
# consolidate this host to our build w64-mingw32 arch
|
164
|
+
'i686-pc-mingw32' => 'i686-w64-mingw32'
|
165
|
+
}.each do |host,expected|
|
166
|
+
describe "on a #{host} architecture" do
|
167
|
+
before do
|
168
|
+
RbConfig::CONFIG['host'] = host
|
169
|
+
end
|
170
|
+
|
171
|
+
it "should return a #{expected} ports host" do
|
172
|
+
TinyTds::Gem.ports_host.must_equal expected
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiny_tds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.pre1
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Ken Collins
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-07-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mini_portile2
|
@@ -126,8 +126,6 @@ files:
|
|
126
126
|
- bin/tsql
|
127
127
|
- circle.yml
|
128
128
|
- exe/.keep
|
129
|
-
- exe/defncopy.exe
|
130
|
-
- exe/tsql.exe
|
131
129
|
- ext/tiny_tds/client.c
|
132
130
|
- ext/tiny_tds/client.h
|
133
131
|
- ext/tiny_tds/extconf.rb
|
@@ -145,13 +143,48 @@ files:
|
|
145
143
|
- lib/tiny_tds/bin.rb
|
146
144
|
- lib/tiny_tds/client.rb
|
147
145
|
- lib/tiny_tds/error.rb
|
146
|
+
- lib/tiny_tds/gem.rb
|
148
147
|
- lib/tiny_tds/result.rb
|
149
148
|
- lib/tiny_tds/version.rb
|
150
|
-
-
|
151
|
-
-
|
152
|
-
- ports/i686-w64-mingw32/
|
153
|
-
- ports/i686-w64-mingw32/bin/
|
154
|
-
- ports/
|
149
|
+
- patches/freetds/1.00.27/0001-mingw_missing_inet_pton.diff
|
150
|
+
- patches/libiconv/1.14/1-avoid-gets-error.patch
|
151
|
+
- ports/i686-w64-mingw32/freetds/1.00.27/bin/bsqldb.exe
|
152
|
+
- ports/i686-w64-mingw32/freetds/1.00.27/bin/datacopy.exe
|
153
|
+
- ports/i686-w64-mingw32/freetds/1.00.27/bin/defncopy.exe
|
154
|
+
- ports/i686-w64-mingw32/freetds/1.00.27/bin/freebcp.exe
|
155
|
+
- ports/i686-w64-mingw32/freetds/1.00.27/bin/libct-4.dll
|
156
|
+
- ports/i686-w64-mingw32/freetds/1.00.27/bin/libsybdb-5.dll
|
157
|
+
- ports/i686-w64-mingw32/freetds/1.00.27/bin/osql
|
158
|
+
- ports/i686-w64-mingw32/freetds/1.00.27/bin/tdspool.exe
|
159
|
+
- ports/i686-w64-mingw32/freetds/1.00.27/bin/tsql.exe
|
160
|
+
- ports/i686-w64-mingw32/freetds/1.00.27/lib/libct.dll.a
|
161
|
+
- ports/i686-w64-mingw32/freetds/1.00.27/lib/libct.la
|
162
|
+
- ports/i686-w64-mingw32/freetds/1.00.27/lib/libsybdb.dll.a
|
163
|
+
- ports/i686-w64-mingw32/freetds/1.00.27/lib/libsybdb.la
|
164
|
+
- ports/i686-w64-mingw32/libiconv/1.14/bin/iconv.exe
|
165
|
+
- ports/i686-w64-mingw32/libiconv/1.14/bin/libcharset-1.dll
|
166
|
+
- ports/i686-w64-mingw32/libiconv/1.14/bin/libiconv-2.dll
|
167
|
+
- ports/i686-w64-mingw32/libiconv/1.14/lib/charset.alias
|
168
|
+
- ports/i686-w64-mingw32/libiconv/1.14/lib/libcharset.dll.a
|
169
|
+
- ports/i686-w64-mingw32/libiconv/1.14/lib/libcharset.la
|
170
|
+
- ports/i686-w64-mingw32/libiconv/1.14/lib/libiconv.dll.a
|
171
|
+
- ports/i686-w64-mingw32/libiconv/1.14/lib/libiconv.la
|
172
|
+
- ports/i686-w64-mingw32/openssl/1.1.0e/bin/c_rehash
|
173
|
+
- ports/i686-w64-mingw32/openssl/1.1.0e/bin/libcrypto-1_1.dll
|
174
|
+
- ports/i686-w64-mingw32/openssl/1.1.0e/bin/libssl-1_1.dll
|
175
|
+
- ports/i686-w64-mingw32/openssl/1.1.0e/bin/openssl.exe
|
176
|
+
- ports/i686-w64-mingw32/openssl/1.1.0e/lib/libcrypto.a
|
177
|
+
- ports/i686-w64-mingw32/openssl/1.1.0e/lib/libcrypto.dll.a
|
178
|
+
- ports/i686-w64-mingw32/openssl/1.1.0e/lib/libssl.a
|
179
|
+
- ports/i686-w64-mingw32/openssl/1.1.0e/lib/libssl.dll.a
|
180
|
+
- tasks/native_gem.rake
|
181
|
+
- tasks/package.rake
|
182
|
+
- tasks/ports.rake
|
183
|
+
- tasks/ports/freetds.rb
|
184
|
+
- tasks/ports/libiconv.rb
|
185
|
+
- tasks/ports/openssl.rb
|
186
|
+
- tasks/ports/recipe.rb
|
187
|
+
- tasks/test.rake
|
155
188
|
- test/appveyor/dbsetup.ps1
|
156
189
|
- test/appveyor/dbsetup.sql
|
157
190
|
- test/benchmark/query.rb
|
@@ -161,6 +194,7 @@ files:
|
|
161
194
|
- test/bin/install-openssl.sh
|
162
195
|
- test/bin/setup.sh
|
163
196
|
- test/client_test.rb
|
197
|
+
- test/gem_test.rb
|
164
198
|
- test/result_test.rb
|
165
199
|
- test/schema/1px.gif
|
166
200
|
- test/schema/sqlserver_2000.sql
|
@@ -190,12 +224,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
190
224
|
version: 2.0.0
|
191
225
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
192
226
|
requirements:
|
193
|
-
- - "
|
227
|
+
- - ">"
|
194
228
|
- !ruby/object:Gem::Version
|
195
|
-
version:
|
229
|
+
version: 1.3.1
|
196
230
|
requirements: []
|
197
231
|
rubyforge_project:
|
198
|
-
rubygems_version: 2.6.
|
232
|
+
rubygems_version: 2.6.12
|
199
233
|
signing_key:
|
200
234
|
specification_version: 4
|
201
235
|
summary: TinyTDS - A modern, simple and fast FreeTDS library for Ruby using DB-Library.
|