Sha256: 81fd7433c9fbc845103d02327738c4e4479239e3b0dda6d1b180b46956c7eba9

Contents?: true

Size: 1.74 KB

Versions: 6

Compression:

Stored size: 1.74 KB

Contents

=begin
extconf.rb for Ruby/Poppler extention library
=end

require 'pathname'

base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path
top_dir = base_dir.parent
top_build_dir = Pathname(".").parent.parent.parent.expand_path

mkmf_gnome2_dir = top_dir + "glib2" + 'lib'
version_suffix = ""
unless mkmf_gnome2_dir.exist?
  if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s
    version_suffix = $1
    mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib'
  end
end

$LOAD_PATH.unshift(mkmf_gnome2_dir.to_s)

module_name = "poppler"
package_id = "poppler-glib"

require 'mkmf-gnome2'

setup_win32(module_name, base_dir)

PKGConfig.have_package(package_id) or exit 1

if PKGConfig.have_package('poppler-cairo')
  options = {}
  rcairo_source_dir_names = ["rcairo"]
  if /mingw|cygwin|mswin32/ =~ RUBY_PLATFORM
    rcairo_source_dir_names.unshift("rcairo.win32")
  end
  rcairo_source_dir_names.each do |rcairo_source_dir_name|
    rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name
    if rcairo_source_dir.exist?
      options[:rcairo_source_dir] = rcairo_source_dir.to_s
      break
    end
  end
  check_cairo(options)
end

["glib2", "gtk2", "gdk_pixbuf2"].each do |package|
  directory = "#{package}#{version_suffix}"
  build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}"
  add_depend_package(package, "#{directory}/ext/#{package}",
                     top_dir.to_s,
                     :top_build_dir => top_build_dir.to_s,
                     :target_build_dir => build_dir)
end

unless have_macro("POPPLER_MAJOR_VERSION", ["poppler.h"])
  make_version_header("POPPLER", package_id, ".")
end

create_pkg_config_file("Ruby/Poppler", package_id)
$defs << " -DRUBY_POPPLER_COMPILATION"
create_makefile(module_name)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
poppler-0.90.4 ext/poppler/extconf.rb
poppler-0.90.4-x86-mingw32 ext/poppler/extconf.rb
poppler-0.90.3 ext/poppler/extconf.rb
poppler-0.90.3-x86-mingw32 ext/poppler/extconf.rb
poppler-0.90.2.3-x86-mingw32 ext/poppler/extconf.rb
poppler-0.90.2.3 ext/poppler/extconf.rb