### Home Classes Methods

### In Files

- lib/pkg-config.rb

### Parent

Object

### Methods

- ::clear_configure_args_cache
- ::custom_override_variables
- ::native_pkg_config
- ::new
- #cflags
- #cflags_only_I
- #declaration
- #description
- #exist?
- #libs
- #libs_only_L
- #pc_path
- #requires
- #requires_private
- #variable
- #version

### Class/Module Index

Quicksearch

- PKGConfig
- PackageConfig

No matching classes.

# PackageConfig

### Constants

IDENTIFIER_RE
SEPARATOR

### Attributes

msvc_syntax[RW]
paths[R]

### Public Class Methods

clear_configure_args_cache() click to toggle source

    # File lib/pkg-config.rb, line 43
    def clear_configure_args_cache
      @native_pkg_config = nil
      @custom_override_variables = nil
    end

custom_override_variables() click to toggle source

    # File lib/pkg-config.rb, line 39
    def custom_override_variables
      @custom_override_variables ||= with_config("override-variables", "")
    end

native_pkg_config() click to toggle source

    # File lib/pkg-config.rb, line 34
    def native_pkg_config
      @native_pkg_config ||= guess_native_pkg_config
    end

new(name, options={}) click to toggle source

    # File lib/pkg-config.rb, line 110
    def initialize(name, options={})
      @name = name
      @options = options
      path = @options[:path] || ENV["PKG_CONFIG_PATH"]
      @paths = [path, guess_default_path].compact.join(SEPARATOR).split(SEPARATOR)
      @paths.unshift(*(@options[:paths] || []))
      @paths = normalize_paths(@paths)
      @msvc_syntax = @options[:msvc_syntax]
      @variables = @declarations = nil
      override_variables = self.class.custom_override_variables
      @override_variables = parse_override_variables(override_variables)
      default_override_variables = @options[:override_variables] || {}
      @override_variables = default_override_variables.merge(@override_variables)
    end

### Public Instance Methods

cflags() click to toggle source

    # File lib/pkg-config.rb, line 137
    def cflags
      path_flags, other_flags = collect_cflags
      (other_flags + path_flags).join(" ")
    end

cflags_only_I() click to toggle source

    # File lib/pkg-config.rb, line 142
    def cflags_only_I
      collect_cflags[0].join(" ")
    end

declaration(name) click to toggle source

    # File lib/pkg-config.rb, line 184
    def declaration(name)
      parse_pc if @declarations.nil?
      expand_value(@declarations[name])
    end

description() click to toggle source

    # File lib/pkg-config.rb, line 175
    def description
      declaration("Description")
    end

exist?() click to toggle source

    # File lib/pkg-config.rb, line 125
    def exist?
      not pc_path.nil?
    end

libs() click to toggle source

    # File lib/pkg-config.rb, line 146
    def libs
      path_flags, other_flags = collect_libs
      (path_flags + other_flags).join(" ")
    end

libs_only_L() click to toggle source

    # File lib/pkg-config.rb, line 161
    def libs_only_L
      collect_libs[0].find_all do |arg|
        if @msvc_syntax
          /\A\/libpath:/ =~ arg
        else
          /\A-L/ =~ arg
        end
      end.join(" ")
    end

libs_only_l() click to toggle source

    # File lib/pkg-config.rb, line 151
    def libs_only_l
      collect_libs[1].find_all do |arg|
        if @msvc_syntax
          /\.lib\z/ =~ arg
        else
          /\A-l/ =~ arg
        end
      end.join(" ")
    end

pc_path() click to toggle source

    # File lib/pkg-config.rb, line 189
    def pc_path
      @paths.each do |path|
        _pc_path = File.join(path, "#{@name}.pc")
        return _pc_path if File.exist?(_pc_path)
      end
      nil
    end

requires() click to toggle source

    # File lib/pkg-config.rb, line 129
    def requires
      parse_requires(declaration("Requires"))
    end

requires_private() click to toggle source

    # File lib/pkg-config.rb, line 133
    def requires_private
      parse_requires(declaration("Requires.private"))
    end

variable(name) click to toggle source

    # File lib/pkg-config.rb, line 179
    def variable(name)
      parse_pc if @variables.nil?
      expand_value(@override_variables[name] || @variables[name])
    end

version() click to toggle source

    # File lib/pkg-config.rb, line 171
    def version
      declaration("Version")
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.