lol

Merge pull request #295087 from tmuehlbacher/polkit-124

polkit: 123 -> 124

authored by

Sandro and committed by
GitHub
bc69480f 8da9f023

+65 -13
+53
pkgs/development/libraries/polkit/0001-build-Use-datarootdir-in-Meson-generated-pkg-config-.patch
··· 1 + From 7ba07551dfcd4ef9a87b8f0d9eb8b91fabcb41b3 Mon Sep 17 00:00:00 2001 2 + From: Jan Tojnar <jtojnar@gmail.com> 3 + Date: Mon, 1 Nov 2021 14:17:17 +0100 4 + Subject: [PATCH] build: Use datarootdir in Meson-generated pkg-config files 5 + MIME-Version: 1.0 6 + Content-Type: text/plain; charset=UTF-8 7 + Content-Transfer-Encoding: 8bit 8 + 9 + With datadir outside of prefix (currently unsupported by Meson[1] 10 + but a frequent occurrence in Nixpkgs), the `datadir` entry, 11 + in the `polkit-gobject-1` pkg-config file will be an absolute path. 12 + This will prevent changing the base directory of `policydir` 13 + with `--define-variable=prefix=…`, which many projects use 14 + to install policy files to their own prefix. 15 + 16 + Previously, this worked without changes on Nixpkgs’s part because 17 + the pkg-config template used by Autotools contained `@datarootdir@`, 18 + which resolves to `$(prefix)/share`[2], taking no heed of the changed datadir. 19 + 20 + Similar issue can happen when a distribution package redefines datadir 21 + like Debian does/did.[3] 22 + 23 + This patch changes Meson-based build system to use `$(prefix)/share` 24 + in the generated pkg-config files, mirroring Autotools. 25 + 26 + --- 27 + 28 + 1. Likely to change in the future: https://github.com/mesonbuild/meson/issues/2561#issuecomment-939253717 29 + 2. https://www.gnu.org/prep/standards/html_node/Directory-Variables.html 30 + 3. https://blogs.gnome.org/hughsie/2014/06/16/datarootdir-v-s-datadir/ 31 + --- 32 + src/polkit/meson.build | 5 ++--- 33 + 1 file changed, 2 insertions(+), 3 deletions(-) 34 + 35 + diff --git a/src/polkit/meson.build b/src/polkit/meson.build 36 + index 63dc1e85..c92cb70f 100644 37 + --- a/src/polkit/meson.build 38 + +++ b/src/polkit/meson.build 39 + @@ -113,9 +113,8 @@ pkg.generate( 40 + requires: common_deps, 41 + variables: [ 42 + 'exec_prefix=${prefix}', 43 + - 'datadir=' + ('${prefix}' / pk_datadir), 44 + - 'policydir=' + ('${datadir}' / pk_actiondir), 45 + - 'actiondir=' + ('${datadir}' / pk_actiondir), 46 + + 'policydir=' + ('${prefix}' / 'share' / pk_actiondir), 47 + + 'actiondir=' + ('${prefix}' / 'share' / pk_actiondir), 48 + 'pkcheck_supports_uid=true', 49 + ], 50 + ) 51 + -- 52 + GitLab 53 +
+12 -13
pkgs/development/libraries/polkit/default.nix
··· 1 1 { lib 2 2 , stdenv 3 - , fetchFromGitLab 3 + , fetchFromGitHub 4 4 , pkg-config 5 5 , glib 6 6 , expat ··· 10 10 , ninja 11 11 , perl 12 12 , python3 13 - , fetchpatch 14 13 , gettext 15 14 , duktape 16 15 , gobject-introspection ··· 38 37 in 39 38 stdenv.mkDerivation rec { 40 39 pname = "polkit"; 41 - version = "123"; 40 + version = "124"; 42 41 43 42 outputs = [ "bin" "dev" "out" ]; # small man pages in $bin 44 43 45 44 # Tarballs do not contain subprojects. 46 - src = fetchFromGitLab { 47 - domain = "gitlab.freedesktop.org"; 48 - owner = "polkit"; 45 + src = fetchFromGitHub { 46 + owner = "polkit-org"; 49 47 repo = "polkit"; 50 48 rev = version; 51 - hash = "sha256-/kjWkh6w2FYgtYWzw3g3GlWJKKpkJ3cqwfE0iDqJctw="; 49 + hash = "sha256-Vc9G2xK6U1cX+xW2BnKp3oS/ACbSXS/lztbFP5oJOlM="; 52 50 }; 53 51 54 52 patches = [ 55 53 # Allow changing base for paths in pkg-config file as before. 56 54 # https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/100 57 - (fetchpatch { 58 - url = "https://gitlab.freedesktop.org/polkit/polkit/-/commit/7ba07551dfcd4ef9a87b8f0d9eb8b91fabcb41b3.patch"; 59 - sha256 = "ebbLILncq1hAZTBMsLm+vDGw6j0iQ0crGyhzyLZQgKA="; 60 - }) 55 + ./0001-build-Use-datarootdir-in-Meson-generated-pkg-config-.patch 61 56 ]; 62 57 63 58 depsBuildBuild = [ ··· 108 103 ])) 109 104 ]; 110 105 106 + env = { 107 + PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system"; 108 + PKG_CONFIG_SYSTEMD_SYSUSERS_DIR = "${placeholder "out"}/lib/sysusers.d"; 109 + }; 110 + 111 111 mesonFlags = [ 112 112 "--datadir=${system}/share" 113 113 "--sysconfdir=/etc" 114 - "-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system" 115 114 "-Dpolkitd_user=polkituser" #TODO? <nixos> config.ids.uids.polkituser 116 115 "-Dos_type=redhat" # only affects PAM includes 117 116 "-Dintrospection=${lib.boolToString withIntrospection}" ··· 175 174 ''; 176 175 177 176 meta = with lib; { 178 - homepage = "https://gitlab.freedesktop.org/polkit/polkit/"; 177 + homepage = "https://github.com/polkit-org/polkit"; 179 178 description = "A toolkit for defining and handling the policy that allows unprivileged processes to speak to privileged processes"; 180 179 license = licenses.lgpl2Plus; 181 180 platforms = platforms.linux;