Class: Gears::APNGAsm

Inherits:
Gear
  • Object
show all
Defined in:
lib/gears/apngasm.rb

Instance Attribute Summary

Attributes inherited from Gear

#build_path, #built, #checked, #headers, #installed, #libs, #obtained

Instance Method Summary collapse

Methods inherited from Gear

#disengage, #engage, #gear_exec, #gear_exec_mac, #git_obtain, #github_obtain, #initialize, initialized?, install_path, #name, #remove, #std_config_make, #std_make_install, #target, #uninstall

Constructor Details

This class inherits a constructor from Gear

Instance Method Details

#buildObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/gears/apngasm.rb', line 26

def build()
  puts 'Engaging APNGAsm dependencies'
  cm = Gears::CMake.new
  cm_run = Thread.new { cm.engage }
  boost = Gears::Boost.new
  boost_run = Thread.new { boost.engage }
  cm_run.join
  boost_run.join

  puts "Building APNGAsm in #{@build_path}"
  Dir.chdir(@build_path)
  `git checkout swig_interfaces`
  FileUtils.mkdir_p('build') # `mkdir build`
  Dir.chdir('build') # `cd build`
  puts "cmake -DCMAKE_INSTALL_PREFIX=#{@@install_path} .."
  `cmake -DCMAKE_INSTALL_PREFIX=#{@@install_path} ..`
  `make`
  @built = true
  true
end

#checkObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/gears/apngasm.rb', line 10

def check()
  puts 'Checking for APNGAsm libraries'
  if RUBY_PLATFORM.match(/darwin/)
    @checked = gear_exec_mac > 0 ? true : false
  else
    gear_exec 'ldconfig -p | grep libapngasm'
    @checked = $?.exitstatus == 0 ? true : false
  end
  @checked
end

#installObject



47
48
49
50
51
52
53
# File 'lib/gears/apngasm.rb', line 47

def install()
  puts "Installing APNGAsm to #{@@install_path}"
  Dir.chdir(@build_path + '/build')
  `make install`
  @installed = true
  true
end

#obtainObject



21
22
23
24
# File 'lib/gears/apngasm.rb', line 21

def obtain()
  puts 'Obtaining APNGAsm sources'
  github_obtain('apngasm', 'apngasm')
end