2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2020-02-08 05:16:13 +00:00
|
|
|
, fetchFromGitLab
|
2020-03-26 02:36:44 +00:00
|
|
|
, fetchpatch
|
2020-02-08 05:16:13 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
2020-07-23 18:34:12 +01:00
|
|
|
, pkg-config
|
2020-02-08 05:16:13 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, wrapGAppsHook
|
|
|
|
, glib
|
|
|
|
, coreutils
|
2020-02-28 09:36:56 +00:00
|
|
|
, accountsservice
|
2020-02-08 05:16:13 +00:00
|
|
|
, dbus
|
2020-02-28 09:36:56 +00:00
|
|
|
, pam
|
2020-02-08 05:16:13 +00:00
|
|
|
, polkit
|
|
|
|
, glib-testing
|
|
|
|
, python3
|
|
|
|
, nixosTests
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "malcontent";
|
2020-12-12 13:53:08 +00:00
|
|
|
version = "0.10.0";
|
2020-02-08 05:16:13 +00:00
|
|
|
|
2020-07-23 18:34:12 +01:00
|
|
|
outputs = [ "bin" "out" "lib" "pam" "dev" "man" "installedTests" ];
|
2020-02-08 05:16:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
owner = "pwithnall";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-12-12 13:53:08 +00:00
|
|
|
sha256 = "1b6rgf7h9gj2kw1b7ba0mvhsb89riwf9p4pviqjfzd1i5nmbmnyx";
|
2020-02-08 05:16:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Allow installing installed tests to a separate output.
|
|
|
|
./installed-tests-path.patch
|
2020-03-26 01:02:20 +00:00
|
|
|
|
|
|
|
# Do not build things that are part of malcontent-ui package
|
|
|
|
./better-separation.patch
|
2020-02-08 05:16:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
2020-07-23 18:34:12 +01:00
|
|
|
pkg-config
|
2020-02-08 05:16:13 +00:00
|
|
|
gobject-introspection
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2020-02-28 09:36:56 +00:00
|
|
|
accountsservice
|
2020-02-08 05:16:13 +00:00
|
|
|
dbus
|
2020-02-28 09:36:56 +00:00
|
|
|
pam
|
2020-02-08 05:16:13 +00:00
|
|
|
polkit
|
|
|
|
glib-testing
|
|
|
|
(python3.withPackages (pp: with pp; [
|
|
|
|
pygobject3
|
|
|
|
]))
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
glib
|
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dinstalled_tests=true"
|
|
|
|
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
|
2020-07-23 18:34:12 +01:00
|
|
|
"-Dpamlibdir=${placeholder "pam"}/lib/security"
|
2020-03-26 01:02:20 +00:00
|
|
|
"-Dui=disabled"
|
2020-02-08 05:16:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace libmalcontent/tests/app-filter.c \
|
|
|
|
--replace "/usr/bin/true" "${coreutils}/bin/true" \
|
|
|
|
--replace "/bin/true" "${coreutils}/bin/true" \
|
|
|
|
--replace "/usr/bin/false" "${coreutils}/bin/false" \
|
|
|
|
--replace "/bin/false" "${coreutils}/bin/false"
|
|
|
|
'';
|
|
|
|
|
2020-07-23 18:34:12 +01:00
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
2020-02-08 05:16:13 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
installedTests = nixosTests.installed-tests.malcontent;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2020-07-23 18:34:12 +01:00
|
|
|
# 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" ];
|
|
|
|
|
2020-02-08 05:16:13 +00:00
|
|
|
description = "Parental controls library";
|
|
|
|
homepage = "https://gitlab.freedesktop.org/pwithnall/malcontent";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|