malcontent: 0.7.0 → 0.8.0

* Update: https://gitlab.freedesktop.org/pwithnall/malcontent/-/releases/0.8.0
    * Fix the separation patch.
    * Add `itstool` to ui (needed for building localized help).
* Use `pkg-config` instead of the `pkgconfig` alias.
* Fix some issues related to multiple outputs:
    * Make the module pass specific output to `dbus.packages` since the `dbus` NixOS module will not generate configuration with correct interface paths otherwise.
    * Change `malcontent-ui` package to primarily-a-program type derivation (`out`+`lib` instead of `bin`+`out`) since there are more and more `malcontent-control`-specific assets.
        * This also fixes the issue where application data (desktop files, icons…) were installed to `out`, which is not installed by `environment.systemPackages`/`system-path.nix`’s `buildEnv` by default when `bin` output is also present.
    * Make `malcontent` package install `out` output too so that `system-path.nix` links that too. It contains the AccountsService & Polkit data files.
    * Split the library and PAM module out of `malcontent.out` so that they are not installed with the data files.
        * This revealed a bug in the `gobject-introspection` setup hook.
This commit is contained in:
Jan Tojnar 2020-07-23 19:34:12 +02:00
parent 5717d9d2f7
commit 097117cf72
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4
4 changed files with 58 additions and 25 deletions

View file

@ -28,7 +28,10 @@ with lib;
malcontent-ui malcontent-ui
]; ];
services.dbus.packages = [ pkgs.malcontent ]; services.dbus.packages = [
# D-Bus services are in `out`, not the default `bin` output that would be picked up by `makeDbusConf`.
pkgs.malcontent.out
];
services.accounts-daemon.enable = true; services.accounts-daemon.enable = true;

View file

@ -1,18 +1,42 @@
commit 363c5be465dd6dde35c3d31abd7b5cca9b1f3a9f
Author: Jan Tojnar <jtojnar@gmail.com>
Date: Thu Jul 23 18:49:03 2020 +0200
Improve separation between malcontent and malcontent-ui packages
These artefacts go into both packages by default:
* malcontent-control a CLI tool
* PAM module
* gettext locale data
* help pages ✨
* AccountService/D-Bus interfaces
* Polkit com.endlessm.ParentalControls rules and policy
Items marked with ✨ will go to ui package, while the rest is installed with the base library.
See also the packaging done by upstream in Endless:
https://github.com/endlessm/malcontent/tree/5482b7eb99aee9b8c344629bc078e193d3c26ffc/debian
Cannot upstream this since they are worried about maintainability:
https://gitlab.freedesktop.org/pwithnall/malcontent/merge_requests/38#note_437946
diff --git a/meson.build b/meson.build diff --git a/meson.build b/meson.build
index a6c477d..f7b2f0a 100644 index 6e1dfa5..196350b 100644
--- a/meson.build --- a/meson.build
+++ b/meson.build +++ b/meson.build
@@ -125,8 +125,8 @@ test_env = [ @@ -123,9 +123,8 @@ test_env = [
'LC_ALL=C.UTF-8', 'LC_ALL=C.UTF-8',
] ]
-subdir('accounts-service') -subdir('accounts-service')
-subdir('help')
if not get_option('use_system_libmalcontent') if not get_option('use_system_libmalcontent')
+ subdir('accounts-service') + subdir('accounts-service')
subdir('libmalcontent') subdir('libmalcontent')
else else
libmalcontent_api_version = '0' libmalcontent_api_version = '0'
@@ -137,11 +137,17 @@ endif @@ -136,11 +135,16 @@ endif
if get_option('ui').enabled() if get_option('ui').enabled()
subdir('libmalcontent-ui') subdir('libmalcontent-ui')
endif endif
@ -22,14 +46,13 @@ index a6c477d..f7b2f0a 100644
+endif +endif
if get_option('ui').enabled() if get_option('ui').enabled()
subdir('malcontent-control') subdir('malcontent-control')
endif + subdir('help')
-subdir('pam') +endif
+if not get_option('use_system_libmalcontent') +if not get_option('use_system_libmalcontent')
+ subdir('pam') + subdir('pam')
+endif + subdir('po')
subdir('po') endif
-subdir('pam')
-subdir('po')
-meson.add_install_script('build-aux/meson_post_install.py') meson.add_install_script('build-aux/meson_post_install.py')
+if get_option('ui').enabled()
+ meson.add_install_script('build-aux/meson_post_install.py')
+endif

View file

@ -3,7 +3,7 @@
, fetchpatch , fetchpatch
, meson , meson
, ninja , ninja
, pkgconfig , pkg-config
, gobject-introspection , gobject-introspection
, wrapGAppsHook , wrapGAppsHook
, glib , glib
@ -19,16 +19,16 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "malcontent"; pname = "malcontent";
version = "0.7.0"; version = "0.8.0";
outputs = [ "bin" "out" "dev" "man" "installedTests" ]; outputs = [ "bin" "out" "lib" "pam" "dev" "man" "installedTests" ];
src = fetchFromGitLab { src = fetchFromGitLab {
domain = "gitlab.freedesktop.org"; domain = "gitlab.freedesktop.org";
owner = "pwithnall"; owner = "pwithnall";
repo = pname; repo = pname;
rev = version; rev = version;
sha256 = "0lxakzj75pvpgwbjfyfkg0gyzvry00zhc9h9cd8f0wksg7mabzbh"; sha256 = "Y9HzysChzzmKW5PuCLm9AZ4oaBLMpB0I5NyZUOYFzm4=";
}; };
patches = [ patches = [
@ -37,19 +37,12 @@ stdenv.mkDerivation rec {
# Do not build things that are part of malcontent-ui package # Do not build things that are part of malcontent-ui package
./better-separation.patch ./better-separation.patch
# Fix pam installed test
# https://gitlab.freedesktop.org/pwithnall/malcontent/merge_requests/50
(fetchpatch {
url = "https://gitlab.freedesktop.org/pwithnall/malcontent/commit/5d102eeb0604e65fc977ca77d4b249e986e634cc.patch";
sha256 = "1vs35zfp2sa2rps5h1240h73kvlspmv7mfr6f8mcbzvhj1wgzw74";
})
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
meson meson
ninja ninja
pkgconfig pkg-config
gobject-introspection gobject-introspection
wrapGAppsHook wrapGAppsHook
]; ];
@ -72,6 +65,7 @@ stdenv.mkDerivation rec {
mesonFlags = [ mesonFlags = [
"-Dinstalled_tests=true" "-Dinstalled_tests=true"
"-Dinstalled_test_prefix=${placeholder "installedTests"}" "-Dinstalled_test_prefix=${placeholder "installedTests"}"
"-Dpamlibdir=${placeholder "pam"}/lib/security"
"-Dui=disabled" "-Dui=disabled"
]; ];
@ -83,6 +77,13 @@ stdenv.mkDerivation rec {
--replace "/bin/false" "${coreutils}/bin/false" --replace "/bin/false" "${coreutils}/bin/false"
''; '';
postInstall = ''
# `giDiscoverSelf` only picks up paths in `out` output.
# This needs to be in `postInstall` so that it runs before
# `gappsWrapperArgsHook` that runs as one of `preFixupPhases`.
addToSearchPath GI_TYPELIB_PATH "$lib/lib/girepository-1.0"
'';
passthru = { passthru = {
tests = { tests = {
installedTests = nixosTests.installed-tests.malcontent; installedTests = nixosTests.installed-tests.malcontent;
@ -90,6 +91,10 @@ stdenv.mkDerivation rec {
}; };
meta = with stdenv.lib; { meta = with stdenv.lib; {
# We need to install Polkit & AccountsService data files in `out`
# but `buildEnv` only uses `bin` when both `bin` and `out` are present.
outputsToInstall = [ "bin" "out" "man" ];
description = "Parental controls library"; description = "Parental controls library";
homepage = "https://gitlab.freedesktop.org/pwithnall/malcontent"; homepage = "https://gitlab.freedesktop.org/pwithnall/malcontent";
license = licenses.lgpl21Plus; license = licenses.lgpl21Plus;

View file

@ -3,6 +3,7 @@
, ninja , ninja
, pkg-config , pkg-config
, gobject-introspection , gobject-introspection
, itstool
, wrapGAppsHook , wrapGAppsHook
, glib , glib
, accountsservice , accountsservice
@ -20,7 +21,7 @@ stdenv.mkDerivation rec {
inherit (malcontent) version src; inherit (malcontent) version src;
outputs = [ "bin" "out" "dev" ]; outputs = [ "out" "lib" "dev" ];
patches = [ patches = [
# Allow installing installed tests to a separate output. # Allow installing installed tests to a separate output.
@ -35,6 +36,7 @@ stdenv.mkDerivation rec {
ninja ninja
pkg-config pkg-config
gobject-introspection gobject-introspection
itstool
desktop-file-utils desktop-file-utils
wrapGAppsHook wrapGAppsHook
]; ];