Skip to content

Commit 097117c

Browse files
committed
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.
1 parent 5717d9d commit 097117c

4 files changed

Lines changed: 58 additions & 25 deletions

File tree

nixos/modules/services/desktops/malcontent.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ with lib;
2828
malcontent-ui
2929
];
3030

31-
services.dbus.packages = [ pkgs.malcontent ];
31+
services.dbus.packages = [
32+
# D-Bus services are in `out`, not the default `bin` output that would be picked up by `makeDbusConf`.
33+
pkgs.malcontent.out
34+
];
3235

3336
services.accounts-daemon.enable = true;
3437

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,42 @@
1+
commit 363c5be465dd6dde35c3d31abd7b5cca9b1f3a9f
2+
Author: Jan Tojnar <jtojnar@gmail.com>
3+
Date: Thu Jul 23 18:49:03 2020 +0200
4+
5+
Improve separation between malcontent and malcontent-ui packages
6+
7+
These artefacts go into both packages by default:
8+
9+
* malcontent-control – a CLI tool
10+
* PAM module
11+
* gettext locale data
12+
* help pages ✨
13+
* AccountService/D-Bus interfaces
14+
* Polkit com.endlessm.ParentalControls rules and policy
15+
16+
Items marked with ✨ will go to ui package, while the rest is installed with the base library.
17+
18+
See also the packaging done by upstream in Endless:
19+
https://github.com/endlessm/malcontent/tree/5482b7eb99aee9b8c344629bc078e193d3c26ffc/debian
20+
21+
Cannot upstream this since they are worried about maintainability:
22+
https://gitlab.freedesktop.org/pwithnall/malcontent/merge_requests/38#note_437946
23+
124
diff --git a/meson.build b/meson.build
2-
index a6c477d..f7b2f0a 100644
25+
index 6e1dfa5..196350b 100644
326
--- a/meson.build
427
+++ b/meson.build
5-
@@ -125,8 +125,8 @@ test_env = [
28+
@@ -123,9 +123,8 @@ test_env = [
629
'LC_ALL=C.UTF-8',
730
]
831

932
-subdir('accounts-service')
33+
-subdir('help')
1034
if not get_option('use_system_libmalcontent')
1135
+ subdir('accounts-service')
1236
subdir('libmalcontent')
1337
else
1438
libmalcontent_api_version = '0'
15-
@@ -137,11 +137,17 @@ endif
39+
@@ -136,11 +135,16 @@ endif
1640
if get_option('ui').enabled()
1741
subdir('libmalcontent-ui')
1842
endif
@@ -22,14 +46,13 @@ index a6c477d..f7b2f0a 100644
2246
+endif
2347
if get_option('ui').enabled()
2448
subdir('malcontent-control')
25-
endif
26-
-subdir('pam')
49+
+ subdir('help')
50+
+endif
2751
+if not get_option('use_system_libmalcontent')
2852
+ subdir('pam')
29-
+endif
30-
subdir('po')
53+
+ subdir('po')
54+
endif
55+
-subdir('pam')
56+
-subdir('po')
3157

32-
-meson.add_install_script('build-aux/meson_post_install.py')
33-
+if get_option('ui').enabled()
34-
+ meson.add_install_script('build-aux/meson_post_install.py')
35-
+endif
58+
meson.add_install_script('build-aux/meson_post_install.py')

pkgs/development/libraries/malcontent/default.nix

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
, fetchpatch
44
, meson
55
, ninja
6-
, pkgconfig
6+
, pkg-config
77
, gobject-introspection
88
, wrapGAppsHook
99
, glib
@@ -19,16 +19,16 @@
1919

2020
stdenv.mkDerivation rec {
2121
pname = "malcontent";
22-
version = "0.7.0";
22+
version = "0.8.0";
2323

24-
outputs = [ "bin" "out" "dev" "man" "installedTests" ];
24+
outputs = [ "bin" "out" "lib" "pam" "dev" "man" "installedTests" ];
2525

2626
src = fetchFromGitLab {
2727
domain = "gitlab.freedesktop.org";
2828
owner = "pwithnall";
2929
repo = pname;
3030
rev = version;
31-
sha256 = "0lxakzj75pvpgwbjfyfkg0gyzvry00zhc9h9cd8f0wksg7mabzbh";
31+
sha256 = "Y9HzysChzzmKW5PuCLm9AZ4oaBLMpB0I5NyZUOYFzm4=";
3232
};
3333

3434
patches = [
@@ -37,19 +37,12 @@ stdenv.mkDerivation rec {
3737

3838
# Do not build things that are part of malcontent-ui package
3939
./better-separation.patch
40-
41-
# Fix pam installed test
42-
# https://gitlab.freedesktop.org/pwithnall/malcontent/merge_requests/50
43-
(fetchpatch {
44-
url = "https://gitlab.freedesktop.org/pwithnall/malcontent/commit/5d102eeb0604e65fc977ca77d4b249e986e634cc.patch";
45-
sha256 = "1vs35zfp2sa2rps5h1240h73kvlspmv7mfr6f8mcbzvhj1wgzw74";
46-
})
4740
];
4841

4942
nativeBuildInputs = [
5043
meson
5144
ninja
52-
pkgconfig
45+
pkg-config
5346
gobject-introspection
5447
wrapGAppsHook
5548
];
@@ -72,6 +65,7 @@ stdenv.mkDerivation rec {
7265
mesonFlags = [
7366
"-Dinstalled_tests=true"
7467
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
68+
"-Dpamlibdir=${placeholder "pam"}/lib/security"
7569
"-Dui=disabled"
7670
];
7771

@@ -83,13 +77,24 @@ stdenv.mkDerivation rec {
8377
--replace "/bin/false" "${coreutils}/bin/false"
8478
'';
8579

80+
postInstall = ''
81+
# `giDiscoverSelf` only picks up paths in `out` output.
82+
# This needs to be in `postInstall` so that it runs before
83+
# `gappsWrapperArgsHook` that runs as one of `preFixupPhases`.
84+
addToSearchPath GI_TYPELIB_PATH "$lib/lib/girepository-1.0"
85+
'';
86+
8687
passthru = {
8788
tests = {
8889
installedTests = nixosTests.installed-tests.malcontent;
8990
};
9091
};
9192

9293
meta = with stdenv.lib; {
94+
# We need to install Polkit & AccountsService data files in `out`
95+
# but `buildEnv` only uses `bin` when both `bin` and `out` are present.
96+
outputsToInstall = [ "bin" "out" "man" ];
97+
9398
description = "Parental controls library";
9499
homepage = "https://gitlab.freedesktop.org/pwithnall/malcontent";
95100
license = licenses.lgpl21Plus;

pkgs/development/libraries/malcontent/ui.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
, ninja
44
, pkg-config
55
, gobject-introspection
6+
, itstool
67
, wrapGAppsHook
78
, glib
89
, accountsservice
@@ -20,7 +21,7 @@ stdenv.mkDerivation rec {
2021

2122
inherit (malcontent) version src;
2223

23-
outputs = [ "bin" "out" "dev" ];
24+
outputs = [ "out" "lib" "dev" ];
2425

2526
patches = [
2627
# Allow installing installed tests to a separate output.
@@ -35,6 +36,7 @@ stdenv.mkDerivation rec {
3536
ninja
3637
pkg-config
3738
gobject-introspection
39+
itstool
3840
desktop-file-utils
3941
wrapGAppsHook
4042
];

0 commit comments

Comments
 (0)