Class: BuildRecipe
- Inherits:
-
MiniPortile
- Object
- MiniPortile
- BuildRecipe
- Defined in:
- ext/tiny_tds/extconf.rb
Instance Method Summary collapse
-
#chdir_for_build ⇒ Object
When using rake-compiler-dock on Windows, the underlying Virtualbox shared folders don’t support symlinks, but libiconv expects it for a build on Linux.
- #configure_defaults ⇒ Object
- #consolidated_host(name) ⇒ Object
- #cook_and_activate ⇒ Object
-
#initialize(name, version, files) ⇒ BuildRecipe
constructor
A new instance of BuildRecipe.
-
#installed? ⇒ Boolean
We use the same port_path for all recipes.
-
#port_path ⇒ Object
Use the same path for all recipes, so that only one include/lib path is required.
Constructor Details
#initialize(name, version, files) ⇒ BuildRecipe
Returns a new instance of BuildRecipe.
83 84 85 86 87 88 89 |
# File 'ext/tiny_tds/extconf.rb', line 83 def initialize(name, version, files) super(name, version) self.files = files self.target = File.('../../../ports', __FILE__) self.host = consolidated_host(RbConfig::CONFIG["host"]) self.patch_files = Dir[File.join(self.target, "patches", self.name, self.version, "*.diff")].sort end |
Instance Method Details
#chdir_for_build ⇒ Object
When using rake-compiler-dock on Windows, the underlying Virtualbox shared folders don’t support symlinks, but libiconv expects it for a build on Linux. We work around this limitation by using the temp dir for cooking.
117 118 119 120 121 122 |
# File 'ext/tiny_tds/extconf.rb', line 117 def chdir_for_build build_dir = ENV['RCD_HOST_RUBY_PLATFORM'].to_s =~ /mingw|mswin|cygwin/ ? '/tmp' : '.' Dir.chdir(build_dir) do yield end end |
#configure_defaults ⇒ Object
96 97 98 99 100 101 102 |
# File 'ext/tiny_tds/extconf.rb', line 96 def configure_defaults [ "--host=#{host}", # build for specific target (host) "--disable-static", "--enable-shared", ] end |
#consolidated_host(name) ⇒ Object
91 92 93 94 |
# File 'ext/tiny_tds/extconf.rb', line 91 def consolidated_host(name) # Host name and prefix of build tools are different on Windows 32 bit. name.gsub('i686-pc-mingw32', 'i686-w64-mingw32') end |
#cook_and_activate ⇒ Object
124 125 126 127 128 129 130 131 132 133 134 |
# File 'ext/tiny_tds/extconf.rb', line 124 def cook_and_activate checkpoint = File.join(self.target, "#{self.name}-#{self.version}-#{self.host}.installed") unless File.exist?(checkpoint) chdir_for_build do self.cook end FileUtils.touch checkpoint end self.activate self end |
#installed? ⇒ Boolean
We use the same port_path for all recipes. That breaks the standard installed? method.
110 111 112 |
# File 'ext/tiny_tds/extconf.rb', line 110 def installed? false end |
#port_path ⇒ Object
Use the same path for all recipes, so that only one include/lib path is required.
105 106 107 |
# File 'ext/tiny_tds/extconf.rb', line 105 def port_path "#{target}/#{host}" end |