about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/malcontent
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-04-27 21:04:56 +0000
committerAlyssa Ross <hi@alyssa.is>2020-04-27 21:04:56 +0000
commita4e6c7d26af697f4346cacb7ab18dcd7fcfc056e (patch)
tree47950e79183035018882419c4eff5047d1537b99 /nixpkgs/pkgs/development/libraries/malcontent
parent5b00523fb58512232b819a301c4309f579c7f09c (diff)
parent22a3bf9fb9edad917fb6cd1066d58b5e426ee975 (diff)
downloadnixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.tar
nixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.tar.gz
nixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.tar.bz2
nixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.tar.lz
nixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.tar.xz
nixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.tar.zst
nixlib-a4e6c7d26af697f4346cacb7ab18dcd7fcfc056e.zip
Merge commit '22a3bf9fb9edad917fb6cd1066d58b5e426ee975'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/malcontent')
-rw-r--r--nixpkgs/pkgs/development/libraries/malcontent/better-separation.patch35
-rw-r--r--nixpkgs/pkgs/development/libraries/malcontent/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/malcontent/installed-tests-path.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/malcontent/ui.nix70
-rw-r--r--nixpkgs/pkgs/development/libraries/malcontent/use-system-dependencies.patch15
5 files changed, 125 insertions, 30 deletions
diff --git a/nixpkgs/pkgs/development/libraries/malcontent/better-separation.patch b/nixpkgs/pkgs/development/libraries/malcontent/better-separation.patch
new file mode 100644
index 000000000000..cd91760bff59
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/malcontent/better-separation.patch
@@ -0,0 +1,35 @@
+diff --git a/meson.build b/meson.build
+index a6c477d..f7b2f0a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -125,8 +125,8 @@ test_env = [
+   'LC_ALL=C.UTF-8',
+ ]
+ 
+-subdir('accounts-service')
+ if not get_option('use_system_libmalcontent')
++  subdir('accounts-service')
+   subdir('libmalcontent')
+ else
+   libmalcontent_api_version = '0'
+@@ -137,11 +137,17 @@ endif
+ if get_option('ui').enabled()
+   subdir('libmalcontent-ui')
+ endif
+-subdir('malcontent-client')
++if not get_option('use_system_libmalcontent')
++  subdir('malcontent-client')
++endif
+ if get_option('ui').enabled()
+   subdir('malcontent-control')
+ endif
+-subdir('pam')
++if not get_option('use_system_libmalcontent')
++  subdir('pam')
++endif
+ subdir('po')
+ 
+-meson.add_install_script('build-aux/meson_post_install.py')
++if get_option('ui').enabled()
++  meson.add_install_script('build-aux/meson_post_install.py')
++endif
diff --git a/nixpkgs/pkgs/development/libraries/malcontent/default.nix b/nixpkgs/pkgs/development/libraries/malcontent/default.nix
index bd8988390c91..bf2ec7725072 100644
--- a/nixpkgs/pkgs/development/libraries/malcontent/default.nix
+++ b/nixpkgs/pkgs/development/libraries/malcontent/default.nix
@@ -1,5 +1,6 @@
 { stdenv
 , fetchFromGitLab
+, fetchpatch
 , meson
 , ninja
 , pkgconfig
@@ -9,10 +10,7 @@
 , coreutils
 , accountsservice
 , dbus
-, flatpak
-, gtk3
 , pam
-, desktop-file-utils
 , polkit
 , glib-testing
 , python3
@@ -21,7 +19,7 @@
 
 stdenv.mkDerivation rec {
   pname = "malcontent";
-  version = "0.6.0";
+  version = "0.7.0";
 
   outputs = [ "bin" "out" "dev" "man" "installedTests" ];
 
@@ -30,16 +28,22 @@ stdenv.mkDerivation rec {
     owner = "pwithnall";
     repo = pname;
     rev = version;
-    sha256 = "COh6N3CmLIcxx6tW4jcP0m6TZv0Z1YJUM/nlG0RzYHQ=";
+    sha256 = "cP2l6nl6cuBQYwkmBj8APu/vH3jTeScXf3ffcuSfqlM=";
   };
 
   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
+    # Do not build things that are part of malcontent-ui package
+    ./better-separation.patch
+
+    # 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=";
+    })
   ];
 
   nativeBuildInputs = [
@@ -47,15 +51,12 @@ stdenv.mkDerivation rec {
     ninja
     pkgconfig
     gobject-introspection
-    desktop-file-utils
     wrapGAppsHook
   ];
 
   buildInputs = [
     accountsservice
     dbus
-    flatpak
-    gtk3
     pam
     polkit
     glib-testing
@@ -71,6 +72,7 @@ stdenv.mkDerivation rec {
   mesonFlags = [
     "-Dinstalled_tests=true"
     "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+    "-Dui=disabled"
   ];
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/development/libraries/malcontent/installed-tests-path.patch b/nixpkgs/pkgs/development/libraries/malcontent/installed-tests-path.patch
index ac87ddf6ccbe..5d26c0f864f8 100644
--- a/nixpkgs/pkgs/development/libraries/malcontent/installed-tests-path.patch
+++ b/nixpkgs/pkgs/development/libraries/malcontent/installed-tests-path.patch
@@ -22,12 +22,12 @@ index 610bc35..13e0713 100644
 \ No newline at end of file
 +endforeach
 diff --git a/meson_options.txt b/meson_options.txt
-index 06329d4..72aa505 100644
+index d516c70..583cb94 100644
 --- a/meson_options.txt
 +++ b/meson_options.txt
-@@ -9,3 +9,9 @@ option(
-   type: 'string',
-   description: 'directory for PAM modules'
+@@ -4,6 +4,12 @@ option(
+   value: false,
+   description: 'enable installed tests'
  )
 +option(
 +  'installed_test_prefix',
@@ -35,6 +35,9 @@ index 06329d4..72aa505 100644
 +  value: '',
 +  description: 'Prefix for installed tests'
 +)
+ option(
+   'pamlibdir',
+   type: 'string',
 diff --git a/pam/tests/meson.build b/pam/tests/meson.build
 index 0560dcb..a74dab2 100644
 --- a/pam/tests/meson.build
diff --git a/nixpkgs/pkgs/development/libraries/malcontent/ui.nix b/nixpkgs/pkgs/development/libraries/malcontent/ui.nix
new file mode 100644
index 000000000000..af1fa6b41387
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/malcontent/ui.nix
@@ -0,0 +1,70 @@
+{ stdenv
+, meson
+, ninja
+, pkg-config
+, gobject-introspection
+, wrapGAppsHook
+, glib
+, accountsservice
+, dbus
+, flatpak
+, malcontent
+, gtk3
+, desktop-file-utils
+, polkit
+, glib-testing
+}:
+
+stdenv.mkDerivation rec {
+  pname = "malcontent-ui";
+
+  inherit (malcontent) version src;
+
+  outputs = [ "bin" "out" "dev" ];
+
+  patches = [
+    # Allow installing installed tests to a separate output.
+    ./installed-tests-path.patch
+
+    # Do not build things that are part of malcontent package
+    ./better-separation.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gobject-introspection
+    desktop-file-utils
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    dbus
+    polkit
+    glib-testing
+    flatpak
+  ];
+
+  propagatedBuildInputs = [
+    accountsservice
+    malcontent
+    glib
+    gtk3
+  ];
+
+  mesonFlags = [
+    "-Dinstalled_tests=true"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+    "-Duse_system_libmalcontent=true"
+    "-Dui=enabled"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "UI components for parental controls library";
+    homepage = "https://gitlab.freedesktop.org/pwithnall/malcontent";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/malcontent/use-system-dependencies.patch b/nixpkgs/pkgs/development/libraries/malcontent/use-system-dependencies.patch
deleted file mode 100644
index 8920b1f4a999..000000000000
--- a/nixpkgs/pkgs/development/libraries/malcontent/use-system-dependencies.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/meson.build b/meson.build
-index 3575224..0abea63 100644
---- a/meson.build
-+++ b/meson.build
-@@ -40,9 +40,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'],
- )
-