Class: BuildTool::BuildSystem::QtCopy

Inherits:
Base show all
Defined in:
lib/kde-build/build_system/qtcopy.rb

Instance Attribute Summary

Attributes inherited from Base

#configuration

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#build_directory, #env, #info, #inplace, #prefix, #remove_build_directory, #source_directory

Constructor Details

#initialize(mod) ⇒ QtCopy

Returns a new instance of QtCopy.



26
27
28
# File 'lib/kde-build/build_system/qtcopy.rb', line 26

def initialize( mod )
    super
end

Class Method Details

.configObject



34
35
36
# File 'lib/kde-build/build_system/qtcopy.rb', line 34

def self.config
    QtCopyConfiguration
end

.guess(path) ⇒ Object



30
31
32
# File 'lib/kde-build/build_system/qtcopy.rb', line 30

def self.guess( path )
    return File.exist? "#{path}/qmake/qmake.pro"
end

Instance Method Details

#build(target) ⇒ Object



47
48
49
50
# File 'lib/kde-build/build_system/qtcopy.rb', line 47

def build( target )
    check_build_directory( true )
    make target
end

#configureObject



58
59
60
61
62
63
64
65
# File 'lib/kde-build/build_system/qtcopy.rb', line 58

def configure
    check_build_directory( true )
    create_configure_new_if_necessary
    opt = options
    opt += " --prefix=#{prefix}" if prefix
    rc = self.class.execute( "sh #{self.source_directory}/configure.new #{opt}", wd = build_directory, env )
    rc
end

#configured?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/kde-build/build_system/qtcopy.rb', line 68

def configured?
    return File.exist? "#{build_directory}/bin/qmake"
end

#create_configure_newObject



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/kde-build/build_system/qtcopy.rb', line 72

def create_configure_new
    if $noop
        $log.info("Creating configure.new")
        return
    end
    begin
        confnew = File.new( "#{source_directory}/configure.new", "w" )
        conf    = File.new( "#{source_directory}/configure", "r" )
        conf.each do |line|
            confnew.write(
                line.
                    sub("read acceptance", "acceptance=yes").
                    sub("read commercial", "commercial=o") )
        end
        confnew.chmod( 0744 )
    ensure
        conf.close
        confnew.close
    end
end

#create_configure_new_if_necessaryObject



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/kde-build/build_system/qtcopy.rb', line 93

def create_configure_new_if_necessary
    confnew_name =      "#{source_directory}/configure.new"

    if File.exist? confnew_name
        begin
            confnew = File.new( "#{source_directory}/configure.new", "r" )
            conf    = File.new( "#{source_directory}/configure", "r" )
            if ( confnew.mtime > conf.mtime )
                return
            end
        ensure
            confnew.close
            conf.close
        end
    end
    create_configure_new
end

#make(command = "", wd = build_directory) ⇒ Object



43
44
45
# File 'lib/kde-build/build_system/qtcopy.rb', line 43

def make( command = "", wd = build_directory )
    BuildTool::Make.new.make "#{command}", wd
end

#nameObject



111
112
113
# File 'lib/kde-build/build_system/qtcopy.rb', line 111

def name
    "QtCopy"
end

#optionsObject



115
116
117
# File 'lib/kde-build/build_system/qtcopy.rb', line 115

def options
    @configuration.options
end

#qmake(command, wd = build_directory) ⇒ Object

Execute a qmake command in the context of the build directory



39
40
41
# File 'lib/kde-build/build_system/qtcopy.rb', line 39

def qmake( command, wd = build_directory )
    execute "qmake #{command}", wd, env
end

#reconfigure(clean = false) ⇒ Object



53
54
55
56
# File 'lib/kde-build/build_system/qtcopy.rb', line 53

def reconfigure( clean = false )
    make "confclean" if clean
    configure
end