Sha256: d2ac325cf5e3e65452dd1fb60443e9622c3b74949b8b17fa99a4dc145c48d142

Contents?: true

Size: 1.22 KB

Versions: 14

Compression:

Stored size: 1.22 KB

Contents

# encoding: UTF-8
require 'mini_portile2'
require 'fileutils'
require 'rbconfig'

module Ports
  class Recipe < MiniPortile
    attr_writer :gem_platform

    def cook
      checkpoint = "ports/checkpoints/#{name}-#{version}-#{gem_platform}.installed"

      unless File.exist? checkpoint
        super
        FileUtils.mkdir_p("ports/checkpoints")
        FileUtils.touch checkpoint
      end
    end

    private

    attr_reader :gem_platform

    def port_path
      "#{@target}/#{gem_platform}/#{@name}/#{@version}"
    end

    def tmp_path
      "tmp/#{gem_platform}/ports/#{@name}/#{@version}"
    end

    def configure_defaults
      [
        "--host=#{@host}",
        '--disable-static',
        '--enable-shared'
      ]
    end

    def windows?
      host =~ /mswin|mingw32/
    end

    def system_host
      RbConfig::CONFIG['host']
    end

    def cross_build?
      host != system_host
    end

    def get_patches(libname, version)
      patches = []

      patch_path = File.expand_path(
        File.join('..','..','..','patches',libname,version),
        __FILE__
      )

      patches.concat(Dir[File.join(patch_path, '*.patch')].sort)
      patches.concat(Dir[File.join(patch_path, '*.diff')].sort)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
tiny_tds-3.1.0-x64-mingw-ucrt tasks/ports/recipe.rb
tiny_tds-3.1.0-x64-mingw32 tasks/ports/recipe.rb
tiny_tds-3.1.0 tasks/ports/recipe.rb
tiny_tds-3.0.0-x64-mingw32 tasks/ports/recipe.rb
tiny_tds-3.0.0-x64-mingw-ucrt tasks/ports/recipe.rb
tiny_tds-3.0.0 tasks/ports/recipe.rb
tiny_tds-2.1.7-x64-mingw-ucrt tasks/ports/recipe.rb
tiny_tds-2.1.7-x64-mingw32 tasks/ports/recipe.rb
tiny_tds-2.1.7-x86-mingw32 tasks/ports/recipe.rb
tiny_tds-2.1.7 tasks/ports/recipe.rb
tiny_tds-2.1.6-x86-mingw32 tasks/ports/recipe.rb
tiny_tds-2.1.6-x64-mingw-ucrt tasks/ports/recipe.rb
tiny_tds-2.1.6-x64-mingw32 tasks/ports/recipe.rb
tiny_tds-2.1.6 tasks/ports/recipe.rb