malcontent: init at 0.4.0

Changed files
+152
nixos
tests
installed-tests
pkgs
+1
nixos/tests/installed-tests/default.nix
···
libgdata = callInstalledTest ./libgdata.nix {};
glib-testing = callInstalledTest ./glib-testing.nix {};
libxmlb = callInstalledTest ./libxmlb.nix {};
ostree = callInstalledTest ./ostree.nix {};
xdg-desktop-portal = callInstalledTest ./xdg-desktop-portal.nix {};
}
···
libgdata = callInstalledTest ./libgdata.nix {};
glib-testing = callInstalledTest ./glib-testing.nix {};
libxmlb = callInstalledTest ./libxmlb.nix {};
+
malcontent = callInstalledTest ./malcontent.nix {};
ostree = callInstalledTest ./ostree.nix {};
xdg-desktop-portal = callInstalledTest ./xdg-desktop-portal.nix {};
}
+5
nixos/tests/installed-tests/malcontent.nix
···
···
+
{ pkgs, makeInstalledTest, ... }:
+
+
makeInstalledTest {
+
tested = pkgs.malcontent;
+
}
+87
pkgs/development/libraries/malcontent/default.nix
···
···
+
{ stdenv
+
, fetchFromGitLab
+
, meson
+
, ninja
+
, pkgconfig
+
, gobject-introspection
+
, wrapGAppsHook
+
, glib
+
, coreutils
+
, dbus
+
, polkit
+
, glib-testing
+
, python3
+
, nixosTests
+
}:
+
+
stdenv.mkDerivation rec {
+
pname = "malcontent";
+
version = "0.4.0";
+
+
outputs = [ "bin" "out" "dev" "man" "installedTests" ];
+
+
src = fetchFromGitLab {
+
domain = "gitlab.freedesktop.org";
+
owner = "pwithnall";
+
repo = pname;
+
rev = version;
+
sha256 = "0d703r20djvrgy711jvn90i8dwbb0p7qj4j43z101afpkiizq810";
+
};
+
+
patches = [
+
# Allow installing installed tests to a separate output.
+
./installed-tests-path.patch
+
+
# This is unnecessary and breaks when submodules are not available.
+
# https://gitlab.freedesktop.org/pwithnall/malcontent/merge_requests/3
+
./use-system-dependencies.patch
+
];
+
+
nativeBuildInputs = [
+
meson
+
ninja
+
pkgconfig
+
gobject-introspection
+
wrapGAppsHook
+
];
+
+
buildInputs = [
+
dbus
+
polkit
+
glib-testing
+
(python3.withPackages (pp: with pp; [
+
pygobject3
+
]))
+
];
+
+
propagatedBuildInputs = [
+
glib
+
];
+
+
mesonFlags = [
+
"-Dinstalled_tests=true"
+
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
+
];
+
+
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;
+
};
+
}
+35
pkgs/development/libraries/malcontent/installed-tests-path.patch
···
···
+
diff --git a/libmalcontent/tests/meson.build b/libmalcontent/tests/meson.build
+
index a8a815a..0b1d242 100644
+
--- a/libmalcontent/tests/meson.build
+
+++ b/libmalcontent/tests/meson.build
+
@@ -61,9 +61,9 @@ test_programs = [
+
], deps],
+
]
+
+
-installed_tests_metadir = join_paths(datadir, 'installed-tests',
+
+installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests',
+
'libmalcontent-' + libmalcontent_api_version)
+
-installed_tests_execdir = join_paths(libexecdir, 'installed-tests',
+
+installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests',
+
'libmalcontent-' + libmalcontent_api_version)
+
+
foreach program: test_programs
+
@@ -94,4 +94,4 @@ foreach program: test_programs
+
env: envs,
+
args: ['--tap'],
+
)
+
-endforeach
+
\ No newline at end of file
+
+endforeach
+
diff --git a/meson_options.txt b/meson_options.txt
+
index 96a517d..7cb1ee8 100644
+
--- a/meson_options.txt
+
+++ b/meson_options.txt
+
@@ -3,4 +3,5 @@ option(
+
type: 'boolean',
+
value: false,
+
description: 'enable installed tests'
+
-)
+
\ No newline at end of file
+
+)
+
+option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests')
+22
pkgs/development/libraries/malcontent/use-system-dependencies.patch
···
···
+
diff --git a/meson.build b/meson.build
+
index f4a05ba..dd31537 100644
+
--- a/meson.build
+
+++ b/meson.build
+
@@ -33,9 +33,8 @@ polkit_gobject = dependency('polkit-gobject-1')
+
polkitpolicydir = polkit_gobject.get_pkgconfig_variable('policydir',
+
define_variable: ['prefix', prefix])
+
+
-libglib_testing = subproject('libglib-testing')
+
libglib_testing_dep = dependency(
+
- 'libglib-testing',
+
+ 'glib-testing-0',
+
fallback: ['libglib-testing', 'libglib_testing_dep'],
+
)
+
+
@@ -120,4 +119,4 @@ test_env = [
+
+
subdir('accounts-service')
+
subdir('malcontent-client')
+
-subdir('libmalcontent')
+
\ No newline at end of file
+
+subdir('libmalcontent')
+2
pkgs/top-level/all-packages.nix
···
libmad = callPackage ../development/libraries/libmad { };
libmanette = callPackage ../development/libraries/libmanette { };
libmatchbox = callPackage ../development/libraries/libmatchbox { };
···
libmad = callPackage ../development/libraries/libmad { };
+
malcontent = callPackage ../development/libraries/malcontent { };
+
libmanette = callPackage ../development/libraries/libmanette { };
libmatchbox = callPackage ../development/libraries/libmatchbox { };