summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororbea <orbea@riseup.net>2020-08-17 09:30:57 -0700
committerAdam Jackson <ajax@nwnk.net>2020-08-24 15:01:44 +0000
commite4d9ffdd51b15b1c9441086f7a86bb50a9f7b555 (patch)
treebf54c82109d8e439f6589059d4a3842c38a119c6
parentdaffc5b46234d6a18c3a2c3f5e0367cd3c586df6 (diff)
meson: Use configure_file for pc files.
Meson's pkg.generate() is not suitable for header only libraries and using configure_file() allows for more fine tuned control. This also makes the meson and autotools builds more in sync where they both use the same .pc.in files. v2: Drop exec_prefix.
-rw-r--r--meson.build108
1 files changed, 52 insertions, 56 deletions
diff --git a/meson.build b/meson.build
index 6254dce..8da8337 100644
--- a/meson.build
+++ b/meson.build
@@ -19,77 +19,73 @@
# SOFTWARE.
project('xorgproto', 'c', license : 'MIT', version : '2020.1')
-pkg = import('pkgconfig')
cc = meson.get_compiler('c')
sed = find_program('sed')
pcs = [
- ['applewmproto', '1.4.2'],
- ['bigreqsproto', '1.1.2'],
- ['compositeproto', '0.4.2'],
- ['damageproto', '1.2.1'],
- ['dmxproto', '2.3.1'],
- ['dpmsproto', '1.2'],
- ['dri2proto', '2.8'],
- ['dri3proto', '1.2'],
- ['fixesproto', '5.0'],
- ['fontsproto', '2.1.3'],
- ['glproto', '1.4.17'],
- ['inputproto', '2.3.2'],
- ['kbproto', '1.0.7'],
- ['presentproto', '1.2'],
- ['randrproto', '1.6.0'],
- ['recordproto', '1.14.2'],
- ['renderproto', '0.11.1'],
- ['resourceproto', '1.2.0'],
- ['scrnsaverproto', '1.2.2'],
- ['videoproto', '2.3.3'],
- ['xcmiscproto', '1.2.2'],
- ['xextproto', '7.3.0'],
- ['xf86bigfontproto', '1.2.0'],
- ['xf86dgaproto', '2.1'],
- ['xf86driproto', '2.1.1'],
- ['xf86vidmodeproto', '2.3.1'],
- ['xineramaproto', '1.2.1'],
- ['xproto', '7.0.32'],
+ 'applewmproto',
+ 'bigreqsproto',
+ 'compositeproto',
+ 'damageproto',
+ 'dmxproto',
+ 'dpmsproto',
+ 'dri2proto',
+ 'dri3proto',
+ 'fixesproto',
+ 'fontsproto',
+ 'glproto',
+ 'inputproto',
+ 'kbproto',
+ 'presentproto',
+ 'randrproto',
+ 'recordproto',
+ 'renderproto',
+ 'resourceproto',
+ 'scrnsaverproto',
+ 'videoproto',
+ 'xcmiscproto',
+ 'xextproto',
+ 'xf86bigfontproto',
+ 'xf86dgaproto',
+ 'xf86driproto',
+ 'xf86vidmodeproto',
+ 'xineramaproto',
+ 'xproto',
]
+pc_data = configuration_data()
+pc_data.set('prefix', get_option('prefix'))
+# meson does not allow installing the includedir outside of the prefix
+pc_data.set('includedir', '${prefix}/' + get_option('includedir'))
+
foreach pc : pcs
- if pc[0] == 'xf86driproto'
- subdir = 'X11/dri'
- else
- subdir = ''
- endif
- pkg.generate(
- name : pc[0],
- filebase : pc[0],
- description : pc[0] + ' headers',
- version : pc[1],
+ configure_file(
+ input : pc + '.pc.in',
+ output : pc + '.pc',
install_dir : get_option('datadir') + '/pkgconfig',
- subdirs : subdir,
+ configuration : pc_data,
)
endforeach
if get_option('legacy') == true
legacy_pcs = [
- ['evieproto', '1.1.1'],
- ['fontcacheproto', '0.1.3'],
- ['lg3dproto', '5.0'],
- ['printproto', '1.0.5'],
- ['trapproto', '3.4.3'],
- ['windowswmproto', '1.0.4'],
- ['xcalibrateproto', '0.1.0'],
- ['xf86miscproto', '0.9.3'],
- ['xf86rushproto', '1.2.2'],
- ['xproxymngproto', '1.0.3'],
+ 'evieproto',
+ 'fontcacheproto',
+ 'lg3dproto',
+ 'printproto',
+ 'trapproto',
+ 'windowswmproto',
+ 'xcalibrateproto',
+ 'xf86miscproto',
+ 'xf86rushproto',
+ 'xproxymngproto',
]
foreach pc : legacy_pcs
- pkg.generate(
- name : pc[0],
- filebase : pc[0],
- description : pc[0] + ' headers',
- version : pc[1],
- install_dir : get_option('datadir') + '/pkgconfig'
+ configure_file(
+ input : pc + '.pc.in',
+ output : pc + '.pc',
+ install_dir : get_option('datadir') + '/pkgconfig',
+ configuration : pc_data,
)
endforeach
endif