Class: BuildRecipe

Inherits:
MiniPortile
  • Object
show all
Defined in:
ext/extconf.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, version, files) ⇒ BuildRecipe

Returns a new instance of BuildRecipe.



40
41
42
43
44
45
46
# File 'ext/extconf.rb', line 40

def initialize(name, version, files)
  super(name, version)
  self.files = files
  rootdir = File.expand_path('../..', __FILE__)
  self.target = File.join(rootdir, "ports")
  self.patch_files = Dir[File.join(target, "patches", self.name, self.version, "*.patch")].sort
end

Instance Method Details

#configure_prefixObject

Add “–prefix=/”, to avoid our actual build install path compiled into the binary. Instead use DESTDIR variable of make to set our install path.



54
55
56
# File 'ext/extconf.rb', line 54

def configure_prefix
  "--prefix="
end

#cook_and_activateObject



58
59
60
61
62
63
64
65
66
# File 'ext/extconf.rb', line 58

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

#port_pathObject



48
49
50
# File 'ext/extconf.rb', line 48

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