[gnome-software] build: use meson functionality to generate .pc file



commit e91ea5d802b794947b21d438f3defdfd9309d860
Author: Rasmus Thomsen <oss cogitri dev>
Date:   Fri Apr 17 14:45:59 2020 +0200

    build: use meson functionality to generate .pc file
    
    This should be sufficiently stable now and also fixes a few things
    in the pkgconfig file, like minimum required versions of dependants
    and also fixes linking against gnome-software with pkgconfig, previously
    only -L/usr/lib was passed to the linker and not -lgnome-software

 lib/meson.build | 45 +++++++++++----------------------------------
 1 file changed, 11 insertions(+), 34 deletions(-)
---
diff --git a/lib/meson.build b/lib/meson.build
index 376beebd..a41f63bb 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -1,40 +1,6 @@
 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_dir: join_paths(get_option('libdir'), 'pkgconfig'),
-  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',
@@ -98,6 +64,17 @@ libgnomesoftware = static_library(
   c_args : cargs,
 )
 
+pkg = import('pkgconfig')
+
+pkg.generate(
+    libgnomesoftware,
+    description : 'GNOME Software is a software center for GNOME',
+    filebase : 'gnome-software',
+    name : 'gnome-software',
+    subdirs : 'gnome-software',
+    variables : 'plugindir=${libdir}/gs-plugins-' + gs_plugin_api_version,
+)
+
 executable(
   'gnome-software-cmd',
   sources : [


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