Class: Zint::ZintRecipe

Inherits:
MiniPortileCMake
  • Object
show all
Defined in:
lib/zint/zint_recipe.rb

Constant Summary collapse

ROOT =
File.expand_path("../../..", __FILE__)

Instance Method Summary collapse

Constructor Details

#initialize(name, vers, url, sha1) ⇒ ZintRecipe

Returns a new instance of ZintRecipe.



11
12
13
14
15
# File 'lib/zint/zint_recipe.rb', line 11

def initialize(name, vers, url, sha1)
  super(name, vers)
  self.target = File.join(ROOT, "ports")
  self.files = [url: url, sha1: sha1]
end

Instance Method Details

#cook_and_activateObject



21
22
23
24
25
26
27
28
29
# File 'lib/zint/zint_recipe.rb', line 21

def cook_and_activate
  checkpoint = File.join(target, "#{name}-#{version}-#{RUBY_PLATFORM}.installed")
  unless File.exist?(checkpoint)
    cook
    FileUtils.touch checkpoint
  end
  activate
  self
end

#port_pathObject



17
18
19
# File 'lib/zint/zint_recipe.rb', line 17

def port_path
  "#{target}/#{RUBY_PLATFORM}"
end