malcontent: init at 0.4.0

authored by Jan Tojnar and committed by worldofpeace 102fa4aa ea06e005

+152
+1
nixos/tests/installed-tests/default.nix
··· 92 92 libgdata = callInstalledTest ./libgdata.nix {}; 93 93 glib-testing = callInstalledTest ./glib-testing.nix {}; 94 94 libxmlb = callInstalledTest ./libxmlb.nix {}; 95 + malcontent = callInstalledTest ./malcontent.nix {}; 95 96 ostree = callInstalledTest ./ostree.nix {}; 96 97 xdg-desktop-portal = callInstalledTest ./xdg-desktop-portal.nix {}; 97 98 }
+5
nixos/tests/installed-tests/malcontent.nix
··· 1 + { pkgs, makeInstalledTest, ... }: 2 + 3 + makeInstalledTest { 4 + tested = pkgs.malcontent; 5 + }
+87
pkgs/development/libraries/malcontent/default.nix
··· 1 + { stdenv 2 + , fetchFromGitLab 3 + , meson 4 + , ninja 5 + , pkgconfig 6 + , gobject-introspection 7 + , wrapGAppsHook 8 + , glib 9 + , coreutils 10 + , dbus 11 + , polkit 12 + , glib-testing 13 + , python3 14 + , nixosTests 15 + }: 16 + 17 + stdenv.mkDerivation rec { 18 + pname = "malcontent"; 19 + version = "0.4.0"; 20 + 21 + outputs = [ "bin" "out" "dev" "man" "installedTests" ]; 22 + 23 + src = fetchFromGitLab { 24 + domain = "gitlab.freedesktop.org"; 25 + owner = "pwithnall"; 26 + repo = pname; 27 + rev = version; 28 + sha256 = "0d703r20djvrgy711jvn90i8dwbb0p7qj4j43z101afpkiizq810"; 29 + }; 30 + 31 + patches = [ 32 + # Allow installing installed tests to a separate output. 33 + ./installed-tests-path.patch 34 + 35 + # This is unnecessary and breaks when submodules are not available. 36 + # https://gitlab.freedesktop.org/pwithnall/malcontent/merge_requests/3 37 + ./use-system-dependencies.patch 38 + ]; 39 + 40 + nativeBuildInputs = [ 41 + meson 42 + ninja 43 + pkgconfig 44 + gobject-introspection 45 + wrapGAppsHook 46 + ]; 47 + 48 + buildInputs = [ 49 + dbus 50 + polkit 51 + glib-testing 52 + (python3.withPackages (pp: with pp; [ 53 + pygobject3 54 + ])) 55 + ]; 56 + 57 + propagatedBuildInputs = [ 58 + glib 59 + ]; 60 + 61 + mesonFlags = [ 62 + "-Dinstalled_tests=true" 63 + "-Dinstalled_test_prefix=${placeholder "installedTests"}" 64 + ]; 65 + 66 + postPatch = '' 67 + substituteInPlace libmalcontent/tests/app-filter.c \ 68 + --replace "/usr/bin/true" "${coreutils}/bin/true" \ 69 + --replace "/bin/true" "${coreutils}/bin/true" \ 70 + --replace "/usr/bin/false" "${coreutils}/bin/false" \ 71 + --replace "/bin/false" "${coreutils}/bin/false" 72 + ''; 73 + 74 + passthru = { 75 + tests = { 76 + installedTests = nixosTests.installed-tests.malcontent; 77 + }; 78 + }; 79 + 80 + meta = with stdenv.lib; { 81 + description = "Parental controls library"; 82 + homepage = "https://gitlab.freedesktop.org/pwithnall/malcontent"; 83 + license = licenses.lgpl21Plus; 84 + maintainers = with maintainers; [ jtojnar ]; 85 + platforms = platforms.unix; 86 + }; 87 + }
+35
pkgs/development/libraries/malcontent/installed-tests-path.patch
··· 1 + diff --git a/libmalcontent/tests/meson.build b/libmalcontent/tests/meson.build 2 + index a8a815a..0b1d242 100644 3 + --- a/libmalcontent/tests/meson.build 4 + +++ b/libmalcontent/tests/meson.build 5 + @@ -61,9 +61,9 @@ test_programs = [ 6 + ], deps], 7 + ] 8 + 9 + -installed_tests_metadir = join_paths(datadir, 'installed-tests', 10 + +installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', 11 + 'libmalcontent-' + libmalcontent_api_version) 12 + -installed_tests_execdir = join_paths(libexecdir, 'installed-tests', 13 + +installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', 14 + 'libmalcontent-' + libmalcontent_api_version) 15 + 16 + foreach program: test_programs 17 + @@ -94,4 +94,4 @@ foreach program: test_programs 18 + env: envs, 19 + args: ['--tap'], 20 + ) 21 + -endforeach 22 + \ No newline at end of file 23 + +endforeach 24 + diff --git a/meson_options.txt b/meson_options.txt 25 + index 96a517d..7cb1ee8 100644 26 + --- a/meson_options.txt 27 + +++ b/meson_options.txt 28 + @@ -3,4 +3,5 @@ option( 29 + type: 'boolean', 30 + value: false, 31 + description: 'enable installed tests' 32 + -) 33 + \ No newline at end of file 34 + +) 35 + +option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests')
+22
pkgs/development/libraries/malcontent/use-system-dependencies.patch
··· 1 + diff --git a/meson.build b/meson.build 2 + index f4a05ba..dd31537 100644 3 + --- a/meson.build 4 + +++ b/meson.build 5 + @@ -33,9 +33,8 @@ polkit_gobject = dependency('polkit-gobject-1') 6 + polkitpolicydir = polkit_gobject.get_pkgconfig_variable('policydir', 7 + define_variable: ['prefix', prefix]) 8 + 9 + -libglib_testing = subproject('libglib-testing') 10 + libglib_testing_dep = dependency( 11 + - 'libglib-testing', 12 + + 'glib-testing-0', 13 + fallback: ['libglib-testing', 'libglib_testing_dep'], 14 + ) 15 + 16 + @@ -120,4 +119,4 @@ test_env = [ 17 + 18 + subdir('accounts-service') 19 + subdir('malcontent-client') 20 + -subdir('libmalcontent') 21 + \ No newline at end of file 22 + +subdir('libmalcontent')
+2
pkgs/top-level/all-packages.nix
··· 12774 12774 12775 12775 libmad = callPackage ../development/libraries/libmad { }; 12776 12776 12777 + malcontent = callPackage ../development/libraries/malcontent { }; 12778 + 12777 12779 libmanette = callPackage ../development/libraries/libmanette { }; 12778 12780 12779 12781 libmatchbox = callPackage ../development/libraries/libmatchbox { };