# HG changeset patch
# Node ID 8c878ffa6c5b
# Parent  65cf7357277d
diff --git a/doc/reference/libpurple/meson.build b/doc/reference/libpurple/meson.build
--- a/doc/reference/libpurple/meson.build
+++ b/doc/reference/libpurple/meson.build
@@ -31,7 +31,6 @@
 
 # Extra options to supply to gtkdoc-fixxref
 fixxref_args = [
-    '--extra-dir=@0@'.format(gplugin_docpath),
 ]
 
 libpurple_version_xml = configure_file(
diff --git a/doc/reference/pidgin/meson.build b/doc/reference/pidgin/meson.build
--- a/doc/reference/pidgin/meson.build
+++ b/doc/reference/pidgin/meson.build
@@ -26,7 +26,6 @@
 
 # Extra options to supply to fixxref
 fixxref_args = [
-    '--extra-dir=@0@'.format(gplugin_gtk_docpath),
     '--extra-dir=@0@'.format(talkatu_docpath),
     '--extra-dir=../libpurple',
 ]
diff --git a/finch/meson.build b/finch/meson.build
--- a/finch/meson.build
+++ b/finch/meson.build
@@ -234,7 +234,7 @@
 
 		Finch_gir_includes = [
 			libgnt_gir[0],
-			gplugin_gir,
+			'GPlugin-1.0',
 			# subproject needs to be before libpurple in the repo so that
 			# meson will use our variables and not try to discover them from
 			# libpurple.
@@ -250,9 +250,6 @@
 		    export_packages : 'finch',
 		    nsversion : '@0@.@1@'.format(purple_major_version,
 		                                 purple_minor_version),
-		    include_directories : [
-		        gplugin_include_directories,
-		    ],
 		    install : true,
 		    extra_args : ['-DFINCH_COMPILATION', '--quiet'])
 	endif
diff --git a/libpurple/meson.build b/libpurple/meson.build
--- a/libpurple/meson.build
+++ b/libpurple/meson.build
@@ -321,7 +321,7 @@
 	introspection_sources = (purple_coreheaders + purple_builtheaders +
 	                         purple_mediaheaders)
 
-	Purple_gir_includes = ['GObject-2.0', 'Gio-2.0', 'Gst-1.0', gplugin_gir]
+	Purple_gir_includes = ['GObject-2.0', 'Gio-2.0', 'Gst-1.0', 'GPlugin-1.0']
 
 	libpurple_gir = gnome.generate_gir(libpurple,
 	    sources : introspection_sources,
@@ -332,9 +332,7 @@
 	    export_packages : purple_filebase,
 	    nsversion : '@0@.@1@'.format(purple_major_version,
 	                                 purple_minor_version),
-	    include_directories : [
-	        gplugin_include_directories,
-	    ],
+	    dependencies: [ gplugin_dep ],
 	    install : true,
 	    extra_args : ['-DPURPLE_COMPILATION', '--quiet'])
 endif
diff --git a/meson.build b/meson.build
--- a/meson.build
+++ b/meson.build
@@ -570,59 +570,14 @@
 #######################################################################
 # Check for GPlugin
 #######################################################################
-gplugin_dep = dependency('gplugin', version : ['>=0.33.0', '<0.34.0'], required : false)
-if gplugin_dep.found()
-	gplugin_docpath = gplugin_dep.get_pkgconfig_variable('prefix') / 'share/gtk-doc/html'
-
-	if enable_introspection
-		gplugin_gir = 'GPlugin-1.0'
-		gplugin_include_directories = include_directories(
-		    gplugin_dep.get_pkgconfig_variable('prefix') / 'share/gir-1.0')
-	else
-		gplugin_include_directories = []
-	endif
-
-	if get_option('gtkui')
-		gplugin_gtk_dep = dependency('gplugin-gtk', required : true)
+gplugin_dep = dependency('gplugin',
+	version : ['>=0.33.0', '<0.34.0'],
+	fallback : ['gplugin', 'gplugin_dep'])
 
-		gplugin_gtk_docpath = gplugin_gtk_dep.get_pkgconfig_variable('prefix') / 'share/gtk-doc/html'
-		if enable_introspection
-			gplugin_gtk_gir = 'GPluginGtk-1.0'
-			gplugin_gtk_include_directories = include_directories(
-			    gplugin_gtk_dep.get_pkgconfig_variable('prefix') / 'share/gir-1.0')
-		else
-			gplugin_gtk_include_directories = []
-		endif
-	endif
-else
-	gplugin_proj = subproject('gplugin',
-	    default_options : [
-	        'doc=' + get_option('doc').to_string(),
-	        'introspection=' + enable_introspection.to_string(),
-	        'nls=' + get_option('nls').to_string(),
-	        'gtk3=' + get_option('gtkui').to_string(),
-	    ]
-	)
-
-	gplugin_dep = gplugin_proj.get_variable('gplugin_dep')
-
-	gplugin_docpath = meson.project_build_root() / 'subprojects/gplugin/gplugin/reference/'
-
-	if enable_introspection
-		gplugin_gir = gplugin_proj.get_variable('gplugin_gir')[0]
-	endif
-	gplugin_include_directories = []
-
-	if get_option('gtkui')
-		gplugin_gtk_dep = gplugin_proj.get_variable('gplugin_gtk_dep')
-
-		gplugin_gtk_docpath = meson.project_build_root() / 'subprojects/gplugin/gplugin-gtk/reference/'
-
-		if enable_introspection
-			gplugin_gtk_gir = gplugin_proj.get_variable('gplugin_gtk_gir')[0]
-		endif
-		gplugin_gtk_include_directories = []
-	endif
+if get_option('gtkui')
+	gplugin_gtk_dep = dependency('gplugin-gtk',
+		version : ['>=0.33.0', '<0.34.0'],
+		fallback : ['gplugin-gtk', 'gplugin_gtk_dep'])
 endif
 
 #######################################################################
diff --git a/pidgin/meson.build b/pidgin/meson.build
--- a/pidgin/meson.build
+++ b/pidgin/meson.build
@@ -315,8 +315,8 @@
 		introspection_sources = libpidgin_headers + libpidgin_prefs_headers
 
 		Pidgin_gir_includes = [
-			'GObject-2.0', 'Gtk-3.0',
-			talkatu_gir, gplugin_gir, gplugin_gtk_gir,
+			'GObject-2.0', 'Gtk-3.0', 'GPlugin-1.0', 'GPluginGtk-1.0',
+			talkatu_gir,
 			# subproject needs to be before libpurple in the repo so that
 			# meson will use our variables and not try to discover them from
 			# libpurple.
@@ -333,8 +333,6 @@
 			nsversion : '@0@.@1@'.format(purple_major_version,
 			                             purple_minor_version),
 			include_directories : [
-				gplugin_include_directories,
-				gplugin_gtk_include_directories,
 				talkatu_include_directories,
 			],
 			install : true,
