Skip to content

Commit c4b802c

Browse files
committed
Specify the 'downloads' directory
And deal multi-toolchain dependent files properly
1 parent e6ade40 commit c4b802c

File tree

12 files changed

+193
-30
lines changed

12 files changed

+193
-30
lines changed

config/compilers/mingw64.rb

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,151 @@
11
module DevKitInstaller
22

3+
COMPILERS['mingw64-32-6.1.0-dgn'] =
4+
OpenStruct.new(
5+
:version => 'mingw64-32-6.1.0-dgn',
6+
:programs => [ :gcc, :cpp, :'g++' ],
7+
:program_prefix => nil,
8+
:url_1 => 'http://downloads.sourceforge.net/mingw-w64-dgn',
9+
:url_2 => 'http://downloads.sourceforge.net/mingw',
10+
:url_3 => 'http://downloads.sourceforge.net/gnuwin32',
11+
:target => 'sandbox/devkit/mingw',
12+
:relocate => 'sandbox/devkit/mingw/mingw32',
13+
:knap_path => '610-drangon',
14+
:files => {
15+
:url_1 => [
16+
'mingw-w32-bin-i686-20160428.7z'
17+
],
18+
:url_2 => [
19+
'autoconf2.1-2.13-4-mingw32-bin.tar.lzma',
20+
'autoconf2.5-2.68-1-mingw32-bin.tar.lzma',
21+
'autoconf-10-1-mingw32-bin.tar.lzma',
22+
'automake1.11-1.11.1-1-mingw32-bin.tar.lzma',
23+
'automake-4-1-mingw32-bin.tar.lzma',
24+
'libexpat-2.0.1-1-mingw32-dll-1.tar.gz',
25+
'libtool-2.4-1-mingw32-bin.tar.lzma',
26+
'bsdtar-2.8.3-1-mingw32-bin.tar.bz2',
27+
'bsdcpio-2.8.3-1-mingw32-bin.tar.bz2',
28+
'libarchive-2.8.3-1-mingw32-dll-2.tar.bz2',
29+
'libbz2-1.0.5-2-mingw32-dll-2.tar.gz',
30+
'liblzma-4.999.9beta_20100401-1-mingw32-dll-1.tar.bz2',
31+
'libz-1.2.3-1-mingw32-dll-1.tar.gz'
32+
],
33+
:url_3 => [
34+
'which-2.20-bin.zip'
35+
],
36+
}
37+
)
38+
39+
COMPILERS['mingw64-64-6.1.0-dgn'] =
40+
OpenStruct.new(
41+
:version => 'mingw64-64-6.1.0-dgn',
42+
:programs => [ :gcc, :cpp, :'g++' ],
43+
:program_prefix => nil,
44+
:url_1 => 'http://downloads.sourceforge.net/mingw-w64-dgn',
45+
:url_2 => 'http://downloads.sourceforge.net/mingw',
46+
:url_3 => 'http://downloads.sourceforge.net/gnuwin32',
47+
:target => 'sandbox/devkit/mingw',
48+
:relocate => 'sandbox/devkit/mingw/mingw64',
49+
:host => 'x86_64-w64-mingw32',
50+
:knap_path => '610-drangon',
51+
:files => {
52+
:url_1 => [
53+
'mingw-w64-bin-x86_64-20160428.7z'
54+
],
55+
:url_2 => [
56+
'autoconf2.1-2.13-4-mingw32-bin.tar.lzma',
57+
'autoconf2.5-2.68-1-mingw32-bin.tar.lzma',
58+
'autoconf-10-1-mingw32-bin.tar.lzma',
59+
'automake1.11-1.11.1-1-mingw32-bin.tar.lzma',
60+
'automake-4-1-mingw32-bin.tar.lzma',
61+
'libexpat-2.0.1-1-mingw32-dll-1.tar.gz',
62+
'libtool-2.4-1-mingw32-bin.tar.lzma',
63+
'bsdtar-2.8.3-1-mingw32-bin.tar.bz2',
64+
'bsdcpio-2.8.3-1-mingw32-bin.tar.bz2',
65+
'libarchive-2.8.3-1-mingw32-dll-2.tar.bz2',
66+
'libbz2-1.0.5-2-mingw32-dll-2.tar.gz',
67+
'liblzma-4.999.9beta_20100401-1-mingw32-dll-1.tar.bz2',
68+
'libz-1.2.3-1-mingw32-dll-1.tar.gz'
69+
],
70+
:url_3 => [
71+
'which-2.20-bin.zip'
72+
],
73+
}
74+
)
75+
76+
COMPILERS['mingw64-32-5.3.0'] =
77+
OpenStruct.new(
78+
:version => 'mingw64-32-5.3.0',
79+
:programs => [ :gcc, :cpp, :'g++' ],
80+
:program_prefix => nil,
81+
:url_1 => 'http://downloads.sourceforge.net/mingw-w64',
82+
:url_2 => 'http://downloads.sourceforge.net/mingw',
83+
:url_3 => 'http://downloads.sourceforge.net/gnuwin32',
84+
:target => 'sandbox/devkit/mingw',
85+
:relocate => 'sandbox/devkit/mingw/mingw32',
86+
:knap_path => '530-win32-sjlj',
87+
:files => {
88+
:url_1 => [
89+
'i686-5.3.0-release-win32-sjlj-rt_v4-rev0.7z'
90+
],
91+
:url_2 => [
92+
'autoconf2.1-2.13-4-mingw32-bin.tar.lzma',
93+
'autoconf2.5-2.68-1-mingw32-bin.tar.lzma',
94+
'autoconf-10-1-mingw32-bin.tar.lzma',
95+
'automake1.11-1.11.1-1-mingw32-bin.tar.lzma',
96+
'automake-4-1-mingw32-bin.tar.lzma',
97+
'libexpat-2.0.1-1-mingw32-dll-1.tar.gz',
98+
'libtool-2.4-1-mingw32-bin.tar.lzma',
99+
'bsdtar-2.8.3-1-mingw32-bin.tar.bz2',
100+
'bsdcpio-2.8.3-1-mingw32-bin.tar.bz2',
101+
'libarchive-2.8.3-1-mingw32-dll-2.tar.bz2',
102+
'libbz2-1.0.5-2-mingw32-dll-2.tar.gz',
103+
'liblzma-4.999.9beta_20100401-1-mingw32-dll-1.tar.bz2',
104+
'libz-1.2.3-1-mingw32-dll-1.tar.gz'
105+
],
106+
:url_3 => [
107+
'which-2.20-bin.zip'
108+
],
109+
}
110+
)
111+
112+
COMPILERS['mingw64-64-5.3.0'] =
113+
OpenStruct.new(
114+
:version => 'mingw64-64-5.3.0',
115+
:programs => [ :gcc, :cpp, :'g++' ],
116+
:program_prefix => nil,
117+
:url_1 => 'http://downloads.sourceforge.net/mingw-w64',
118+
:url_2 => 'http://downloads.sourceforge.net/mingw',
119+
:url_3 => 'http://downloads.sourceforge.net/gnuwin32',
120+
:target => 'sandbox/devkit/mingw',
121+
:relocate => 'sandbox/devkit/mingw/mingw64',
122+
:host => 'x86_64-w64-mingw32',
123+
:knap_path => '530-win32-seh',
124+
:files => {
125+
:url_1 => [
126+
'x86_64-5.3.0-release-win32-seh-rt_v4-rev0.7z'
127+
],
128+
:url_2 => [
129+
'autoconf2.1-2.13-4-mingw32-bin.tar.lzma',
130+
'autoconf2.5-2.68-1-mingw32-bin.tar.lzma',
131+
'autoconf-10-1-mingw32-bin.tar.lzma',
132+
'automake1.11-1.11.1-1-mingw32-bin.tar.lzma',
133+
'automake-4-1-mingw32-bin.tar.lzma',
134+
'libexpat-2.0.1-1-mingw32-dll-1.tar.gz',
135+
'libtool-2.4-1-mingw32-bin.tar.lzma',
136+
'bsdtar-2.8.3-1-mingw32-bin.tar.bz2',
137+
'bsdcpio-2.8.3-1-mingw32-bin.tar.bz2',
138+
'libarchive-2.8.3-1-mingw32-dll-2.tar.bz2',
139+
'libbz2-1.0.5-2-mingw32-dll-2.tar.gz',
140+
'liblzma-4.999.9beta_20100401-1-mingw32-dll-1.tar.bz2',
141+
'libz-1.2.3-1-mingw32-dll-1.tar.gz'
142+
],
143+
:url_3 => [
144+
'which-2.20-bin.zip'
145+
],
146+
}
147+
)
148+
3149
COMPILERS['mingw64-32-4.7.2'] =
4150
OpenStruct.new(
5151
:version => 'mingw64-32-4.7.2',

config/ruby_installer.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ module RubyInstaller
55
# Root folder
66
ROOT = File.expand_path(File.join(File.dirname(__FILE__), ".."))
77

8+
# Downloads folder
9+
DOWNLOADS = ENV['DOWNLOADS'] || "downloads"
10+
811
# Console based utilities
912
SEVEN_ZIP = File.expand_path(File.join(ROOT, 'sandbox', 'extract_utils', '7za.exe'))
1013
BSD_TAR = File.expand_path(File.join(ROOT, 'sandbox', 'extract_utils', 'basic-bsdtar.exe'))

recipes/certificate.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace :certificate do
22
cert = RubyInstaller::Certificate
33

44
source = "#{cert.url}/#{cert.file}"
5-
target = "downloads/#{cert.file}"
5+
target = "#{RubyInstaller::DOWNLOADS}/#{cert.file}"
66

77
download target => source
88
task :download => target

recipes/common.rake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ require 'rake/clean'
33

44
# default cleanup
55
CLOBBER.include("sandbox")
6-
CLOBBER.include("downloads")
6+
CLOBBER.include(RubyInstaller::DOWNLOADS)
77

88
# define common tasks
9-
directory "downloads"
9+
directory (RubyInstaller::DOWNLOADS)
1010
directory "sandbox"

recipes/dependencies/knapsack.rake

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,33 @@ dependencies.each do |dependency_key, dependency|
1313

1414
if compiler.host =~ /x86_64/
1515
files = dependency.x64_files
16+
if compiler.knap_path
17+
files_url = "#{dependency.url}/#{compiler.knap_path}/x64"
18+
else
1619
files_url = "#{dependency.url}/x64"
20+
end
1721
else
1822
files = dependency.files
23+
if compiler.knap_path
24+
files_url = "#{dependency.url}/#{compiler.knap_path}/x86"
25+
else
1926
files_url = "#{dependency.url}/x86"
2027
end
28+
end
29+
30+
download_path = RubyInstaller::DOWNLOADS
31+
if compiler.knap_path
32+
download_path = "#{download_path}/#{compiler.knap_path}"
33+
end
2134

2235
files.each do |f|
2336
file_source = "#{files_url}/#{f}"
24-
file_target = "downloads/#{f}"
37+
file_target = "#{download_path}/#{f}"
2538
download file_target => file_source
2639

2740
# depend on downloads directory
28-
file file_target => "downloads"
41+
file file_target => "#{download_path}"
42+
directory "#{download_path}"
2943

3044
# download task need these files as pre-requisites
3145
dt.enhance [file_target]
@@ -35,7 +49,7 @@ dependencies.each do |dependency_key, dependency|
3549
# Prepare the :sandbox, it requires the :download task
3650
et = checkpoint(dependency_key, :extract) do
3751
dt.prerequisites.each { |f|
38-
extract(File.join(RubyInstaller::ROOT, f), dependency.target)
52+
extract(f, dependency.target)
3953
}
4054
end
4155
task :extract => [:extract_utils, :download, dependency.target, et]

recipes/dependencies/rbreadline.rake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ namespace(:dependencies) do
1010
# Put files for the :download task
1111
package.files.each do |f|
1212
file_source = "#{package.url}/#{f}"
13-
file_target = "downloads/#{f}"
13+
file_target = "#{RubyInstaller::DOWNLOADS}/#{f}"
1414
download file_target => file_source
1515

1616
# depend on downloads directory
17-
file file_target => "downloads"
17+
file file_target => RubyInstaller::DOWNLOADS
1818

1919
# download task need these files as pre-requisites
2020
task :download => file_target
@@ -26,7 +26,7 @@ namespace(:dependencies) do
2626
files = Rake::Task['dependencies:rbreadline:download'].prerequisites
2727

2828
files.each { |f|
29-
extract(File.join(RubyInstaller::ROOT, f), package.target)
29+
extract(f, package.target)
3030
}
3131
end
3232

recipes/devkit/mingw.rake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ namespace(:devkit) do
1414
v.each do |f|
1515
#TODO handle exception when no corresponding URL defined on package
1616
file_source = "#{package.send(k)}/#{f}"
17-
file_target = "downloads/#{f}"
17+
file_target = "#{RubyInstaller::DOWNLOADS}/#{f}"
1818
download file_target => file_source
1919

2020
# depend on downloads directory
21-
file file_target => "downloads"
21+
file file_target => RubyInstaller::DOWNLOADS
2222

2323
# download task needs the packages files as pre-requisites
2424
dt.enhance [file_target]
@@ -31,7 +31,7 @@ namespace(:devkit) do
3131
et = checkpoint(:mingw, :extract) do
3232
dt.prerequisites.each do |f|
3333
fail "[FAIL] corrupt '#{f}' archive" unless seven_zip_valid?(f)
34-
extract(File.join(RubyInstaller::ROOT, f), package.target)
34+
extract(f, package.target)
3535
end
3636
end
3737
task :extract => [:extract_utils, :download, package.target, et]

recipes/devkit/msys.rake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ namespace(:devkit) do
1212
v.each do |f|
1313
#TODO handle exception when no corresponding URL defined on package
1414
file_source = "#{package.send(k)}/#{f}"
15-
file_target = "downloads/#{f}"
15+
file_target = "#{RubyInstaller::DOWNLOADS}/#{f}"
1616
download file_target => file_source
1717

1818
# depend on downloads directory
19-
file file_target => "downloads"
19+
file file_target => RubyInstaller::DOWNLOADS
2020

2121
# download task needs the packages files as pre-requisites
2222
dt.enhance [file_target]
@@ -29,7 +29,7 @@ namespace(:devkit) do
2929
et = checkpoint(:msys, :extract) do
3030
dt.prerequisites.each do |f|
3131
fail "[FAIL] corrupt '#{f}' archive" unless seven_zip_valid?(f)
32-
extract(File.join(RubyInstaller::ROOT, f), package.target)
32+
extract(f, package.target)
3333
end
3434
end
3535
task :extract => [:extract_utils, :download, package.target, et]

recipes/extract_utils/extract_utils.rake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ namespace(:extract_utils) do
1010
v.each do |f|
1111
#TODO handle exception when no corresponding URL defined on package
1212
file_source = "#{package.send(k)}/#{f}"
13-
file_target = "downloads/#{f}"
13+
file_target = "#{RubyInstaller::DOWNLOADS}/#{f}"
1414
download file_target => file_source
1515

1616
# depend on downloads directory
17-
file file_target => "downloads"
17+
file file_target => RubyInstaller::DOWNLOADS
1818

1919
# download task need these files as pre-requisites
2020
task :download => file_target
@@ -35,13 +35,13 @@ namespace(:extract_utils) do
3535
fail 'Only one .msi allowed for RubyInstaller::ExtractUtils.files' if msis.length != 1
3636

3737
zips.each do |f|
38-
filename = "downloads/#{f}"
38+
filename = "#{RubyInstaller::DOWNLOADS}/#{f}"
3939
Zip.fake_unzip(filename, /\.exe|\.dll$/, package.target)
4040
end
4141

4242
# assume 7za.exe can extract individual files from MSI's
4343
unless File.exist?("#{package.target}/7z.sfx")
44-
msi = "downloads/#{msis.first}"
44+
msi = "#{RubyInstaller::DOWNLOADS}/#{msis.first}"
4545
seven_zip_get(msi, '_7z.sfx', package.target)
4646
File.rename("#{package.target}/_7z.sfx", "#{package.target}/7z.sfx")
4747
end

recipes/interpreter/rubies.rake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ interpreters.each do |package|
1818
# Put files for the :download task
1919
package.files.each do |f|
2020
file_source = "#{package.url}/#{f}"
21-
file_target = "downloads/#{f}"
21+
file_target = "#{RubyInstaller::DOWNLOADS}/#{f}"
2222
download file_target => file_source
2323

2424
# depend on downloads directory
25-
file file_target => "downloads"
25+
file file_target => RubyInstaller::DOWNLOADS
2626

2727
# download task need these files as pre-requisites
2828
task :download => file_target
2929
end
3030

31-
task :checkout => "downloads" do
31+
task :checkout => RubyInstaller::DOWNLOADS do
3232
cd RubyInstaller::ROOT do
3333
# If is there already a checkout, update instead of checkout"
3434
if File.exist?(File.join(RubyInstaller::ROOT, package.checkout_target, '.svn'))
@@ -67,7 +67,7 @@ interpreters.each do |package|
6767
mkdir_p package.target
6868

6969
files.each { |f|
70-
extract(File.join(RubyInstaller::ROOT, f), package.target)
70+
extract(f, package.target)
7171
}
7272
end
7373
end

0 commit comments

Comments
 (0)