malcontent: init at 0.4.0

This commit is contained in:
Jan Tojnar 2020-02-08 06:16:13 +01:00 committed by worldofpeace
parent ea06e0055e
commit 102fa4aaec
6 changed files with 152 additions and 0 deletions

View File

@ -92,6 +92,7 @@ in
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 {};
}

View File

@ -0,0 +1,5 @@
{ pkgs, makeInstalledTest, ... }:
makeInstalledTest {
tested = pkgs.malcontent;
}

View File

@ -0,0 +1,87 @@
{ 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;
};
}

View File

@ -0,0 +1,35 @@
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')

View File

@ -0,0 +1,22 @@
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')

View File

@ -12774,6 +12774,8 @@ in
libmad = callPackage ../development/libraries/libmad { };
malcontent = callPackage ../development/libraries/malcontent { };
libmanette = callPackage ../development/libraries/libmanette { };
libmatchbox = callPackage ../development/libraries/libmatchbox { };