[gnome-software] build: Fix the pcfile



commit b5847126891520767541b886d438bf1ff7c6fb68
Author: Iain Lane <iain orangesquash org uk>
Date:   Thu May 4 15:35:01 2017 +0100

    build: Fix the pcfile
    
    Substitutions within it weren't being expanded properly, leading to it
    containing incorrect contents.
    
    Create a new configuration data object that contains what we need, and
    use it when generating the file.
    
    Also provide a template that can be used instead of substitution once
    meson supports setting custom directories.

 lib/gnome-software.pc.in |    1 -
 lib/meson.build          |   29 ++++++++++++++++++++++++++++-
 meson.build              |    3 ++-
 3 files changed, 30 insertions(+), 3 deletions(-)
---
diff --git a/lib/gnome-software.pc.in b/lib/gnome-software.pc.in
index 2c22d4b..cde7122 100644
--- a/lib/gnome-software.pc.in
+++ b/lib/gnome-software.pc.in
@@ -1,5 +1,4 @@
 prefix=@prefix@
-exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
 plugindir=@libdir@/gs-plugins-@GS_PLUGIN_API_VERSION@
diff --git a/lib/meson.build b/lib/meson.build
index 70de332..b7944e6 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -1,14 +1,41 @@
 cargs = ['-DG_LOG_DOMAIN="Gs"']
 cargs += ['-DLOCALPLUGINDIR=""']
 
+# we can't use conf as this is set_quoted()
+
+pkconf = configuration_data()
+pkconf.set('prefix', get_option('prefix'))
+pkconf.set('libdir',
+           join_paths(get_option('prefix'),
+                      get_option('libdir')))
+pkconf.set('includedir',
+           join_paths(get_option('prefix'),
+                      get_option('includedir')))
+pkconf.set('GS_PLUGIN_API_VERSION', gs_plugin_api_version)
+pkconf.set('VERSION', meson.project_version())
 configure_file(
   input : 'gnome-software.pc.in',
   output : 'gnome-software.pc',
   install: true,
   install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
-  configuration : conf
+  configuration : pkconf
 )
 
+# XXX: This can probably be used (after testing), once
+# https://github.com/mesonbuild/meson/pull/1688 is merged
+#pkg = import('pkgconfig')
+#
+#pkg.generate(
+#    description : 'GNOME Software is a software center for GNOME',
+#    filebase : 'gnome-software',
+#    name : 'gnome-software',
+#    requires: [ 'gobject-2.0', 'gdk-3.0', 'appstream-glib', 'libsoup-2.4', 'gio-unix-2.0'],
+#    requires_private : [ 'gthread-2.0', 'atk' ],
+#    subdirs : [ 'gnome-software' ],
+#    variables : [ 'plugindir=${libdir}/lib/gs-plugins-' + gs_plugin_api_version ]
+#    version : meson.project_version()
+#)
+
 install_headers([
     'gnome-software.h',
     'gs-app.h',
diff --git a/meson.build b/meson.build
index 2c473a4..1075150 100644
--- a/meson.build
+++ b/meson.build
@@ -12,7 +12,8 @@ conf.set_quoted('PACKAGE_VERSION', meson.project_version())
 
 # this refers to the gnome-software plugin API version
 # this is not in any way related to a package or soname version
-conf.set_quoted('GS_PLUGIN_API_VERSION', '11')
+gs_plugin_api_version = '11'
+conf.set_quoted('GS_PLUGIN_API_VERSION', gs_plugin_api_version)
 
 # install docs
 install_data('README', install_dir : 'share/doc/gnome-software')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]