ext/extconf.rb in ruby-libnotify-0.4.1.1 vs ext/extconf.rb in ruby-libnotify-0.5.0
- old
+ new
@@ -21,49 +21,38 @@
def find_gtk2_rb
(File.exist?("#{Config::CONFIG["sitelibdir"]}/gtk2.rb") ||
File.exist?("#{Config::CONFIG["rubylibdir"]}/gtk2.rb"))
end
-def check_status_icon_gtk2
- if PKGConfig.check_version?("gtk+-2.0", 2, 9, 1) == true
- $CFLAGS << ' -DHAVE_STATUS_ICON'
- puts "with GtkStatusIcon.. yes"
+def check_set_app_name_libnotify
+ if PKGConfig.check_version?("libnotify", 0, 7, 2) == true
+ $CFLAGS << ' -DHAVE_SET_APP_NAME'
+ puts "with set application name.. yes"
else
- puts "with GtkStatusIcon.. no"
+ puts "with set application name.. no"
end
end
-def check_geometry_hints_libnotify
- if PKGConfig.check_version?("libnotify", 0, 4, 1) == true
- $CFLAGS << ' -DHAVE_GEOMETRY_HINTS'
- puts "with geometry hints.. yes"
- else
- puts "with geometry hints.. no"
- end
+def check_required_version(app, maj, min, mic)
+ PKGConfig.check_version?(app, maj, min, mic)
end
-def check_closed_reason_libnotify
- if PKGConfig.check_version?("libnotify", 0, 4, 5) == true
- $CFLAGS << ' -DHAVE_CLOSED_REASON'
- puts "with closed reason.. yes"
+if check_required_version("libnotify", 0, 7, 0) == true
+ if find_gtk2_rb == true
+ if have_library("notify", "notify_init") == true
+ $CFLAGS << ' -DDEBUG' if type == 0
+ $CFLAGS << ' -Wall' << " -I#{Config::CONFIG["sitearchdir"]} " << PKGConfig.cflags("libnotify")
+ $LIBS << ' ' << PKGConfig.libs("libnotify")
+ check_set_app_name_libnotify
+ create_makefile("rnotify")
+ else
+ puts "ERROR: please install libnotify",
+ "[ http://www.galago-project.org/ ]"
+ end
else
- puts "with closed reason.. no"
+ puts "ERROR: no gtk2.rb found, please install Ruby/Gtk2",
+ "[ http://ruby-gnome2.sourceforge.jp/ ]"
end
-end
-
-if find_gtk2_rb == true
- if have_library("notify", "notify_init") == true
- $CFLAGS << ' -DDEBUG' if type == 0
- $CFLAGS << ' -Wall' << " -I#{Config::CONFIG["sitearchdir"]} " << PKGConfig.cflags("libnotify")
- $LIBS << ' ' << PKGConfig.libs("libnotify")
- check_status_icon_gtk2
- check_geometry_hints_libnotify
- check_closed_reason_libnotify
- create_makefile("rnotify")
- else
- puts "ERROR: please install libnotify",
- "[ http://www.galago-project.org/ ]"
- end
else
- puts "ERROR: no gtk2.rb found, please install Ruby/Gtk2",
- "[ http://ruby-gnome2.sourceforge.jp/ ]"
+ puts "libnotify >= 0.7.0 is required in order to use this release."
+ puts "if you have libnotify <= 0.6.0 please install ruby-libnotify < 0.5.0"
end