Sha256: 8543dfa2dcfe4920b0bfe554f3aba1619a439a6002447eed0002b37d3dfc03f6

Contents?: true

Size: 1.92 KB

Versions: 20

Compression:

Stored size: 1.92 KB

Contents

=begin
extconf.rb for Ruby/GdkPixbuf2 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 = "gdk_pixbuf2"
package_id = "gdk-pixbuf-2.0"

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

["glib2"].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

setup_win32(module_name, base_dir)

unless required_pkg_config_package(package_id,
                                   :debian => "libgdk-pixbuf2.0-dev",
                                   :redhat => "gtk2-devel",
                                   :fedora => "gdk-pixbuf2-devel",
                                   :homebrew => "gdk-pixbuf",
                                   :macports => "gdk-pixbuf2")
  exit(false)
end

have_func("gdk_pixbuf_set_option", "gdk-pixbuf/gdk-pixbuf.h") do |src|
  "#define GDK_PIXBUF_ENABLE_BACKEND\n#{src}"
end
have_header("gdk-pixbuf/gdk-pixbuf-io.h")

create_pkg_config_file("Ruby/GdkPixbuf2", package_id, nil, "ruby-gdk-pixbuf2.pc")
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

20 entries across 20 versions & 1 rubygems

Version Path
gdk_pixbuf2-1.2.3 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.2.3-x86-mingw32 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.2.2-x86-mingw32 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.2.2 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.2.1-x86-mingw32 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.2.1 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.2.0-x86-mingw32 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.2.0 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.1.9-x86-mingw32 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.1.9 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.1.8-x86-mingw32 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.1.8 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.1.7 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.1.7-x86-mingw32 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.1.6-x86-mingw32 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.1.6 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.1.5-x86-mingw32 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.1.5 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.1.4-x86-mingw32 ext/gdk_pixbuf2/extconf.rb
gdk_pixbuf2-1.1.4 ext/gdk_pixbuf2/extconf.rb