Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 fetchFromGitLab, 5 meson, 6 ninja, 7 pkg-config, 8 gobject-introspection, 9 wrapGAppsNoGuiHook, 10 glib, 11 coreutils, 12 accountsservice, 13 dbus, 14 pam, 15 polkit, 16 glib-testing, 17 python3, 18 nixosTests, 19 malcontent-ui, 20}: 21 22stdenv.mkDerivation rec { 23 pname = "malcontent"; 24 version = "0.13.0"; 25 26 outputs = [ 27 "bin" 28 "out" 29 "lib" 30 "pam" 31 "dev" 32 "man" 33 "installedTests" 34 ]; 35 36 src = fetchFromGitLab { 37 domain = "gitlab.freedesktop.org"; 38 owner = "pwithnall"; 39 repo = "malcontent"; 40 rev = version; 41 hash = "sha256-DVoTJrpXk5AoRMz+TxEP3NIAA/OOGRzZurLyGp0UBUo="; 42 }; 43 44 patches = [ 45 # Allow installing installed tests to a separate output. 46 ./installed-tests-path.patch 47 48 # Do not build things that are part of malcontent-ui package 49 ./better-separation.patch 50 ]; 51 52 nativeBuildInputs = [ 53 meson 54 ninja 55 pkg-config 56 gobject-introspection 57 wrapGAppsNoGuiHook 58 ]; 59 60 buildInputs = [ 61 accountsservice 62 dbus 63 pam 64 polkit 65 glib-testing 66 (python3.withPackages ( 67 pp: with pp; [ 68 pygobject3 69 ] 70 )) 71 ]; 72 73 propagatedBuildInputs = [ 74 glib 75 ]; 76 77 mesonFlags = [ 78 "-Dinstalled_tests=true" 79 "-Dinstalled_test_prefix=${placeholder "installedTests"}" 80 "-Dpamlibdir=${placeholder "pam"}/lib/security" 81 "-Dui=disabled" 82 ]; 83 84 postPatch = '' 85 substituteInPlace libmalcontent/tests/app-filter.c \ 86 --replace-fail "/usr/bin/true" "${coreutils}/bin/true" \ 87 --replace-fail "/bin/true" "${coreutils}/bin/true" \ 88 --replace-fail "/usr/bin/false" "${coreutils}/bin/false" \ 89 --replace-fail "/bin/false" "${coreutils}/bin/false" 90 ''; 91 92 postInstall = '' 93 # `giDiscoverSelf` only picks up paths in `out` output. 94 # This needs to be in `postInstall` so that it runs before 95 # `gappsWrapperArgsHook` that runs as one of `preFixupPhases`. 96 addToSearchPath GI_TYPELIB_PATH "$lib/lib/girepository-1.0" 97 ''; 98 99 passthru = { 100 tests = { 101 installedTests = nixosTests.installed-tests.malcontent; 102 inherit malcontent-ui; 103 }; 104 }; 105 106 meta = with lib; { 107 # We need to install Polkit & AccountsService data files in `out` 108 # but `buildEnv` only uses `bin` when both `bin` and `out` are present. 109 outputsToInstall = [ 110 "bin" 111 "out" 112 "man" 113 ]; 114 115 description = "Parental controls library"; 116 mainProgram = "malcontent-client"; 117 homepage = "https://gitlab.freedesktop.org/pwithnall/malcontent"; 118 license = licenses.lgpl21Plus; 119 maintainers = with maintainers; [ jtojnar ]; 120 inherit (polkit.meta) platforms badPlatforms; 121 }; 122}