mini_portile 0.2.1 → 0.2.2

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.
@@ -1,3 +1,11 @@
1
+ === 0.2.2 / 2011-04-11
2
+
3
+ * Minor enhancements:
4
+ * Use LDFLAGS when activating recipes for cross-compilation. Closes #6
5
+
6
+ * Bugfixes:
7
+ * Remove memoization of *_path helpers. Closes #7
8
+
1
9
  === 0.2.1 / 2011-04-06
2
10
 
3
11
  * Minor enhancements:
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require "rubygems/package_task"
4
4
  GEM_SPEC = Gem::Specification.new do |s|
5
5
  # basic information
6
6
  s.name = "mini_portile"
7
- s.version = "0.2.1"
7
+ s.version = "0.2.2"
8
8
  s.platform = Gem::Platform::RUBY
9
9
 
10
10
  # description and details
@@ -43,6 +43,7 @@ namespace :ports do
43
43
  $recipes.each do |_, recipe|
44
44
  puts "Artifacts of '#{recipe.name}' in '#{recipe.path}'"
45
45
  end
46
+ puts "LDFLAGS: " << ENV['LDFLAGS'].inspect
46
47
  end
47
48
  end
48
49
 
@@ -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' => File.join(port_path, 'lib')
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
- @tmp_path ||= "tmp/#{@host}/ports/#{@name}/#{@version}"
138
+ "tmp/#{@host}/ports/#{@name}/#{@version}"
127
139
  end
128
140
 
129
141
  def port_path
130
- @port_path ||= "#{@target}/#{@host}/#{@name}/#{@version}"
142
+ "#{@target}/#{@host}/#{@name}/#{@version}"
131
143
  end
132
144
 
133
145
  def archives_path
134
- @archives_path ||= "#{@target}/archives"
146
+ "#{@target}/archives"
135
147
  end
136
148
 
137
149
  def work_path
138
- @work_path ||= begin
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: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
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-06 00:00:00 -03:00
18
+ date: 2011-04-11 00:00:00 -03:00
19
19
  default_executable:
20
20
  dependencies: []
21
21