about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2019-08-23 02:06:41 +0200
committerGitHub <noreply@github.com>2019-08-23 02:06:41 +0200
commit91b46353a59e94a7573884427cb818eef00ca5a1 (patch)
treef78da1bc7e9e8c0beab8f08b12c8d6d14686e633
parent1e2497720f6a1b6b5749111ae6f4c990717ac2dd (diff)
parent93f4d6f6ae4e57148607d7ba24103070ab302063 (diff)
downloadnixlib-91b46353a59e94a7573884427cb818eef00ca5a1.tar
nixlib-91b46353a59e94a7573884427cb818eef00ca5a1.tar.gz
nixlib-91b46353a59e94a7573884427cb818eef00ca5a1.tar.bz2
nixlib-91b46353a59e94a7573884427cb818eef00ca5a1.tar.lz
nixlib-91b46353a59e94a7573884427cb818eef00ca5a1.tar.xz
nixlib-91b46353a59e94a7573884427cb818eef00ca5a1.tar.zst
nixlib-91b46353a59e94a7573884427cb818eef00ca5a1.zip
Merge pull request #67308 from jtojnar/libxmlb-0.1.11
libxmlb: 0.1.10 → 0.1.11
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/libxmlb.nix17
-rw-r--r--pkgs/development/libraries/libxmlb/default.nix60
-rw-r--r--pkgs/development/libraries/libxmlb/installed-tests-path.patch24
4 files changed, 95 insertions, 7 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 91c1044b4d8e..b6930cc3a706 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -141,6 +141,7 @@ in
   latestKernel.login = handleTest ./login.nix { latestKernel = true; };
   ldap = handleTest ./ldap.nix {};
   leaps = handleTest ./leaps.nix {};
+  libxmlb = handleTest ./libxmlb.nix {};
   lidarr = handleTest ./lidarr.nix {};
   lightdm = handleTest ./lightdm.nix {};
   limesurvey = handleTest ./limesurvey.nix {};
diff --git a/nixos/tests/libxmlb.nix b/nixos/tests/libxmlb.nix
new file mode 100644
index 000000000000..3bee568ac5a2
--- /dev/null
+++ b/nixos/tests/libxmlb.nix
@@ -0,0 +1,17 @@
+# run installed tests
+import ./make-test.nix ({ pkgs, ... }:
+
+{
+  name = "libxmlb";
+  meta = {
+    maintainers = pkgs.libxmlb.meta.maintainers;
+  };
+
+  machine = { pkgs, ... }: {
+    environment.systemPackages = with pkgs; [ gnome-desktop-testing ];
+  };
+
+  testScript = ''
+    $machine->succeed("gnome-desktop-testing-runner -d '${pkgs.libxmlb.installedTests}/share'");
+  '';
+})
diff --git a/pkgs/development/libraries/libxmlb/default.nix b/pkgs/development/libraries/libxmlb/default.nix
index 9edb9b475e8a..4800a6c405c3 100644
--- a/pkgs/development/libraries/libxmlb/default.nix
+++ b/pkgs/development/libraries/libxmlb/default.nix
@@ -1,25 +1,65 @@
-{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, glib, libuuid, gobject-introspection, gtk-doc, shared-mime-info, python3, docbook_xsl, docbook_xml_dtd_43 }:
+{ stdenv
+, fetchFromGitHub
+, fetchpatch
+, docbook_xml_dtd_43
+, docbook_xsl
+, glib
+, gobject-introspection
+, gtk-doc
+, libuuid
+, meson
+, ninja
+, pkgconfig
+, python3
+, shared-mime-info
+, nixosTests
+}:
 
 stdenv.mkDerivation rec {
-  name = "libxmlb-${version}";
-  version = "0.1.10";
+  pname = "libxmlb";
+  version = "0.1.11";
 
-  outputs = [ "out" "lib" "dev" "devdoc" ];
+  outputs = [ "out" "lib" "dev" "devdoc" "installedTests" ];
 
   src = fetchFromGitHub {
     owner = "hughsie";
     repo = "libxmlb";
     rev = version;
-    sha256 = "1ismh3bdwd0l1fjlhwycam89faxjmpb0wxqlbv58m0z6cxykp6rd";
+    sha256 = "1503v76w7543snqyjxykiqa5va62zb0ccn3jlw0gpdx8973v80mr";
   };
 
-  nativeBuildInputs = [ meson ninja python3 pkgconfig gobject-introspection gtk-doc shared-mime-info docbook_xsl docbook_xml_dtd_43 ];
+  patches = [
+    # Fix installed tests
+    # https://github.com/hughsie/libxmlb/pull/2
+    (fetchpatch {
+      url = "https://github.com/hughsie/libxmlb/commit/78850c8b0f644f729fa21e2bf9ebed0d9d6010f3.diff";
+      sha256 = "0zw7c6vy8hscln7za7ijqd9svirach3zdskvbzyxxcsm3xcwxpjm";
+    })
 
-  buildInputs = [ glib libuuid ];
+    ./installed-tests-path.patch
+  ];
+
+  nativeBuildInputs = [
+    docbook_xml_dtd_43
+    docbook_xsl
+    gobject-introspection
+    gtk-doc
+    meson
+    ninja
+    pkgconfig
+    (python3.withPackages (pkgs: with pkgs; [ setuptools ]))
+    shared-mime-info
+  ];
+
+  buildInputs = [
+    glib
+    libuuid
+  ];
 
   mesonFlags = [
     "--libexecdir=${placeholder "out"}/libexec"
     "-Dgtkdoc=true"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
   ];
 
   preCheck = ''
@@ -28,6 +68,12 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
+  passthru = {
+    tests = {
+      installed-tests = nixosTests.libxmlb;
+    };
+  };
+
   meta = with stdenv.lib; {
     description = "A library to help create and query binary XML blobs";
     homepage = https://github.com/hughsie/libxmlb;
diff --git a/pkgs/development/libraries/libxmlb/installed-tests-path.patch b/pkgs/development/libraries/libxmlb/installed-tests-path.patch
new file mode 100644
index 000000000000..ab36d9efad89
--- /dev/null
+++ b/pkgs/development/libraries/libxmlb/installed-tests-path.patch
@@ -0,0 +1,24 @@
+diff --git a/meson.build b/meson.build
+index b064cb8..1a470cf 100644
+--- a/meson.build
++++ b/meson.build
+@@ -103,8 +103,8 @@
+ 
+ libexecdir = join_paths(prefix, get_option('libexecdir'))
+ datadir = join_paths(prefix, get_option('datadir'))
+-installed_test_bindir = join_paths(libexecdir, 'installed-tests', meson.project_name())
+-installed_test_datadir = join_paths(datadir, 'installed-tests', meson.project_name())
++installed_test_bindir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name())
++installed_test_datadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name())
+ 
+ gio = dependency('gio-2.0', version : '>= 2.45.8')
+ uuid = dependency('uuid')
+diff --git a/meson_options.txt b/meson_options.txt
+index 27e8cb6..74548ae 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -2,3 +2,4 @@
+ option('introspection', type : 'boolean', value : true, description : 'generate GObject Introspection data')
+ option('tests', type : 'boolean', value : true, description : 'enable tests')
+ option('stemmer', type : 'boolean', value : false, description : 'enable stemmer support')
++option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests')