autobuild 1.5.43 → 1.5.45
Sign up to get free protection for your applications and to get access to all the features.
- data/Changes.txt +15 -0
- data/lib/autobuild/configurable.rb +0 -3
- data/lib/autobuild/import/archive.rb +3 -1
- data/lib/autobuild/package.rb +2 -0
- data/lib/autobuild/packages/autotools.rb +1 -0
- data/lib/autobuild/packages/cmake.rb +124 -1
- data/lib/autobuild/subcommand.rb +26 -10
- data/lib/autobuild/version.rb +1 -1
- metadata +4 -4
data/Changes.txt
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
== Version 1.5.45
|
2
|
+
* fix zip support in the archive importer (patch from Thomas Roehr)
|
3
|
+
|
4
|
+
== Version 1.5.44
|
5
|
+
* when autodetecting the parallel build level, use the number of physical cores
|
6
|
+
(ignore "logical processors" that are present due to SMT technologies like
|
7
|
+
HyperThreading)
|
8
|
+
* add an experimental feature to make autobuild run doxygen by itself instead of
|
9
|
+
using "make doc" for CMake targets. This will sped up documentation
|
10
|
+
generation in simple cases, as dependencies won't need to be installed before
|
11
|
+
"make doc" can be run. This feature is turned OFF by default, and can be
|
12
|
+
turned ON by doing
|
13
|
+
|
14
|
+
Autobuild::CMake.always_use_doc_target = false
|
15
|
+
|
1
16
|
== Version 1.5.43
|
2
17
|
* cvs: accept the common importer options, such as :patches
|
3
18
|
(Patch from Charles Lesire-Cabaniols)
|
@@ -151,7 +151,9 @@ module Autobuild
|
|
151
151
|
else base_dir
|
152
152
|
end
|
153
153
|
|
154
|
-
cmd = [ '
|
154
|
+
cmd = [ '-o', cachefile, '-d', main_dir ]
|
155
|
+
Subprocess.run(package, :import, Autobuild.tool('unzip'), *cmd)
|
156
|
+
|
155
157
|
if archive_dir
|
156
158
|
FileUtils.rm_rf File.join(package.srcdir)
|
157
159
|
FileUtils.mv File.join(base_dir, archive_dir), package.srcdir
|
data/lib/autobuild/package.rb
CHANGED
@@ -65,12 +65,131 @@ module Autobuild
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
+
DOXYGEN_ACCEPTED_VARIABLES = {
|
69
|
+
'@CMAKE_SOURCE_DIR@' => lambda { |pkg| pkg.srcdir },
|
70
|
+
'@PROJECT_SOURCE_DIR@' => lambda { |pkg| pkg.srcdir },
|
71
|
+
'@CMAKE_BINARY_DIR@' => lambda { |pkg| pkg.builddir },
|
72
|
+
'@PROJECT_BINARY_DIR@' => lambda { |pkg| pkg.builddir },
|
73
|
+
'@PROJECT_NAME@' => lambda { |pkg| pkg.name }
|
74
|
+
}
|
75
|
+
|
76
|
+
class << self
|
77
|
+
# Flag controlling whether autobuild should run doxygen itself or
|
78
|
+
# use the "doc" target generated by CMake
|
79
|
+
#
|
80
|
+
# This is experimental and OFF by default. See CMake#run_doxygen for
|
81
|
+
# more details
|
82
|
+
#
|
83
|
+
# See also CMake#always_use_doc_target= and CMake#always_use_doc_target?
|
84
|
+
# for a per-package control of that feature
|
85
|
+
attr_writer :always_use_doc_target
|
86
|
+
|
87
|
+
# Flag controlling whether autobuild should run doxygen itself or
|
88
|
+
# use the "doc" target generated by CMake
|
89
|
+
#
|
90
|
+
# This is experimental and OFF by default. See CMake#run_doxygen for
|
91
|
+
# more details
|
92
|
+
#
|
93
|
+
# See also CMake#always_use_doc_target= and CMake#always_use_doc_target?
|
94
|
+
# for a per-package control of that feature
|
95
|
+
def always_use_doc_target?
|
96
|
+
@always_use_doc_target
|
97
|
+
end
|
98
|
+
end
|
99
|
+
@always_use_doc_target = true
|
100
|
+
|
101
|
+
# Flag controlling whether autobuild should run doxygen itself or
|
102
|
+
# use the "doc" target generated by CMake
|
103
|
+
#
|
104
|
+
# This is experimental and OFF by default. See CMake#run_doxygen for
|
105
|
+
# more details
|
106
|
+
#
|
107
|
+
# See also CMake.always_use_doc_target= and CMake.always_use_doc_target?
|
108
|
+
# for a global control of that feature
|
109
|
+
attr_reader :always_use_doc_target
|
110
|
+
|
111
|
+
# Flag controlling whether autobuild should run doxygen itself or
|
112
|
+
# use the "doc" target generated by CMake
|
113
|
+
#
|
114
|
+
# This is experimental and OFF by default. See CMake#run_doxygen for
|
115
|
+
# more details
|
116
|
+
#
|
117
|
+
# See also CMake.always_use_doc_target= and CMake.always_use_doc_target?
|
118
|
+
# for a global control of that feature
|
119
|
+
def always_use_doc_target?
|
120
|
+
if @always_use_doc_target.nil?
|
121
|
+
return CMake.always_use_doc_target?
|
122
|
+
else
|
123
|
+
@always_use_doc_target
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# To avoid having to build packages to run the documentation target, we
|
128
|
+
# try to autodetect whether (1) the package is using doxygen and (2)
|
129
|
+
# whether the cmake variables in the doxyfile can be provided by
|
130
|
+
# autobuild itself.
|
131
|
+
#
|
132
|
+
# This can be disabled globally by setting
|
133
|
+
# Autobuild::CMake.always_use_doc_target= or on a per-package basis with
|
134
|
+
# #always_use_doc_target=
|
135
|
+
#
|
136
|
+
# This method returns true if the package can use the internal doxygen
|
137
|
+
# mode and false otherwise
|
138
|
+
def internal_doxygen_mode?
|
139
|
+
if always_use_doc_target?
|
140
|
+
return false
|
141
|
+
end
|
142
|
+
|
143
|
+
doxyfile_in = File.join(srcdir, "Doxyfile.in")
|
144
|
+
if !File.file?(doxyfile_in)
|
145
|
+
puts "NO INTERNAL: #{name}"
|
146
|
+
return false
|
147
|
+
end
|
148
|
+
File.readlines(doxyfile_in).each do |line|
|
149
|
+
matches = line.scan(/@[^@]+@/)
|
150
|
+
if matches.any? { |str| !DOXYGEN_ACCEPTED_VARIABLES.has_key?(str) }
|
151
|
+
return false
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
# To avoid having to build packages to run the documentation target, we
|
157
|
+
# try to autodetect whether (1) the package is using doxygen and (2)
|
158
|
+
# whether the cmake variables in the doxyfile can be provided by
|
159
|
+
# autobuild itself.
|
160
|
+
#
|
161
|
+
# This can be disabled globally by setting
|
162
|
+
# Autobuild::CMake.always_use_doc_target or on a per-package basis with
|
163
|
+
# #always_use_doc_target
|
164
|
+
#
|
165
|
+
# This method generates the corresponding doxygen file in
|
166
|
+
# <builddir>/Doxygen and runs doxygen. It raises if the internal doxygen
|
167
|
+
# support cannot be used on this package
|
168
|
+
def run_doxygen
|
169
|
+
doxyfile_in = File.join(srcdir, "Doxyfile.in")
|
170
|
+
if !File.file?(doxyfile_in)
|
171
|
+
raise RuntimeError, "no Doxyfile.in in this package, cannot use the internal doxygen support"
|
172
|
+
end
|
173
|
+
doxyfile_data = File.readlines(doxyfile_in).map do |line|
|
174
|
+
line.gsub(/@[^@]+@/) { |match| DOXYGEN_ACCEPTED_VARIABLES[match].call(self) }
|
175
|
+
end
|
176
|
+
doxyfile = File.join(builddir, "Doxyfile")
|
177
|
+
File.open(doxyfile, 'w') do |io|
|
178
|
+
io.write(doxyfile_data)
|
179
|
+
end
|
180
|
+
Subprocess.run(self, 'doc', Autobuild.tool(:doxygen), doxyfile)
|
181
|
+
end
|
182
|
+
|
68
183
|
# Declare that the given target can be used to generate documentation
|
69
184
|
def with_doc(target = 'doc')
|
70
185
|
doc_task do
|
71
186
|
Dir.chdir(builddir) do
|
72
187
|
progress "generating documentation for %s"
|
73
|
-
|
188
|
+
if internal_doxygen_mode?
|
189
|
+
run_doxygen
|
190
|
+
else
|
191
|
+
Subprocess.run(self, 'doc', Autobuild.tool(:make), "-j#{parallel_build_level}", target)
|
192
|
+
end
|
74
193
|
yield if block_given?
|
75
194
|
end
|
76
195
|
end
|
@@ -106,6 +225,10 @@ module Autobuild
|
|
106
225
|
end
|
107
226
|
|
108
227
|
def prepare
|
228
|
+
if !internal_doxygen_mode? && has_doc?
|
229
|
+
task "#{name}-doc" => configurestamp
|
230
|
+
end
|
231
|
+
|
109
232
|
# A failed initial CMake configuration leaves a CMakeCache.txt file,
|
110
233
|
# but no Makefile.
|
111
234
|
#
|
data/lib/autobuild/subcommand.rb
CHANGED
@@ -71,16 +71,32 @@ module Autobuild
|
|
71
71
|
return @processor_count
|
72
72
|
end
|
73
73
|
|
74
|
-
if File.file?('/
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
74
|
+
if File.file?('/proc/cpuinfo')
|
75
|
+
cpuinfo = File.readlines('/proc/cpuinfo')
|
76
|
+
physical_ids, core_count, processor_ids = [], [], []
|
77
|
+
cpuinfo.each do |line|
|
78
|
+
case line
|
79
|
+
when /^processor\s+:\s+(\d+)$/
|
80
|
+
processor_ids << Integer($1)
|
81
|
+
when /^physical id\s+:\s+(\d+)$/
|
82
|
+
physical_ids << Integer($1)
|
83
|
+
when /^cpu cores\s+:\s+(\d+)$/
|
84
|
+
core_count << Integer($1)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# Try to count the number of physical cores, not the number of
|
89
|
+
# logical ones. If the info is not available, fallback to the
|
90
|
+
# logical count
|
91
|
+
if (physical_ids.size == core_count.size) && (physical_ids.size == processor_ids.size)
|
92
|
+
info = Array.new
|
93
|
+
while (id = physical_ids.shift)
|
94
|
+
info[id] = core_count.shift
|
95
|
+
end
|
96
|
+
@processor_count = info.inject(&:+)
|
97
|
+
else
|
98
|
+
@processor_count = processor_ids.size
|
99
|
+
end
|
84
100
|
else
|
85
101
|
# Hug... What kind of system is it ?
|
86
102
|
STDERR.puts "INFO: cannot autodetect the number of CPUs on this sytem"
|
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: 89
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 1.5.
|
9
|
+
- 45
|
10
|
+
version: 1.5.45
|
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-12 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rake
|