Class: LIBUSB::LibusbRecipe

Inherits:
MiniPortile
  • Object
show all
Defined in:
lib/libusb/libusb_recipe.rb

Constant Summary collapse

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

Instance Method Summary collapse

Constructor Details

#initializeLibusbRecipe

Returns a new instance of LibusbRecipe.



11
12
13
14
15
16
17
# File 'lib/libusb/libusb_recipe.rb', line 11

def initialize
  super("libusb", LIBUSB_VERSION)
  self.target = File.join(ROOT, "ports")
  self.files = [url: LIBUSB_SOURCE_URI, sha256: LIBUSB_SOURCE_SHA256]
  self.patch_files = Dir[File.join(ROOT, "patches", self.name, self.version, "*.patch")].sort
  self.configure_options = []
end

Instance Method Details

#cook_and_activateObject



19
20
21
22
23
24
25
26
27
# File 'lib/libusb/libusb_recipe.rb', line 19

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