mini_portile 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +8 -0
- data/Rakefile +1 -1
- data/examples/Rakefile +1 -0
- data/lib/mini_portile.rb +19 -9
- metadata +4 -4
data/History.txt
CHANGED
data/Rakefile
CHANGED
data/examples/Rakefile
CHANGED
data/lib/mini_portile.rb
CHANGED
@@ -5,7 +5,7 @@ require 'tempfile'
|
|
5
5
|
require 'digest/md5'
|
6
6
|
|
7
7
|
class MiniPortile
|
8
|
-
attr_reader :name, :version
|
8
|
+
attr_reader :name, :version, :original_host
|
9
9
|
attr_writer :configure_options
|
10
10
|
attr_accessor :host, :files, :target, :logger
|
11
11
|
|
@@ -16,7 +16,7 @@ class MiniPortile
|
|
16
16
|
@files = []
|
17
17
|
@logger = STDOUT
|
18
18
|
|
19
|
-
@host = RbConfig::CONFIG['arch']
|
19
|
+
@original_host = @host = RbConfig::CONFIG['arch']
|
20
20
|
end
|
21
21
|
|
22
22
|
def download
|
@@ -94,10 +94,11 @@ class MiniPortile
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def activate
|
97
|
+
lib_path = File.join(port_path, "lib")
|
97
98
|
vars = {
|
98
99
|
'PATH' => File.join(port_path, 'bin'),
|
99
100
|
'CPATH' => File.join(port_path, 'include'),
|
100
|
-
'LIBRARY_PATH' =>
|
101
|
+
'LIBRARY_PATH' => lib_path
|
101
102
|
}.reject { |env, path| !File.directory?(path) }
|
102
103
|
|
103
104
|
output "Activating #{@name} #{@version} (from #{port_path})..."
|
@@ -114,6 +115,17 @@ class MiniPortile
|
|
114
115
|
ENV[var] = "#{full_path}#{File::PATH_SEPARATOR}#{old_value}"
|
115
116
|
end
|
116
117
|
end
|
118
|
+
|
119
|
+
# rely on LDFLAGS when cross-compiling
|
120
|
+
if File.exist?(lib_path) && (@host != @original_host)
|
121
|
+
full_path = File.expand_path(lib_path)
|
122
|
+
|
123
|
+
old_value = ENV.fetch("LDFLAGS", "")
|
124
|
+
|
125
|
+
unless old_value.include?(full_path)
|
126
|
+
ENV["LDFLAGS"] = "-L#{full_path} #{old_value}".strip
|
127
|
+
end
|
128
|
+
end
|
117
129
|
end
|
118
130
|
|
119
131
|
def path
|
@@ -123,21 +135,19 @@ class MiniPortile
|
|
123
135
|
private
|
124
136
|
|
125
137
|
def tmp_path
|
126
|
-
|
138
|
+
"tmp/#{@host}/ports/#{@name}/#{@version}"
|
127
139
|
end
|
128
140
|
|
129
141
|
def port_path
|
130
|
-
|
142
|
+
"#{@target}/#{@host}/#{@name}/#{@version}"
|
131
143
|
end
|
132
144
|
|
133
145
|
def archives_path
|
134
|
-
|
146
|
+
"#{@target}/archives"
|
135
147
|
end
|
136
148
|
|
137
149
|
def work_path
|
138
|
-
|
139
|
-
Dir.glob("#{tmp_path}/*").find { |d| File.directory?(d) }
|
140
|
-
end
|
150
|
+
Dir.glob("#{tmp_path}/*").find { |d| File.directory?(d) }
|
141
151
|
end
|
142
152
|
|
143
153
|
def configure_defaults
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_portile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Luis Lavena
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-04-
|
18
|
+
date: 2011-04-11 00:00:00 -03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|