Sha256: 59876ce6a03d0e5a5dd01ae7b57ada8354e607f0fe3b0ec08e6f9778a82dcd89

Contents?: true

Size: 1.95 KB

Versions: 12

Compression:

Stored size: 1.95 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"

begin
  require 'mkmf-gnome2'
rescue LoadError
  require 'rubygems'
  gem 'glib2'
  require 'mkmf-gnome2'
end

["glib2", "atk", "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 check_cairo(:top_dir => top_dir)
  exit(false)
end

setup_windows(module_name, base_dir)

unless required_pkg_config_package([package_id, 0, 12, 0],
                                   :debian => "libpoppler-glib-dev",
                                   :redhat => "poppler-glib-devel",
                                   :arch => "poppler",
                                   :homebrew => "poppler",
                                   :macports => "poppler")
  exit(false)
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)

pkg_config_dir = with_config("pkg-config-dir")
if pkg_config_dir.is_a?(String)
  File.open("Makefile", "ab") do |makefile|
    makefile.puts
    makefile.puts("pkgconfigdir=#{pkg_config_dir}")
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
poppler-3.0.7-x64-mingw32 ext/poppler/extconf.rb
poppler-3.0.7-x86-mingw32 ext/poppler/extconf.rb
poppler-3.0.7 ext/poppler/extconf.rb
poppler-3.0.6-x64-mingw32 ext/poppler/extconf.rb
poppler-3.0.6-x86-mingw32 ext/poppler/extconf.rb
poppler-3.0.6 ext/poppler/extconf.rb
poppler-3.0.5-x64-mingw32 ext/poppler/extconf.rb
poppler-3.0.5-x86-mingw32 ext/poppler/extconf.rb
poppler-3.0.5 ext/poppler/extconf.rb
poppler-3.0.4-x64-mingw32 ext/poppler/extconf.rb
poppler-3.0.4-x86-mingw32 ext/poppler/extconf.rb
poppler-3.0.4 ext/poppler/extconf.rb