gplugin/gplugin

Use Meson's built-in pkg-config file generator.
feature/meson
2017-06-01, Elliott Sales de Andrade
97d77dfac016
Parents 6d0efa8705b9
Children 764116a5c6aa
Use Meson's built-in pkg-config file generator.
--- a/gplugin-gtk/gplugin-gtk.pc.in Thu Jun 01 21:49:33 2017 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-prefix=@CMAKE_INSTALL_PREFIX@
-libdir=${prefix}/lib
-includedir=${prefix}/include/gplugin-1.0/
-
-plugindir=${libdir}
-
-Name: libgplugin-gtk
-Description: Gtk+ widgets for GPlugin
-Version: @GPLUGIN_VERSION@
-Requires: glib-2.0 gobject-2.0 gmodule-2.0 gplugin
-Libs: -L${libdir} -lgplugin-gtk
-Cflags: -I${includedir}
-
--- a/gplugin-gtk/meson.build Thu Jun 01 21:49:33 2017 -0400
+++ b/gplugin-gtk/meson.build Thu Jun 01 22:09:24 2017 -0400
@@ -57,13 +57,6 @@
install : true,
install_dir : join_paths(get_option('includedir'), 'gplugin-1.0'))
-configure_file(
- input : 'gplugin-gtk.pc.in',
- output : 'gplugin-gtk.pc',
- configuration : version_conf,
- install : true,
- install_dir : join_paths(get_option('libdir'), 'pkgconfig'))
-
###############################################################################
# Library Target
###############################################################################
@@ -94,6 +87,19 @@
install_dir : join_paths(get_option('datadir'), 'gplugin', 'gplugin-gtk')
)
+pkgconfig.generate(
+ name : 'libgplugin-gtk',
+ description : 'Gtk+ widgets for GPlugin',
+ version : GPLUGIN_VERSION,
+ filebase : 'gplugin-gtk',
+ subdirs : 'gplugin-1.0',
+ libraries : gplugin_gtk,
+ requires : ['glib-2.0', 'gobject-2.0', 'gmodule-2.0', 'gplugin'],
+ variables : [
+ 'plugindir=${libdir}',
+ ],
+)
+
###############################################################################
# Application Target
###############################################################################
--- a/gplugin/gplugin-uninstalled.pc.in Thu Jun 01 21:49:33 2017 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-Name: libgplugin
-Description: A fully featured GModule based plugin library
-Version: @GPLUGIN_VERSION@
-Requires: glib-2.0 gobject-2.0 gmodule-2.0
-Libs: -L@CMAKE_BINARY_DIR@/gplugin -lgplugin
-Cflags: -I@CMAKE_SOURCE_DIR@/gplugin -I@CMAKE_BINARY_DIR@/gplugin
-
--- a/gplugin/gplugin.pc.in Thu Jun 01 21:49:33 2017 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-prefix=@CMAKE_INSTALL_PREFIX@
-libdir=${prefix}/lib
-includedir=${prefix}/include/gplugin-1.0/
-
-plugindir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
-
-Name: libgplugin
-Description: A fully featured GModule based plugin library
-Version: @GPLUGIN_VERSION@
-Requires: glib-2.0 gobject-2.0 gmodule-2.0
-Libs: -L${libdir} -lgplugin
-Cflags: -I${includedir}
-
--- a/gplugin/meson.build Thu Jun 01 21:49:33 2017 -0400
+++ b/gplugin/meson.build Thu Jun 01 22:09:24 2017 -0400
@@ -124,17 +124,6 @@
gplugin_version_h
]
-configure_file(
- input : 'gplugin.pc.in',
- output : 'gplugin.pc',
- configuration : version_conf,
- install : true,
- install_dir : join_paths(get_option('libdir'), 'pkgconfig'))
-configure_file(
- input : 'gplugin-uninstalled.pc.in',
- output : 'gplugin-uninstalled.pc',
- configuration : version_conf)
-
# Build gplugin.h
GPLUGIN_H_INCLUDES = ''
@@ -205,6 +194,19 @@
dependencies : [GLIB, GOBJECT]
)
+pkgconfig.generate(
+ name : 'libgplugin',
+ description : 'A fully featured GModule based plugin library',
+ version : GPLUGIN_VERSION,
+ filebase : 'gplugin',
+ subdirs : 'gplugin-1.0',
+ libraries : gplugin,
+ requires : ['glib-2.0', 'gobject-2.0', 'gmodule-2.0'],
+ variables : [
+ 'plugindir=${libdir}',
+ ],
+)
+
# nls
if get_option('nls')
# gettextize_pot_file(
--- a/meson.build Thu Jun 01 21:49:33 2017 -0400
+++ b/meson.build Thu Jun 01 22:09:24 2017 -0400
@@ -22,18 +22,15 @@
version_conf.set('GPLUGIN_EXTRA_VERSION', GPLUGIN_EXTRA_VERSION)
version_conf.set('GPLUGIN_VERSION', GPLUGIN_VERSION)
-# To get pkg-config files working.
-version_conf.set('CMAKE_INSTALL_PREFIX', get_option('prefix'))
-version_conf.set('CMAKE_INSTALL_LIBDIR', get_option('libdir'))
-version_conf.set('CMAKE_BINARY_DIR', meson.build_root())
-version_conf.set('CMAKE_SOURCE_DIR', meson.source_root())
-
LOCALE_DIR = get_option('prefix') + '/locale'
add_global_arguments('-DLOCALEDIR="@0@"'.format(LOCALE_DIR), language : 'c')
###############################################################################
# Dependencies
###############################################################################
+gnome = import('gnome')
+pkgconfig = import('pkgconfig')
+
if get_option('help2man')
help2man = find_program('help2man')
endif
@@ -44,8 +41,6 @@
# we separate gmodule out so our test aren't linked to it
GMODULE = dependency('gmodule-2.0')
-gnome = import('gnome')
-
if get_option('testing')
GTESTER = find_program('gtester')
XSLTPROC = find_program('xsltproc')