autobuild 1.5.47 → 1.5.48
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.
- data/Changes.txt +3 -0
- data/lib/autobuild/environment.rb +65 -4
- data/lib/autobuild/version.rb +1 -1
- metadata +4 -4
data/Changes.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require 'set'
|
|
1
2
|
module Autobuild
|
|
2
3
|
@inherited_environment = Hash.new
|
|
3
4
|
@environment = Hash.new
|
|
@@ -67,16 +68,73 @@ module Autobuild
|
|
|
67
68
|
end
|
|
68
69
|
end
|
|
69
70
|
|
|
71
|
+
def self.each_env_search_path(prefix, patterns)
|
|
72
|
+
arch_names = self.arch_names
|
|
73
|
+
arch_size = self.arch_size
|
|
74
|
+
|
|
75
|
+
seen = Set.new
|
|
76
|
+
patterns.each do |base_path|
|
|
77
|
+
paths = []
|
|
78
|
+
if base_path =~ /ARCHSIZE/
|
|
79
|
+
base_path = base_path.gsub('ARCHSIZE', arch_size.to_s)
|
|
80
|
+
end
|
|
81
|
+
if base_path =~ /ARCH/
|
|
82
|
+
arch_names.each do |arch|
|
|
83
|
+
paths << base_path.gsub('ARCH', arch)
|
|
84
|
+
end
|
|
85
|
+
else
|
|
86
|
+
paths << base_path
|
|
87
|
+
end
|
|
88
|
+
paths.each do |p|
|
|
89
|
+
p = File.join(prefix, *p.split('/'))
|
|
90
|
+
if !seen.include?(p) && File.directory?(p)
|
|
91
|
+
yield(p)
|
|
92
|
+
seen << p
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def self.arch_size
|
|
99
|
+
if @arch_size
|
|
100
|
+
return @arch_size
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
@arch_size =
|
|
104
|
+
if RbConfig::CONFIG['host_cpu'] =~ /64/
|
|
105
|
+
64
|
|
106
|
+
else 32
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def self.arch_names
|
|
111
|
+
if @arch_names
|
|
112
|
+
return @arch_names
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
result = Set.new
|
|
116
|
+
if File.file?('/usr/bin/dpkg-architecture')
|
|
117
|
+
arch = `/usr/bin/dpkg-architecture`.split.grep(/DEB_BUILD_MULTIARCH/).first.chomp
|
|
118
|
+
result << arch.split('=').last
|
|
119
|
+
end
|
|
120
|
+
@arch_names = result
|
|
121
|
+
end
|
|
122
|
+
|
|
70
123
|
# Updates the environment when a new prefix has been added
|
|
71
124
|
def self.update_environment(newprefix)
|
|
72
125
|
if File.directory?("#{newprefix}/bin")
|
|
73
126
|
env_add_path('PATH', "#{newprefix}/bin")
|
|
74
127
|
end
|
|
75
|
-
|
|
76
|
-
|
|
128
|
+
|
|
129
|
+
pkg_config_search = ['lib/pkgconfig', 'lib/ARCH/pkgconfig', 'libARCHSIZE/pkgconfig']
|
|
130
|
+
each_env_search_path(newprefix, pkg_config_search) do |path|
|
|
131
|
+
env_add_path('PKG_CONFIG_PATH', path)
|
|
77
132
|
end
|
|
78
|
-
|
|
79
|
-
|
|
133
|
+
ld_library_search = ['lib', 'lib/ARCH', 'libARCHSIZE']
|
|
134
|
+
each_env_search_path(newprefix, pkg_config_search) do |path|
|
|
135
|
+
if !Dir.glob(File.join(path, "lib*.so")).empty?
|
|
136
|
+
env_add_path('LD_LIBRARY_PATH', path)
|
|
137
|
+
end
|
|
80
138
|
end
|
|
81
139
|
|
|
82
140
|
# Validate the new rubylib path
|
|
@@ -98,3 +156,6 @@ module Autobuild
|
|
|
98
156
|
end
|
|
99
157
|
end
|
|
100
158
|
|
|
159
|
+
Autobuild.update_environment '/'
|
|
160
|
+
Autobuild.update_environment '/usr'
|
|
161
|
+
Autobuild.update_environment '/usr/local'
|
data/lib/autobuild/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: autobuild
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 99
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 1
|
|
8
8
|
- 5
|
|
9
|
-
-
|
|
10
|
-
version: 1.5.
|
|
9
|
+
- 48
|
|
10
|
+
version: 1.5.48
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Sylvain Joyeux
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-08-
|
|
18
|
+
date: 2011-08-22 00:00:00 Z
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|
|
21
21
|
name: rake
|