autobuild 1.1 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Changes.txt +6 -0
- data/bin/autobuild +0 -0
- data/lib/autobuild.rb +1 -1
- data/lib/autobuild/environment.rb +11 -0
- data/lib/autobuild/import/git.rb +15 -2
- data/lib/autobuild/package.rb +1 -0
- data/lib/autobuild/packages/cmake.rb +6 -0
- data/lib/autobuild/packages/genom.rb +1 -1
- data/lib/autobuild/timestamps.rb +1 -1
- metadata +8 -4
data/Changes.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== Version 1.2
|
2
|
+
* Fix git update
|
3
|
+
* Fix cmake dependency handling. Give a way to always run cmake before running
|
4
|
+
make (needed sometime)
|
5
|
+
* Fix the genom package handling
|
6
|
+
|
1
7
|
== Version 1.1
|
2
8
|
* Make the CVS importer discard differences on method and username between the
|
3
9
|
current root and the configured root
|
data/bin/autobuild
CHANGED
File without changes
|
data/lib/autobuild.rb
CHANGED
@@ -2,6 +2,10 @@ module Autobuild
|
|
2
2
|
## Adds an element to a path-like variable
|
3
3
|
def self.pathvar(path, varname)
|
4
4
|
if File.directory?(path)
|
5
|
+
if block_given?
|
6
|
+
return unless yield(path)
|
7
|
+
end
|
8
|
+
|
5
9
|
oldpath = ENV[varname]
|
6
10
|
if oldpath.nil? || oldpath.empty?
|
7
11
|
ENV[varname] = path
|
@@ -17,6 +21,13 @@ module Autobuild
|
|
17
21
|
pathvar("#{newprefix}/bin", 'PATH')
|
18
22
|
pathvar("#{newprefix}/lib/pkgconfig", 'PKG_CONFIG_PATH')
|
19
23
|
pathvar("#{newprefix}/lib/ruby/1.8", 'RUBYLIB')
|
24
|
+
pathvar("#{newprefix}/lib", 'RUBYLIB') do |path|
|
25
|
+
if File.directory?("#{path}/ruby")
|
26
|
+
false
|
27
|
+
else
|
28
|
+
!Dir["#{path}/**/*.rb"].empty?
|
29
|
+
end
|
30
|
+
end
|
20
31
|
|
21
32
|
require 'rbconfig'
|
22
33
|
ruby_arch = File.basename(Config::CONFIG['archdir'])
|
data/lib/autobuild/import/git.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require 'autobuild/subcommand'
|
3
3
|
require 'autobuild/importer'
|
4
|
+
require 'utilrb/module/attr_predicate'
|
4
5
|
|
5
6
|
module Autobuild
|
6
7
|
class Git < Importer
|
@@ -19,6 +20,7 @@ module Autobuild
|
|
19
20
|
|
20
21
|
attr_accessor :repository
|
21
22
|
attr_accessor :branch
|
23
|
+
attr_predicate :merge?
|
22
24
|
|
23
25
|
def update(package)
|
24
26
|
Dir.chdir(package.srcdir) do
|
@@ -26,8 +28,19 @@ module Autobuild
|
|
26
28
|
raise "#{package.srcdir} is not a git repository"
|
27
29
|
end
|
28
30
|
|
29
|
-
|
30
|
-
Subprocess.run(package.name, :import, Autobuild.tool('git'), '
|
31
|
+
# Fetch and merge if the merge leads to a fast-forward
|
32
|
+
Subprocess.run(package.name, :import, Autobuild.tool('git'), 'fetch')
|
33
|
+
common_commit = `git merge-base HEAD FETCH_HEAD`.chomp
|
34
|
+
head_commit = `git rev-parse HEAD`.chomp
|
35
|
+
fetch_commit = `git rev-parse FETCH_HEAD`.chomp
|
36
|
+
|
37
|
+
if common_commit != fetch_commit
|
38
|
+
if merge? || common_commit == head_commit
|
39
|
+
Subprocess.run(package.name, :import, Autobuild.tool('git'), 'merge', 'FETCH_HEAD')
|
40
|
+
else
|
41
|
+
raise "importing the current version would lead to a non fast-forward"
|
42
|
+
end
|
43
|
+
end
|
31
44
|
end
|
32
45
|
end
|
33
46
|
|
data/lib/autobuild/package.rb
CHANGED
@@ -15,7 +15,10 @@ module Autobuild
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
# a key => value association of defines for CMake
|
18
19
|
attr_reader :defines
|
20
|
+
# If true, always run cmake before make during the build
|
21
|
+
attr_accessor :always_reconfigure
|
19
22
|
|
20
23
|
def configurestamp; File.join(builddir, "CMakeCache.txt") end
|
21
24
|
|
@@ -72,6 +75,9 @@ module Autobuild
|
|
72
75
|
# Do the build in builddir
|
73
76
|
def build
|
74
77
|
Dir.chdir(builddir) do
|
78
|
+
if always_reconfigure
|
79
|
+
Subprocess.run(name, 'build', Autobuild.tool(:cmake), '.')
|
80
|
+
end
|
75
81
|
Subprocess.run(name, 'build', Autobuild.tool(:make))
|
76
82
|
end
|
77
83
|
touch_stamp(buildstamp)
|
@@ -113,7 +113,7 @@ module Autobuild
|
|
113
113
|
contents.find { |l| l =~ /^GENFLAGS/ }.gsub('GENFLAGS=', ''))
|
114
114
|
|
115
115
|
if old_file != "#{name}.gen" || !(old_flags - genomflags).empty? || !(genomflags - old_flags).empty?
|
116
|
-
|
116
|
+
FileUtils.rm_f genomstamp
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
data/lib/autobuild/timestamps.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autobuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "1.
|
4
|
+
version: "1.2"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
@@ -9,11 +9,12 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-07-15 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
17
|
+
type: :runtime
|
17
18
|
version_requirement:
|
18
19
|
version_requirements: !ruby/object:Gem::Requirement
|
19
20
|
requirements:
|
@@ -23,6 +24,7 @@ dependencies:
|
|
23
24
|
version:
|
24
25
|
- !ruby/object:Gem::Dependency
|
25
26
|
name: rmail
|
27
|
+
type: :runtime
|
26
28
|
version_requirement:
|
27
29
|
version_requirements: !ruby/object:Gem::Requirement
|
28
30
|
requirements:
|
@@ -32,6 +34,7 @@ dependencies:
|
|
32
34
|
version:
|
33
35
|
- !ruby/object:Gem::Dependency
|
34
36
|
name: daemons
|
37
|
+
type: :runtime
|
35
38
|
version_requirement:
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
@@ -41,12 +44,13 @@ dependencies:
|
|
41
44
|
version:
|
42
45
|
- !ruby/object:Gem::Dependency
|
43
46
|
name: hoe
|
47
|
+
type: :runtime
|
44
48
|
version_requirement:
|
45
49
|
version_requirements: !ruby/object:Gem::Requirement
|
46
50
|
requirements:
|
47
51
|
- - ">="
|
48
52
|
- !ruby/object:Gem::Version
|
49
|
-
version: 1.
|
53
|
+
version: 1.6.0
|
50
54
|
version:
|
51
55
|
description: This work is licensed under the GPLv2 license. See License.txt for details == What's autobuild ? Autobuild imports, configures, builds and installs various kinds of software packages. It can be used in software development to make sure that nothing is broken in the build process of a set of packages, or can be used as an automated installation tool. Autobuild config files are Ruby scripts which configure rake to * imports the package from a SCM or (optionnaly) updates it * configures it. This phase can handle code generation, configuration (for instance for autotools-based packages), ... * build * install It takes the dependencies between packages into account in its build process, updates the needed environment variables (+PKG_CONFIG_PATH+, +PATH+, +LD_LIBRARY_PATH+, ...)
|
52
56
|
email: sylvain.joyeux@m4x.org
|
@@ -118,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
122
|
requirements: []
|
119
123
|
|
120
124
|
rubyforge_project: autobuild
|
121
|
-
rubygems_version: 1.0
|
125
|
+
rubygems_version: 1.2.0
|
122
126
|
signing_key:
|
123
127
|
specification_version: 2
|
124
128
|
summary: Rake-based utility to build and install multiple packages with dependencies
|