Files
nixpkgs/pkgs/by-name/po/polkit/0001-build-Use-datarootdir-in-Meson-generated-pkg-config-.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

53 lines
1.9 KiB
Diff
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
From 5db2dee82bf652cca5fd782c19c8cc8e7ad5ed3e Mon Sep 17 00:00:00 2001
From: Jan Tojnar <jtojnar@gmail.com>
Date: Mon, 1 Nov 2021 14:17:17 +0100
Subject: [PATCH] build: Use datarootdir in Meson-generated pkg-config files
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
With datadir outside of prefix (currently unsupported by Meson[1]
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 Nixpkgss part because
the pkg-config template used by Autotools contained `@datarootdir@`,
which resolves to `$(prefix)/share`[2], taking no heed of the changed datadir.
Similar issue can happen when a distribution package redefines datadir
like Debian does/did.[3]
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
3. https://blogs.gnome.org/hughsie/2014/06/16/datarootdir-v-s-datadir/
---
src/polkit/meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/polkit/meson.build b/src/polkit/meson.build
index a7ce02b..9192a36 100644
--- a/src/polkit/meson.build
+++ b/src/polkit/meson.build
@@ -114,8 +114,8 @@ pkg.generate(
requires: common_deps,
variables: [
'exec_prefix=${prefix}',
- 'policydir=' + ('${datadir}' / pk_actiondir),
- 'actiondir=' + ('${datadir}' / pk_actiondir),
+ 'policydir=' + ('${prefix}' / 'share' / pk_actiondir),
+ 'actiondir=' + ('${prefix}' / 'share' / pk_actiondir),
'pkcheck_supports_uid=true',
],
)
--
2.48.1