build-tool 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,15 @@
1
+ == 0.0.1 2009-06-14
2
+ * Improved example configuration file
3
+ * Checkout the 4.5 version by default. Not trunk.
4
+ * Some bugfixes
5
+ * Make sure the build directory exists, THEN call bootstrap.
6
+ * Show the options for subcommands in the help texts
7
+ * Improvement
8
+ * Add option "remote-branch" for git-svn. Default to master
9
+ * Break out of the program on SIGBREAK. Not only out of the currently
10
+ * build module.
11
+
12
+
1
13
  == 0.0.1 2009-06-04
2
14
 
3
15
  * 1 major enhancement:
data/lib/kde-build.rb CHANGED
@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module KdeBuild
5
- VERSION = '0.0.1'
5
+ VERSION = '0.0.2'
6
6
  end
7
7
 
8
8
  module Kernel
@@ -63,7 +63,7 @@ module BuildTool
63
63
  true # Allow partial command matching
64
64
  )
65
65
  @command.program_name = "kde4svn-build"
66
- @command.program_version = [ 0, 1, 1 ]
66
+ @command.program_version = KdeBuild::VERSION
67
67
  @command.options = CmdParse::OptionParserWrapper.new do |opt|
68
68
  opt.separator "Global Options"
69
69
  opt.on( "--verbose", "Verbose output" ) { |t|
@@ -88,8 +88,8 @@ module BuildTool
88
88
  mc
89
89
  }
90
90
 
91
- @command.add_command( BuildCommand.new, true )
92
- @command.add_command( InfoCommand.new, true )
91
+ @command.add_command( BuildCommand.new )
92
+ @command.add_command( InfoCommand.new )
93
93
 
94
94
  @command.add_command( HelpCommand.new )
95
95
  @command.add_command( VersionCommand.new )
@@ -16,9 +16,11 @@ def available
16
16
  @mapping.keys
17
17
  end
18
18
 
19
+ class UnknownBuildSystemError < Exception; end
20
+
19
21
  def get( name )
20
22
  if !available.include? name
21
- throw :todo
23
+ raise UnknownBuildSystemError, "Buildsystem '#{name}' is not supported"
22
24
  end
23
25
  @mapping[name]
24
26
  end
@@ -37,10 +37,7 @@ module BuildTool
37
37
 
38
38
 
39
39
  def bootstrap_with_autogen
40
- # First check if autogen contains a configure call
41
- puts configuration.class
42
- puts configuration.methods(false).inspect
43
- rc = self.class.execute( "#{source_directory}/autogen.sh #{configuration.autogen_options}", env )
40
+ self.class.execute( "#{source_directory}/autogen.sh #{configuration.autogen_options}", build_directory, env )
44
41
  end
45
42
 
46
43
  def bootstrap_with_bootstrap
@@ -67,15 +64,17 @@ module BuildTool
67
64
  throw :AUTOCONF_FAILED_TO_BOOTSTRAP
68
65
  end
69
66
 
70
- def reconfigure
71
- make "clean"
72
- bootstrap true
67
+ def reconfigure( clean )
68
+ if clean
69
+ return false if make( "clean" ) != 0
70
+ return false if !bootstrap( true ) != 0
71
+ end
73
72
  configure
74
73
  end
75
74
 
76
75
  def configure
77
- bootstrap
78
76
  check_build_directory( true )
77
+ bootstrap
79
78
  opt = options || ""
80
79
  opt += " --prefix=#{prefix}" if prefix
81
80
  rc = self.class.execute( "#{source_directory}/configure #{opt}", build_directory, env )
@@ -83,7 +82,7 @@ module BuildTool
83
82
  end
84
83
 
85
84
  def configured?
86
- File.exist? "#{build_directory}/config.cache"
85
+ File.exist? "#{build_directory}/config.status"
87
86
  end
88
87
 
89
88
  def make( command, wd = build_directory )
@@ -33,7 +33,8 @@ module BuildTool
33
33
  include MJ::Configuration::Configurable
34
34
 
35
35
  option( 'name', "Name" )
36
- option( 'inplace', 'Do not use out of source build' )
36
+ option( 'inplace', 'Do not use out of source build' ).
37
+ default = false
37
38
 
38
39
  end
39
40
 
@@ -48,6 +49,12 @@ module BuildTool
48
49
  @module = mod
49
50
  end
50
51
 
52
+ def info
53
+ puts "Build System: #{name}"
54
+ puts " Out Of Source Build: #{!inplace}"
55
+ puts " Options: #{options}"
56
+ end
57
+
51
58
  def source_directory
52
59
  @module.source_directory
53
60
  end
@@ -34,10 +34,15 @@ module BuildTool
34
34
 
35
35
  # Execute a cmake command in the context of the build directory
36
36
  def cmake( command, wd = build_directory )
37
- ENV['CMAKE_PREFIX_PATH'] = configuration.cmake_prefix_path
37
+ myenv = env
38
+ myenv['CMAKE_PREFIX_PATH'] = cmake_prefix_path
38
39
  self.class.execute "cmake #{command}", wd, env
39
40
  end
40
41
 
42
+ def cmake_prefix_path
43
+ @configuration.cmake_prefix_path
44
+ end
45
+
41
46
  def make( command, wd = build_directory )
42
47
  BuildTool::Make.new.make "#{command}", wd
43
48
  end
@@ -48,8 +53,10 @@ module BuildTool
48
53
  end
49
54
 
50
55
  def reconfigure( clean )
51
- make "clean" if clean
52
- self.class.execute "rm #{build_directory}/CMakeCache.txt" if clean
56
+ if clean
57
+ return false if make( "clean" ) != 0
58
+ end
59
+ return false if self.class.execute( "rm #{build_directory}/CMakeCache.txt" ) != 0
53
60
  configure
54
61
  end
55
62
 
@@ -65,6 +72,11 @@ module BuildTool
65
72
  File.exist? "#{build_directory}/Makefile"
66
73
  end
67
74
 
75
+ def info
76
+ super
77
+ puts " CMAKE_PREFIX_PATH: #{cmake_prefix_path}"
78
+ end
79
+
68
80
  def name
69
81
  "CMake"
70
82
  end
@@ -74,18 +74,20 @@ module BuildTool
74
74
  $log.info("Creating configure.new")
75
75
  return
76
76
  end
77
- confnew = File.new( "#{source_directory}/configure.new", "w" )
78
- conf = File.new( "#{source_directory}/configure", "r" )
79
- conf.each do |line|
80
- confnew.write(
81
- line.
82
- sub("read acceptance", "acceptance=yes").
83
- sub("read commercial", "commercial=o") )
77
+ begin
78
+ confnew = File.new( "#{source_directory}/configure.new", "w" )
79
+ conf = File.new( "#{source_directory}/configure", "r" )
80
+ conf.each do |line|
81
+ confnew.write(
82
+ line.
83
+ sub("read acceptance", "acceptance=yes").
84
+ sub("read commercial", "commercial=o") )
85
+ end
86
+ confnew.chmod( 0744 )
87
+ ensure
88
+ conf.close
89
+ confnew.close
84
90
  end
85
- confnew.chmod( 0744 )
86
- ensure
87
- conf.close
88
- confnew.close
89
91
  end
90
92
 
91
93
  def create_configure_new_if_necessary
@@ -9,11 +9,21 @@ module BuildTool
9
9
 
10
10
 
11
11
  def show_help
12
- puts "#{name}: #{short_desc}"
13
- puts description if description
12
+ puts usage
13
+ puts
14
+ if description
15
+ puts description
16
+ else
17
+ puts short_desc
18
+ end
14
19
  if has_commands?
20
+ puts
15
21
  list_commands
16
22
  end
23
+ if has_arguments=
24
+ puts
25
+ puts options.summarize
26
+ end
17
27
  end
18
28
 
19
29
  def complete( args )
@@ -11,21 +11,25 @@ module BuildTool
11
11
 
12
12
  def initialize
13
13
  super( 'build', false )
14
- self.short_desc = "build [options] [:package|module|path/]..."
15
- self.description = "fetch, rebase, build and install the specified modules."
14
+ self.short_desc = "Build a module."
15
+ self.description = "Fetch, rebase, build and install the specified modules."
16
16
  @update = true
17
17
  @configure = false
18
+ @clean = false
18
19
  @reconfigure = false
19
20
  @install = true
20
21
  @from_scratch = false
21
22
  self.options = CmdParse::OptionParserWrapper.new do |opt|
22
- opt.separator "Global Options"
23
+ opt.separator "Options:"
23
24
  opt.on( "--no-update", "Do not update from the repository" ) { |t|
24
25
  @update = false
25
26
  }
26
- opt.on( "--configure", "Run the configuration step again" ) { |t|
27
+ opt.on( "-c", "--configure", "Run the configuration step again" ) { |t|
27
28
  @configure = true
28
29
  }
30
+ opt.on( "--[no-]clean", "Make clean before building." ) { |t|
31
+ @clean = t
32
+ }
29
33
  opt.on( "--reconfigure", "Remove old configuration then run configuration again" ) { |t|
30
34
  @reconfigure = true
31
35
  }
@@ -89,7 +93,7 @@ module BuildTool
89
93
  end
90
94
 
91
95
  if @reconfigure
92
- mod.reconfigure( true )
96
+ mod.reconfigure( @clean.nil? ? true : @clean )
93
97
 
94
98
  elsif @configure
95
99
  if mod.configured?
@@ -102,8 +106,11 @@ module BuildTool
102
106
  mod.configure
103
107
  end
104
108
 
109
+ mod.build( @install, @clean )
105
110
 
106
- mod.build( @install )
111
+ rescue Interrupt => e
112
+ $log.info("SIGBREAK recieved.")
113
+ return
107
114
 
108
115
  rescue Exception => e
109
116
  $log.info("error: #{e.class}: #{e.message}")
@@ -9,11 +9,21 @@ module BuildTool
9
9
 
10
10
  def initialize
11
11
  super( 'info', false )
12
- self.short_desc = "Information about a module"
13
- self.description = "Retrieve Information aboud modules"
12
+ self.short_desc = "Information about a module."
13
+ self.description = "Retrieve detailed information about module(s)."
14
+ end
15
+
16
+ def usage
17
+ "Usage: #{commandparser.program_name} info [module]..."
14
18
  end
15
19
 
16
20
  def execute( args )
21
+
22
+ if args.length == 0
23
+ show_help
24
+ return
25
+ end
26
+
17
27
  args.each do |modname|
18
28
  mod = ModuleRegistry.get_modules( modname ) do |mod|
19
29
  if mod == nil
@@ -21,16 +31,9 @@ module BuildTool
21
31
  return
22
32
  end
23
33
 
24
- puts "Building: #{modname}"
25
- puts "Repository: #{mod.repository}"
26
- puts "Remote Path: #{mod.remote_path}"
27
- puts "Stage: #{mod.workdir}"
28
- puts "Build Directory: #{mod.build_directory}"
29
- puts "Source Directory: #{mod.source_directory}"
34
+ mod.info
35
+ puts ""
30
36
 
31
- puts "VCS: #{mod.vcs.name}"
32
- puts " #{mod.vcs.configuration.externals}"
33
- puts " checkedout: #{mod.vcs.checkedout?}"
34
37
  end
35
38
  end
36
39
  end
@@ -12,19 +12,26 @@ module MJ;
12
12
 
13
13
  class Option
14
14
 
15
- attr_accessor :name, :attribute, :description
15
+ attr_accessor :name, :attribute, :description, :default
16
16
 
17
17
  def initialize( obj, name, description )
18
18
  @name = name
19
19
  @attribute =self.class.sanitize name
20
20
  @description = description
21
+ @default = nil
21
22
  @one_of = nil
22
23
  @on_read = nil
23
24
  @on_write = nil
24
25
  @required = false
26
+
25
27
  install obj
26
28
  end
27
29
 
30
+ def default=( value )
31
+ @default = value
32
+ self
33
+ end
34
+
28
35
  def self.sanitize( name )
29
36
  name.gsub( /[^a-zA-Z_]/, '_' )
30
37
  end
@@ -35,7 +42,6 @@ module MJ;
35
42
  obj.class_def( attribute ) do
36
43
  opt = self.class.__options__[attribute]
37
44
  value = self.values[attribute]
38
- opt.read(value)
39
45
  end
40
46
 
41
47
  obj.class_def( "#{attribute}=" ) do
@@ -45,6 +51,7 @@ module MJ;
45
51
  if !opt
46
52
  puts self
47
53
  puts self.class.__options__.inspect
54
+ raise Exception, "????"
48
55
  end
49
56
  # First validate the value
50
57
  opt.validate(value)
@@ -111,7 +118,7 @@ module MJ;
111
118
  else
112
119
  puts o.class
113
120
  puts o.inspect
114
- exit( -1 )
121
+ raise Exception, "??????????"
115
122
  end
116
123
  end
117
124
  module_function :flatten_values
@@ -141,18 +148,34 @@ module MJ;
141
148
 
142
149
 
143
150
  def values
144
- @values ||= Hash.new
151
+ return @values if @values
152
+ @values = Hash.new
153
+ self.class.__options__.each_pair do |name, opt|
154
+ @values[name] = opt.default
155
+ end
156
+ @values
145
157
  end
146
158
 
147
159
  def set( key, val )
148
- # puts "Options = #{self.class.options.inspect}"
149
- self.send( "#{Option.sanitize( key )}=", val )
160
+ begin
161
+ # puts "Options = #{self.class.options.inspect}"
162
+ self.send( "#{Option.sanitize( key )}=", val )
163
+ rescue BuildTool::VCS::UnknownVcsError => e
164
+ $log.warn( "Unknown vcs '#{key}' configured for #{self.name}:#{self.class}" )
165
+ raise e
166
+ rescue NameError => e
167
+ $log.warn( "Unknown option #{key} configured for #{self.name}:#{self.class}" )
168
+ raise e
169
+ rescue Exception => e
170
+ $log.warn( "Caught exception #{e.message} for #{self.inspect}:#{self.class} while setting #{key} to #{val.inspect}" )
171
+ raise e
172
+ end
150
173
  end
151
174
 
152
175
  def validate
153
176
  begin
154
177
  self.class.__options__.each_pair do |name, opt|
155
- opt.validate( @values[opt.attribute] )
178
+ opt.validate( self.values[opt.attribute] )
156
179
  end
157
180
  rescue ConfigurationError => e
158
181
  $log.error( "Validation for #{self.class} (#{self.to_s}) failed: #{e}" )
@@ -176,7 +199,7 @@ module MJ;
176
199
  end
177
200
  }
178
201
  else
179
- throw "TODO"
202
+ raise Exception, "FIXME"
180
203
  end
181
204
  self
182
205
  end
@@ -42,9 +42,18 @@ module BuildTool
42
42
  @local_path = @config.local_path || @config.remote_path
43
43
  end
44
44
 
45
- def build( install )
45
+ def build( install, clean = false )
46
46
  $log.info("Compiling")
47
47
  rc = nil
48
+ if clean
49
+ while_logging_to( name, "50_build" ) do
50
+ if build_system.make( "clean" ) != 0
51
+ raise BuildError, "make returned error code #{rc}"
52
+ end
53
+ $log.info( "make clean was successful" )
54
+ end
55
+ end
56
+
48
57
  while_logging_to( name, "50_build" ) do
49
58
  rc =
50
59
  if install
@@ -56,7 +65,7 @@ module BuildTool
56
65
  if rc != 0
57
66
  raise BuildError, "make returned error code #{rc}"
58
67
  end
59
- $log.info( "successfully built" )
68
+ $log.info( "build was successful" )
60
69
  end
61
70
  end
62
71
 
@@ -142,6 +151,21 @@ module BuildTool
142
151
  end
143
152
  end
144
153
 
154
+ def info
155
+ puts "############### Module #{name}"
156
+ puts "Repository: #{remote_path}"
157
+ puts "SSH Key: #{ssh_file}" if ssh_file
158
+ puts "Local Checkout: #{workdir}/#{local_path} #{configured? ? '(EXISTS)' : '' }"
159
+ puts "Build Directory: #{build_directory} #{checkedout? ? '(EXISTS)' : '' }"
160
+ puts "Prefix: #{prefix}"
161
+ puts "Environment:"
162
+ env.each do |var, val|
163
+ puts " %-20s %s" % [ var + ":", val ]
164
+ end if env
165
+ vcs.info
166
+ build_system.info
167
+ end
168
+
145
169
  def ssh_key
146
170
  return @config.ssh_key
147
171
  end
@@ -39,7 +39,7 @@ module BuildTool
39
39
  val = VCS::get(a['name']).config.new
40
40
  val.parse(a)
41
41
  else
42
- throw :todo
42
+ raise Exception, "Don't know how to handle #{val.inspect}"
43
43
  end
44
44
  val
45
45
  }
@@ -62,7 +62,7 @@ module BuildTool
62
62
  val = BuildSystem::get(a['name']).config.new
63
63
  val.parse(a)
64
64
  else
65
- throw :todo
65
+ raise Exception, "FIXME"
66
66
  end
67
67
  val
68
68
  }
@@ -50,6 +50,7 @@ module MJ; module Tools
50
50
  if env
51
51
  env.each do |var, value|
52
52
  oldenv[var] = ENV[var]
53
+ $log.debug "#{var} = #{value}"
53
54
  ENV[var] = value
54
55
  end
55
56
  end
data/lib/kde-build/vcs.rb CHANGED
@@ -16,9 +16,11 @@ def available
16
16
  @mapping.keys
17
17
  end
18
18
 
19
+ class UnknownVcsError < Exception; end
20
+
19
21
  def get( name )
20
22
  if !available.include? name
21
- throw :todo
23
+ raise VcsError, "VCS '#{name}' is not supported"
22
24
  end
23
25
  @mapping[name]
24
26
  end
@@ -35,6 +35,10 @@ module BuildTool; module VCS
35
35
  @path = path
36
36
  end
37
37
 
38
+ def info
39
+ puts "Version Control: #{name}"
40
+ end
41
+
38
42
  # Check if the local checkout exists.
39
43
  #
40
44
  # This method only checks it the local checkout path exists and is
@@ -22,6 +22,7 @@ module BuildTool; module VCS
22
22
  val = Hash[*a]
23
23
  else
24
24
  throw :todo
25
+ raise Exception, "FIXME"
25
26
  end
26
27
  val
27
28
  }
@@ -110,6 +111,11 @@ module BuildTool; module VCS
110
111
  update_externals
111
112
  end
112
113
 
114
+ def info
115
+ super
116
+ puts " Externals: #{configuration.externals.inspect}" if configuration.externals
117
+ end
118
+
113
119
  # Returns Git-SVN
114
120
  def name
115
121
  "Git-SVN"
@@ -18,6 +18,9 @@ module BuildTool; module VCS
18
18
  self.name = "git"
19
19
  end
20
20
 
21
+ option( "remote-branch", "The remote branch to checkout" ).
22
+ default = "master"
23
+
21
24
  end
22
25
 
23
26
 
@@ -37,6 +40,10 @@ module BuildTool; module VCS
37
40
  self.class.execute "git #{command}", wd
38
41
  end
39
42
 
43
+ def remote_branch
44
+ @configuration.remote_branch
45
+ end
46
+
40
47
  def self.config
41
48
  GitConfiguration
42
49
  end
@@ -78,13 +85,31 @@ module BuildTool; module VCS
78
85
  # Create the directory
79
86
  FileUtils.mkdir_p( File.split(path)[0] ) if !$noop
80
87
 
81
- # Init the repository
82
- if !git( "clone #{repository} #{path}", File.split(path)[0] )
83
- raise GitError, "Error while initializing the repo `git clone '#{repository} #{path}'`: #{$?}"
88
+ # Initialize the repository
89
+ if !git( "clone --no-checkout #{repository} #{path}", Pathname.new(path).dirname )
90
+ raise GitError, "Error while initializing the repo `git clone --no-checkout '#{repository} #{path}'`: #{$?}"
91
+ end
92
+
93
+ # Create the local checkout
94
+ if remote_branch != "master"
95
+ if !git( "checkout --track -b #{remote_branch} origin/#{remote_branch}", path )
96
+ raise GitError, "Error while initializing the repo `checkout --track -b '#{remote_branch} origin/#{remote_branch}'`: #{$?}"
97
+ end
98
+ else
99
+ if !git( "checkout #{remote_branch}", path )
100
+ raise GitError, "Error while initializing the repo `git checkout #{remote_branch}'`: #{$?}"
101
+ end
84
102
  end
103
+
104
+
85
105
  fetch()
86
106
  end
87
107
 
108
+ def info
109
+ super
110
+ puts " Remote Branch: #{remote_branch.inspect}"
111
+ end
112
+
88
113
  def rebase
89
114
  return git "rebase origin"
90
115
  end
@@ -31,9 +31,6 @@ module BuildTool; module VCS
31
31
  end
32
32
 
33
33
  def svn( command, wd = path, &block )
34
- puts self.class.inspect
35
- puts self.inspect
36
- puts self.methods(false).inspect
37
34
  self.class.svn command, wd, &block
38
35
  end
39
36
 
data/test.yaml.tmpl CHANGED
@@ -15,21 +15,18 @@
15
15
  # ADAPT THE FOLLOWING LINES TO YOU NEEDS
16
16
  #########################################################################
17
17
 
18
+ #
19
+ ### LOCAL PATH
20
+ #
21
+
18
22
  # qt installation directory
19
- QTDIR = "/opt/qt/master"
23
+ QTDIR = "/opt/qt/master"
20
24
 
21
25
  # kdesupport and 3rd party installation directory
22
26
  EXTRADIR = "/opt/kde/trunk/extra"
23
27
 
24
28
  # kde installation directory
25
- KDEDIR = "/opt/kde/trunk/kde"
26
-
27
- # kde svn server
28
- # KDESVNSERVER = "svn+ssh://<your_username>@svn.kde.org/home"
29
- KDESVNSERVER = "svn://anonsvn.kde.org/home/kde"
30
-
31
- # gitorius server. qt is hosted there ( http://qt.gitorious.org )
32
- GITORIOUS = "git://gitorious.org"
29
+ KDEDIR = "/opt/kde/trunk/kde"
33
30
 
34
31
  # The build directory
35
32
  # <dir>/src/... The checkouts
@@ -37,15 +34,67 @@
37
34
  # <dir>/log/... The logfiles
38
35
  WORK_DIRECTORY = "~/kde/trunk"
39
36
 
40
- # The c++ compile flags to use
37
+ #
38
+ ### REPOSITORY SERVERS
39
+ #
40
+
41
+ # kde svn server
42
+ # KDESVNSERVER = "svn+ssh://<your_username>@svn.kde.org/home"
43
+ KDESVNSERVER = "svn://anonsvn.kde.org/home"
44
+
45
+ # gitorius server. qt is hosted there ( http://qt.gitorious.org )
46
+ GITORIOUS = "git://gitorious.org"
47
+
48
+ #
49
+ ### COMMON BUILD SETTINGS
50
+ #
51
+
52
+ # Set to the lib suffix used by your distro. Check for /usr/lib(?). Added
53
+ # automatically to CMAKE_OPTION below. AutoConf doesn't need it apparently
54
+ LIB_SUFFIX = "64" # (64|32|"")
55
+
56
+ # The c++ compile flags to use. Added automatically to CMAKE_OPTION and
57
+ # AUTOCONF_OPTIONS below.
41
58
  CXXFLAGS= "-Wall -pipe -O0"
42
59
 
60
+ # Set to "number of cores you processor has" + 1 for optimal performance with modest system load
61
+ MAKE_OPTIONS = "-j2"
62
+
63
+ # The cmake options to use (see http://cmake.org/cmake/documentation.html)
64
+ # CMAKE_OPTIONS="debug" -> Compile with debugging symbols
65
+ # CMAKE_VERBOSE_MAKEFILE -> Print out the executed commands.
66
+ cmake_options = "-DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=DEBUG"
67
+
68
+ # The autoconf options
69
+ autoconf_options = ""
70
+
43
71
  #########################################################################
44
72
  # YOU SHOULDN'T HAVE TO CHANGE THE NEXT LINES
45
73
  #########################################################################
46
74
 
75
+ #
76
+ ### add some additional settings to cmake_options
77
+ #
78
+ if LIB_SUFFIX
79
+ cmake_options += " -DLIB_SUFFIX='#{LIB_SUFFIX}'"
80
+ end
81
+ if CXXFLAGS
82
+ cmake_options += " -DCMAKE_CXX_FLAGS='#{CXXFLAGS}'"
83
+ end
84
+ # Variables in all uppercase are Constants in ruby
85
+ CMAKE_OPTIONS = cmake_options
86
+
87
+ #
88
+ ### add some additional settings to autoconf_options
89
+ #
90
+ if CXXFLAGS
91
+ autoconf_options += " CXXFLAGS='#{CXXFLAGS}'"
92
+ end
93
+ # Variables in all uppercase are Constants in ruby
94
+ AUTOCONF_OPTIONS = autoconf_options
95
+
47
96
  # Provided to kde packages when configuring
48
- KDEDIRS = "#{EXTRADIR}:#{KDEDIR}"
97
+ KDEDIRS = "#{EXTRADIR}:#{KDEDIR}"
49
98
 
50
99
  %>
51
100
 
@@ -60,7 +109,7 @@
60
109
  ############################
61
110
  - :make: !michael-jansen.biz,2009/MakeConfiguration
62
111
  # executable: "/usr/bin/make"
63
- options: "-j16"
112
+ options: <%= MAKE_OPTIONS %>
64
113
 
65
114
  ############################
66
115
  # CTAGS - <TODO> #
@@ -86,7 +135,7 @@
86
135
  #
87
136
  - :tags: !michael-jansen.biz,2009/Packages
88
137
  - default: kdelibs kdepimlibs kdebase/ kdepim
89
- - plasma: playground/nepomuk-kde kdeplasma-addons playground/plasma-applets
138
+ - plasma: playground/nepomuk-kde kdeplasma-addons playground/plasma-applets/
90
139
  - devel: kdesdk kdev/
91
140
  - graphics: extra/lensfun kdegraphics extragear/graphics/
92
141
  - multimedia: kdemultimedia qtscriptgenerator amarok
@@ -96,6 +145,65 @@
96
145
  - complete: :default
97
146
 
98
147
 
148
+ ############################
149
+ # MODULE DEFINITIONS DOKU #
150
+ ############################
151
+ #
152
+ ### THE BLOCK BELOW IS NOT PART OF THE CONFIGURATION. IT'S ONLY DOCUMENTATION
153
+ #
154
+ <% if false # ERB will remove it %>
155
+ - !michael-jansen.biz,2009/ModuleConfiguration
156
+ # The module name.
157
+ - name: kdesupport/automoc
158
+ # Some example constants
159
+ - *env
160
+ - *sshkey
161
+ # The repository to fetch from.
162
+ - repository: <%= KDESVNSERVER %>/kde/trunk
163
+ # The remote directory for fetch from relative to repository
164
+ - remote-path: kdesupport/automoc
165
+ # The installation directory
166
+ - prefix: <%= EXTRADIR %>
167
+ # The ssh key needed to talk to the repository (optional). Will be
168
+ # loaded with ssh-add if necessary. Make sure ssh-agent is running
169
+ - ssh-file: ~/.ssh/id_dsa
170
+ - ssh-key: "1024 aa:8b:12:f4:67:8d:c4:6d:4d:d3:1d:cc:15:ee:ce:e8"
171
+ # Whatever environment variables should be set before the configuration
172
+ # script is run.
173
+ - env:
174
+ - PATH: <%= "#{QTDIR}:#{KDEDIRS}".split(":").collect { |d| d+"/bin" }.join(":")%>:/usr/X11R6/bin:/usr/bin:/bin
175
+ - KDEDIRS: <%= KDEDIRS %>
176
+ # The version controls system to use. Currently svn, git and git-svn are
177
+ # supported
178
+ - vcs: (git|svn|git-svn)
179
+ # It's also possible to specify some more options to the vcs system.
180
+ - vcs
181
+ # The build system to use
182
+ - name: git-svn
183
+ # Branch to checkout (GIT)
184
+ - remote-branch: 4.5
185
+ # Fetch some externals (GIT-SVN)
186
+ - externals:
187
+ - kget/transfer-plugins/bittorrent/libbtcore: <%= KDESVNSERVER %>/kde/branches/stable/extragear-kde4/network/ktorrent/libbtcore
188
+ # The build system to use. Currently autoconf(partially), cmake, qmake are
189
+ # supported
190
+ - build-system: (cmake|qmake|autoconf)
191
+ # It's also possible to specify some more options to the build system.
192
+ - build-system
193
+ # The build system to use
194
+ - name: cmake
195
+ # Make an in source build (ALL)
196
+ - inplace: true
197
+ # Options to supply to the configuration script (ALL)
198
+ - options: <%= CMAKE_OPTIONS %>
199
+ - options: "--enable-debug"
200
+ # CMAKE_PREFIX_PATH (CMAKE)
201
+ - cmake-prefix-path: /my/local/install
202
+ # Build-tool knows how to use autogen.sh. Supply some options (AUTOCONF)
203
+ - autogen-options: --noconfigure
204
+ <% end %>
205
+
206
+
99
207
 
100
208
  ############################
101
209
  # YAML CONSTANTS #
@@ -125,62 +233,9 @@
125
233
  - prefix: <%= KDEDIR %>
126
234
  - build-system:
127
235
  - name: cmake
128
- - options: "-DCMAKE_BUILD_TYPE=DEBUG -DLIB_SUFFIX=64 -DCMAKE_CXXFLAGS='<%=CXXFLAGS%>'"
236
+ - options: <%= CMAKE_OPTIONS %>
129
237
  - cmake-prefix-path: "<%= QTDIR %>:<%= KDEDIRS %>:<%= EXTRADIR %>"
130
238
 
131
- ############################
132
- # MODULE DEFINITIONS #
133
- ############################
134
- # - !michael-jansen.biz,2009/ModuleConfiguration
135
- # # The module name.
136
- # - name: kdesupport/automoc
137
- # # Some example constants
138
- # - *env
139
- # - *sshkey
140
- # # The repository to fetch from.
141
- # - repository: <%= KDESVNSERVER %>/kde/trunk
142
- # # The remote directory for fetch from relative to repository
143
- # - remote-path: kdesupport/automoc
144
- # # The installation directory
145
- # - prefix: <%= EXTRADIR %>
146
- # # The ssh key needed to talk to the repository (optional). Will be
147
- # # loaded with ssh-add if necessary. Make sure ssh-agent is running
148
- # - ssh-file: ~/.ssh/id_dsa
149
- # - ssh-key: "1024 aa:8b:12:f4:67:8d:c4:6d:4d:d3:1d:cc:15:ee:ce:e8"
150
- # # Whatever environment variables should be set before the configuration
151
- # # script is run.
152
- # - env:
153
- # - PATH: <%= "#{QTDIR}:#{KDEDIRS}".split(":").collect { |d| d+"/bin" }.join(":")%>:/usr/X11R6/bin:/usr/bin:/bin
154
- # - KDEDIRS: <%= KDEDIRS %>
155
- # # The version controls system to use. Currently svn, git and git-svn are
156
- # # supported
157
- # - vcs: (git|svn|git-svn)
158
- # # It's also possible to specify some more options to the vcs system.
159
- # - vcs
160
- # # The build system to use
161
- # - name: git-svn
162
- # # Fetch some externals
163
- # - externals:
164
- # - kget/transfer-plugins/bittorrent/libbtcore: <%= KDESVNSERVER %>/kde/branches/stable/extragear-kde4/network/ktorrent/libbtcore
165
- # # The build system to use. Currently autoconf(partially), cmake, qmake are
166
- # # supported
167
- # - build-system: (cmake|qmake|autoconf)
168
- # # It's also possible to specify some more options to the build system.
169
- # - build-system
170
- # # The build system to use
171
- # - name: cmake
172
- # # Make an in source build (ALL)
173
- # - inplace: true
174
- # # Options to supply to the configuration script (ALL)
175
- # - options: "-DCMAKE_BUILD_TYPE=DEBUG -DLIB_SUFFIX=64 -DCMAKE_CXXFLAGS='<%=CXXFLAGS%>'"
176
- # - options: "--enable-debug"
177
- # # CMAKE_PREFIX_PATH (CMAKE)
178
- # - cmake-prefix-path: /my/local/install
179
- # # Build-tool knows how to use autogen.sh. Supply some options (AUTOCONF)
180
- # - autogen-options: --noconfigure
181
-
182
-
183
-
184
239
  ############################
185
240
  # KDESUPPORT #
186
241
  ############################
@@ -190,12 +245,12 @@
190
245
  - *env
191
246
  - *sshkey
192
247
  - repository: <%= KDESVNSERVER %>/kde/trunk
193
- - vcs:
194
- - name: git-svn
248
+ - vcs: git-svn
195
249
  - prefix: <%= EXTRADIR %>
196
250
  - build-system:
197
251
  - name: cmake
198
- - options: "-DCMAKE_BUILD_TYPE=DEBUG -DLIB_SUFFIX=64 -DCMAKE_CXXFLAGS='<%=CXXFLAGS%>'"
252
+ - options: <%= CMAKE_OPTIONS %>
253
+ - cmake-prefix-path: "<%= QTDIR %>:<%= EXTRADIR %>"
199
254
  - remote-path: kdesupport/<%= mod %>
200
255
  <% end %>
201
256
 
@@ -206,12 +261,11 @@
206
261
  - name: kdesupport/networkmanager
207
262
  - remote-path: NetworkManager/NetworkManager.git
208
263
  - local-path: kdesupport/networkmanager
209
- - vcs:
210
- - name: git
264
+ - vcs: git
211
265
  - prefix: <%= EXTRADIR %>
212
266
  - build-system:
213
267
  - name: autoconf
214
- - options: "CXXFLAGS=-g"
268
+ - options: "<%= AUTOCONF_OPTIONS %>"
215
269
  - inplace: true
216
270
  - autogen-options: -test
217
271
 
@@ -225,7 +279,11 @@
225
279
  - local-path: qtmaster
226
280
  - remote-path: qt/qt.git
227
281
  - repository: <%= GITORIOUS %>
228
- - vcs: git
282
+ - vcs:
283
+ - name: git
284
+ # Checkout qt's 4.5 branch. master points to the work in progress
285
+ # version 4.6
286
+ - remote-branch: 4.5
229
287
  - build-system:
230
288
  - name: qtcopy
231
289
  # -qt-gif ............ Compile the plugin for GIF reading support.
@@ -244,11 +302,10 @@
244
302
  - remote-path: kdesupport/qca
245
303
  - local-path: qca
246
304
  - repository: <%= KDESVNSERVER %>/kde/trunk
247
- - vcs:
248
- - name: git-svn
305
+ - vcs: git-svn
249
306
  - build-system:
250
307
  - name: cmake
251
- - options: "-DCMAKE_BUILD_TYPE=DEBUG -DLIB_SUFFIX=64 -DCMAKE_CXXFLAGS='<%=CXXFLAGS%>'"
308
+ - options: <%= CMAKE_OPTIONS %>
252
309
 
253
310
  - !michael-jansen.biz,2009/ModuleConfiguration
254
311
  - *qt
@@ -259,7 +316,7 @@
259
316
  - vcs: git-svn
260
317
  - build-system:
261
318
  - name: cmake
262
- - options: "-DCMAKE_BUILD_TYPE=DEBUG -DLIB_SUFFIX=64 -DCMAKE_CXXFLAGS='<%=CXXFLAGS%>'"
319
+ - options: <%= CMAKE_OPTIONS %>
263
320
 
264
321
  ############################
265
322
  # KDE CORE #
@@ -298,7 +355,6 @@
298
355
  - vcs: git-svn
299
356
  <% end %>
300
357
 
301
-
302
358
  ############################
303
359
  # KDEVELOP #
304
360
  ############################
@@ -315,7 +371,7 @@
315
371
  - prefix: <%= KDEDIR %>
316
372
  - build-system:
317
373
  - name: cmake
318
- - options: "-DCMAKE_BUILD_TYPE=DEBUG -DLIB_SUFFIX=64 -DCMAKE_CXXFLAGS='<%=CXXFLAGS%>'"
374
+ - options: <%= CMAKE_OPTIONS %>
319
375
  - cmake-prefix-path: "<%= QTDIR %>:<%= KDEDIRS %>:<%= EXTRADIR %>"
320
376
  <% end %>
321
377
 
@@ -487,10 +543,10 @@
487
543
  'windowlist',
488
544
  'windows-startmenu' ] %>
489
545
  - !michael-jansen.biz,2009/ModuleConfiguration
490
- - name: playground/plasma-applets-<%= mod %>
546
+ - name: playground/plasma-applets/<%= mod %>
491
547
  - *kde
492
548
  - remote-path: playground/base/plasma/applets/<%= mod %>
493
- - local-path: playground/plasma-applets-<%= mod %>
549
+ - local-path: playground/plasma-applets/<%= mod %>
494
550
  - vcs: git-svn
495
551
  <% end %>
496
552
 
@@ -525,6 +581,7 @@
525
581
  - name: autoconf
526
582
  # Lensfun build system (only autoconf compatibel requires an inplace
527
583
  # build
584
+ - options: "<%= AUTOCONF_OPTIONS %>"
528
585
  - inplace: true
529
586
 
530
587
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Jansen
@@ -30,7 +30,7 @@ cert_chain:
30
30
  M3zOaQdtTmiQPBqNIsE=
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2009-06-10 00:00:00 +02:00
33
+ date: 2009-06-14 00:00:00 +02:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file