From 3b82447321f8a6658de9864ae8b61877af513953 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 26 Jun 2018 17:20:33 +0100 Subject: Use Meson to generate the pkgconfig file Meson can generate a compliant pkgconfig file for us, straight from the library we just built, without using a template file. --- atk.pc.in | 11 ----------- atk/meson.build | 11 ++++++++++- meson.build | 20 ++------------------ 3 files changed, 12 insertions(+), 30 deletions(-) delete mode 100644 atk.pc.in diff --git a/atk.pc.in b/atk.pc.in deleted file mode 100644 index 51ce841..0000000 --- a/atk.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: Atk -Description: Accessibility Toolkit -Version: @VERSION@ -Requires: gobject-2.0 -Libs: -L${libdir} -latk-@ATK_API_VERSION@ -Cflags: -I${includedir}/atk-1.0 diff --git a/atk/meson.build b/atk/meson.build index 52b730c..bbf57df 100644 --- a/atk/meson.build +++ b/atk/meson.build @@ -122,7 +122,7 @@ if host_system == 'windows' atk_sources += atk_win_res endif -libatk = library('atk-@0@'.format(atk_api_version), +libatk = library(atk_api_name, sources: atk_sources + atk_enums + atk_marshals, soversion: atk_soversion, version: atk_libversion, @@ -158,3 +158,12 @@ libatk_dep = declare_dependency(link_with: libatk, dependencies: gobject_dep, sources: atk_sources_dep, ) + +pkgconfig.generate(libatk, + name: 'Atk', + description: 'Accessibility Toolkit', + version: meson.project_version(), + subdirs: atk_api_name, + filebase: 'atk', + install_dir: join_paths(atk_libdir, 'pkgconfig'), +) diff --git a/meson.build b/meson.build index daf5b30..b03e189 100644 --- a/meson.build +++ b/meson.build @@ -20,6 +20,7 @@ atk_interface_age = 1 atk_binary_age = 10000 * atk_major_version + 100 * atk_minor_version + 10 + atk_micro_version atk_api_version = '1.0' +atk_api_name = 'atk-@0@'.format(atk_api_version) atk_api_path = 'atk-@0@/atk'.format(atk_api_version) atk_prefix = get_option('prefix') @@ -94,24 +95,7 @@ gobject_req_version = '>= 2.31.2' gobject_dep = dependency('gobject-2.0', version: gobject_req_version) -# Compat variables for pkgconfig -pkgconf = configuration_data() -pkgconf.set('prefix', atk_prefix) -pkgconf.set('exec_prefix', atk_prefix) -pkgconf.set('libdir', atk_libdir) -pkgconf.set('includedir', atk_includedir) -pkgconf.set('VERSION', meson.project_version()) -pkgconf.set('ATK_API_VERSION', atk_api_version) -pkgconf.set('srcdir', '.') - -foreach pkg: [ 'atk.pc', ] - configure_file(input: pkg + '.in', - output: pkg, - configuration: pkgconf, - install: true, - install_dir: join_paths(atk_libdir, 'pkgconfig')) -endforeach - +pkgconfig = import('pkgconfig') gnome = import('gnome') # Internal configuration header -- cgit v1.2.1