autobuild 1.1 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
File without changes
@@ -3,6 +3,6 @@ require 'autobuild/reporting'
3
3
  require 'autobuild/package'
4
4
 
5
5
  module Autobuild
6
- VERSION = "1.1" unless defined? Autobuild::VERSION
6
+ VERSION = "1.2" unless defined? Autobuild::VERSION
7
7
  end
8
8
 
@@ -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'])
@@ -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
- Subprocess.run(package.name, :import, Autobuild.tool('git'), 'fetch', repository, "#{branch}:master")
30
- Subprocess.run(package.name, :import, Autobuild.tool('git'), 'checkout', 'master')
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
 
@@ -124,6 +124,7 @@ module Autobuild
124
124
  def provides(*packages)
125
125
  packages.each do |p|
126
126
  p = p.to_s
127
+ next if p == name
127
128
  @@provides[p] = self
128
129
  task p => name
129
130
  task "#{p}-import" => "#{name}-import"
@@ -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
- File.rm_f genomstamp
116
+ FileUtils.rm_f genomstamp
117
117
  end
118
118
  end
119
119
 
@@ -49,7 +49,7 @@ module Autobuild
49
49
  end
50
50
  def source_tree(path, &block)
51
51
  task = SourceTreeTask.define_task(path)
52
- block.call(task)
52
+ block.call(task) unless !block
53
53
  task
54
54
  end
55
55
 
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.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-06-26 00:00:00 +02:00
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.5.3
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.1
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