[sysprof: 1/2] build: add datadir to pkgconfig files



commit 653ff6ba9e80fb3a431d86aeccb8a427d4d7af41
Author: worldofpeace <worldofpeace protonmail ch>
Date:   Wed Dec 4 17:06:50 2019 -0500

    build: add datadir to pkgconfig files
    
    Mutter wants sysprof's exact dbus interface directory during build time
    * https://gitlab.gnome.org/GNOME/mutter/blob/master/src/meson.build#L714
    
    On certain platforms mutter's datadir != sysprof's datadir.
    This is initial work for a forthcoming PR to do
    ```
    sysprof_dep.get_pkgconfig_variable('datadir')
    ```
    in mutter for compatibility with these platforms.
    
    This patch is on behalf of nixpkgs where we actually have to carry a
    downstream patch [0] for this exact reason. We install everything into
    their own immutable prefix under `/nix/store`.
    
    [0]: 
https://github.com/NixOS/nixpkgs/blob/a821167046d808365c667e13db44ebba5a680a89/pkgs/desktops/gnome-3/core/mutter/0001-build-use-get_pkgconfig_variable-for-sysprof-dbusdir.patch

 meson.build                        | 1 +
 src/libsysprof-capture/meson.build | 3 +++
 src/libsysprof-ui/meson.build      | 3 +++
 src/libsysprof/meson.build         | 3 +++
 4 files changed, 10 insertions(+)
---
diff --git a/meson.build b/meson.build
index a018c34..d0d85b0 100644
--- a/meson.build
+++ b/meson.build
@@ -15,6 +15,7 @@ i18n = import('i18n')
 libsysprof_api_version = 3
 version_split = meson.project_version().split('.')
 datadir = get_option('datadir')
+datadir_for_pc_file = join_paths('${prefix}', datadir)
 podir = join_paths(meson.source_root(), 'po')
 
 glib_req_version = '>= 2.61.3'
diff --git a/src/libsysprof-capture/meson.build b/src/libsysprof-capture/meson.build
index e0d76c4..8c499c7 100644
--- a/src/libsysprof-capture/meson.build
+++ b/src/libsysprof-capture/meson.build
@@ -64,4 +64,7 @@ pkgconfig.generate(
   description: 'The static capture library for tools that generate profiling capture data',
   install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
      requires: [ 'glib-2.0' ],
+     variables: [
+       'datadir=' + datadir_for_pc_file,
+     ],
 )
diff --git a/src/libsysprof-ui/meson.build b/src/libsysprof-ui/meson.build
index 2fa44f0..52c9121 100644
--- a/src/libsysprof-ui/meson.build
+++ b/src/libsysprof-ui/meson.build
@@ -114,6 +114,9 @@ pkgconfig.generate(
   description: 'The UI library for GTK applications embedding sysprof',
   install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
      requires: [ 'gio-2.0', 'gtk+-3.0' ],
+     variables: [
+       'datadir=' + datadir_for_pc_file,
+     ],
 )
 
 install_headers(libsysprof_ui_public_headers, subdir: sysprof_header_subdir)
diff --git a/src/libsysprof/meson.build b/src/libsysprof/meson.build
index 3449961..77c76c7 100644
--- a/src/libsysprof/meson.build
+++ b/src/libsysprof/meson.build
@@ -138,6 +138,9 @@ pkgconfig.generate(
   description: 'The library for console applications embedding sysprof',
   install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
      requires: [ 'gio-2.0' ],
+     variables: [
+       'datadir=' + datadir_for_pc_file,
+     ],
 )
 
 install_headers(libsysprof_public_headers, subdir: sysprof_header_subdir)


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