summaryrefslogtreecommitdiff
path: root/community/ruby-gtk2/mkmf-gnome2.patch
blob: bf877cf9c8e7179a1d0cfc252c941f95ed413da8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- glib2/lib/mkmf-gnome2.rb.orig	2011-04-12 14:51:53.223390976 +0200
+++ glib2/lib/mkmf-gnome2.rb	2011-04-12 14:52:21.240120725 +0200
@@ -366,20 +366,19 @@
     rescue LoadError
     end
   end
+  return false if rcairo_source_dir.nil? && !(PKGConfig.have_package('cairo') && have_header('rb_cairo.h'))  
 
-  unless rcairo_source_dir.nil?
-    if /mingw|cygwin|mswin32/ =~ RUBY_PLATFORM
-      options = {}
-      build_dir = "tmp/#{RUBY_PLATFORM}/cairo/#{RUBY_VERSION}"
-      if File.exist?(File.join(rcairo_source_dir, build_dir))
-        options[:target_build_dir] = build_dir
-      end
-      add_depend_package("cairo", "ext/cairo", rcairo_source_dir, options)
-      $defs << "-DRUBY_CAIRO_PLATFORM_WIN32"
+  if /mingw|cygwin|mswin32/ =~ RUBY_PLATFORM
+    options = {}
+    build_dir = "tmp/#{RUBY_PLATFORM}/cairo/#{RUBY_VERSION}"
+    if File.exist?(File.join(rcairo_source_dir, build_dir))
+      options[:target_build_dir] = build_dir
     end
-    $CFLAGS += " -I#{rcairo_source_dir}/ext/cairo"
+    add_depend_package("cairo", "ext/cairo", rcairo_source_dir, options)
+    $defs << "-DRUBY_CAIRO_PLATFORM_WIN32"
   end
 
+  $CFLAGS += " -I#{rcairo_source_dir}/ext/cairo"
   PKGConfig.have_package('cairo') and have_header('rb_cairo.h')
 end