Skip to content

.pc file with ${pc_sysrootdir}: different behavior between muon and meson #212

@vtorri

Description

@vtorri

Happys new year

I have tested with xcb-proto.pc, which contains:

prefix=/opt/xcb
exec_prefix=${prefix}
datarootdir=${prefix}/share
datadir=${datarootdir}
xcbincludedir=${pc_sysrootdir}${datadir}/xcb
PYTHON_PREFIX=${prefix}
pythondir=${pc_sysrootdir}${PYTHON_PREFIX}/lib/python3.12/site-packages

Name: XCB Proto
Description: X protocol descriptions for XCB
Version: 1.17.0

the behavior of pkgconf when I retrieve the value of xcbincludedir, on Windows or Linux, is the same:

  1. if PKG_CONFIG_SYSROOT_DIR is not set, pkgconf --variable=xcbincludedir= xcb-proto returns
  • Linux: //usr/share/xcb
  • Windows: /C:/Documents/msys2_2/opt/xcb/share/xcb
  1. if PKG_CONFIG_SYSROOT_DIR is set to nothing, pkgconf --variable=xcbincludedir= xcb-proto returns
  • Linux: /usr/share/xcb
  • Windows: C:/Documents/msys2_2/opt/xcb/share/xcb

Now, with this meson.build test file:

project('test', 'c')
pkg_mod = import('pkgconfig')
xcbproto = dependency('xcb-proto', required: true, version: '>= 1.17.0')
xcbproto_inc_dir = xcbproto.get_variable(pkgconfig: 'xcbincludedir')
warning(xcbproto_inc_dir)

With meson, on Windows (I think it will be the same on Linux)

  1. if PKG_CONFIG_SYSROOT_DIR is not set, meson setup build displays WARNING: /C:/Documents/msys2_2/opt/xcb/share/xcb
  2. if PKG_CONFIG_SYSROOT_DIR is set to nothing, meson setup build displays WARNING: C:/Documents/msys2_2/opt/xcb/share/xcb

The behavior is consistent with what pkgconf returns

With muon git, on Windows (I think it will be the same on Linux)

  1. if PKG_CONFIG_SYSROOT_DIR is not set, muon setup build displays warn //opt/xcb/share/xcbb
  2. if PKG_CONFIG_SYSROOT_DIR is set to nothing, muon setup build displays warn //opt/xcb/share/xcb

So with muon:

  1. / is always prepended, contrary to what pkgconf returns
  2. /opt is not expanded

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions