Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P polkit
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 121
    • Issues 121
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 20
    • Merge requests 20
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • polkit
  • polkit
  • Merge requests
  • !100

Open
Created Nov 01, 2021 by Jan Tojnar@jtojnar
  • Report abuse
Report abuse

build: Use datarootdir in Meson-generated pkg-config files

  • Overview 1
  • Commits 1
  • Pipelines 2
  • Changes 1

With datadir outside of prefix (currently unsupported by Meson¹ but a frequent occurrence in Nixpkgs), the datadir entry, in the polkit-gobject-1 pkg-config file will be an absolute path. This will prevent changing the base directory of policydir with --define-variable=prefix=…, which many projects use to install policy files to their own prefix.

Previously, this worked without changes on Nixpkgs’s part because the pkg-config template used by Autotools contained @datarootdir@, which resolves to $(prefix)/share², taking no heed of the changed datadir.

Similar issue can happen when a distribution package redefines datadir like Debian does/did: https://blogs.gnome.org/hughsie/2014/06/16/datarootdir-v-s-datadir/

This patch changes Meson-based build system to use $(prefix)/share in the generated pkg-config files, mirroring Autotools.


  1. Likely to change in the future: https://github.com/mesonbuild/meson/issues/2561#issuecomment-939253717
  2. https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
Edited Nov 01, 2021 by Jan Tojnar
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: pc-datarootdir