Sha256: 7316f05f44178d7f4e183f747f9dd4e1a35692565004f27dbc44d370630bb77c

Contents?: true

Size: 1.24 KB

Versions: 3

Compression:

Stored size: 1.24 KB

Contents

# frozen_string_literal: true

require 'pkg-config'
require 'xezat'

module Xezat
  module Command
    class Validate
      def validate_pkgconfig(variables, gcc_version)
        pkgconfig_path = File.join(variables[:D], 'usr', 'lib', 'pkgconfig')
        PKGConfig.add_path(pkgconfig_path)
        Dir.glob('*.pc', 0, base: pkgconfig_path).each do |pc|
          Xezat.logger.debug("    #{pc} found")
          basename = File.basename(pc, '.pc')

          modversion = PKGConfig.modversion(basename)
          Xezat.logger.debug("      modversion = #{modversion}")
          pv = variables[:PV][0].gsub(/\+.+$/, '')
          Xezat.logger.error("        modversion differs from $PN = #{pv}") unless modversion == pv

          prefix = PKGConfig.variable(basename, 'prefix')
          if prefix.nil? || prefix.empty? || prefix.eql?('/usr')
            Xezat.logger.debug("      prefix = #{prefix}")
          else
            Xezat.logger.warn("       prefix = #{prefix} (not standard)")
          end

          Xezat.logger.debug("      cflags = #{PKGConfig.cflags(basename)}")

          libs = PKGConfig.libs(basename)
          Xezat.logger.debug("      libs = #{libs}")
          validate_libs(variables, libs, gcc_version)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xezat-0.3.1 lib/xezat/command/validate/pkgconfig.rb
xezat-0.3.0 lib/xezat/command/validate/pkgconfig.rb
xezat-0.2.3 lib/xezat/command/validate/pkgconfig.rb