2020-02-08 06:16:13 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitLab
|
2020-03-26 03:36:44 +01:00
|
|
|
, fetchpatch
|
2020-02-08 06:16:13 +01:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkgconfig
|
|
|
|
, gobject-introspection
|
|
|
|
, wrapGAppsHook
|
|
|
|
, glib
|
|
|
|
, coreutils
|
2020-02-28 10:36:56 +01:00
|
|
|
, accountsservice
|
2020-02-08 06:16:13 +01:00
|
|
|
, dbus
|
2020-02-28 10:36:56 +01:00
|
|
|
, pam
|
2020-02-08 06:16:13 +01:00
|
|
|
, polkit
|
|
|
|
, glib-testing
|
|
|
|
, python3
|
|
|
|
, nixosTests
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "malcontent";
|
2020-03-26 02:06:00 +01:00
|
|
|
version = "0.7.0";
|
2020-02-08 06:16:13 +01:00
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" "man" "installedTests" ];
|
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
owner = "pwithnall";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-03-26 02:06:00 +01:00
|
|
|
sha256 = "cP2l6nl6cuBQYwkmBj8APu/vH3jTeScXf3ffcuSfqlM=";
|
2020-02-08 06:16:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Allow installing installed tests to a separate output.
|
|
|
|
./installed-tests-path.patch
|
2020-03-26 02:02:20 +01:00
|
|
|
|
|
|
|
# Do not build things that are part of malcontent-ui package
|
|
|
|
./better-separation.patch
|
2020-03-26 03:36:44 +01:00
|
|
|
|
|
|
|
# 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 = "5PD/eJBw/8Uqcia7ena9mu45DgREBFj0zUJpcd0vQ+8=";
|
|
|
|
})
|
2020-02-08 06:16:13 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkgconfig
|
|
|
|
gobject-introspection
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2020-02-28 10:36:56 +01:00
|
|
|
accountsservice
|
2020-02-08 06:16:13 +01:00
|
|
|
dbus
|
2020-02-28 10:36:56 +01:00
|
|
|
pam
|
2020-02-08 06:16:13 +01:00
|
|
|
polkit
|
|
|
|
glib-testing
|
|
|
|
(python3.withPackages (pp: with pp; [
|
|
|
|
pygobject3
|
|
|
|
]))
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
glib
|
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dinstalled_tests=true"
|
|
|
|
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
|
2020-03-26 02:02:20 +01:00
|
|
|
"-Dui=disabled"
|
2020-02-08 06:16:13 +01: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"
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
installedTests = nixosTests.installed-tests.malcontent;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Parental controls library";
|
|
|
|
homepage = "https://gitlab.freedesktop.org/pwithnall/malcontent";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|