about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2020-02-08 04:36:49 +0100
committerworldofpeace <worldofpeace@protonmail.ch>2020-02-10 12:55:24 -0500
commitea06e0055e942038569cedc218e1e1e0706dac78 (patch)
tree5435e002f39e24ac7e6d5e9887cb5db8f26d6fb4 /pkgs
parentf9bc083256e425707bdac986ad2b7f609b300b42 (diff)
downloadnixlib-ea06e0055e942038569cedc218e1e1e0706dac78.tar
nixlib-ea06e0055e942038569cedc218e1e1e0706dac78.tar.gz
nixlib-ea06e0055e942038569cedc218e1e1e0706dac78.tar.bz2
nixlib-ea06e0055e942038569cedc218e1e1e0706dac78.tar.lz
nixlib-ea06e0055e942038569cedc218e1e1e0706dac78.tar.xz
nixlib-ea06e0055e942038569cedc218e1e1e0706dac78.tar.zst
nixlib-ea06e0055e942038569cedc218e1e1e0706dac78.zip
glib-testing: init at 0.1.0
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/glib-testing/default.nix63
-rw-r--r--pkgs/development/libraries/glib-testing/installed-tests-path.patch32
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 97 insertions, 0 deletions
diff --git a/pkgs/development/libraries/glib-testing/default.nix b/pkgs/development/libraries/glib-testing/default.nix
new file mode 100644
index 000000000000..085dfc7344f5
--- /dev/null
+++ b/pkgs/development/libraries/glib-testing/default.nix
@@ -0,0 +1,63 @@
+{ stdenv
+, fetchFromGitLab
+, meson
+, ninja
+, pkgconfig
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, glib
+, nixosTests
+}:
+
+stdenv.mkDerivation rec {
+  pname = "glib-testing";
+  version = "0.1.0";
+
+  outputs = [ "out" "dev" "devdoc" "installedTests" ];
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "pwithnall";
+    repo = "libglib-testing";
+    rev = version;
+    sha256 = "0xmycsrlqyji6sc2i4wvp2gxf3897z65a57ygihfnpjpyl7zlwkr";
+  };
+
+  patches = [
+    # allow installing installed tests to a separate output
+    ./installed-tests-path.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkgconfig
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+  ];
+
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  mesonFlags = [
+    "-Dinstalled_tests=true"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+  ];
+
+  passthru = {
+    tests = {
+      installedTests = nixosTests.installed-tests.glib-testing;
+    };
+  };
+
+  meta = with stdenv.lib; {
+    description = "Test library providing test harnesses and mock classes complementing the classes provided by GLib";
+    homepage = "https://gitlab.gnome.org/pwithnall/libglib-testing";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/glib-testing/installed-tests-path.patch b/pkgs/development/libraries/glib-testing/installed-tests-path.patch
new file mode 100644
index 000000000000..37ee2a988899
--- /dev/null
+++ b/pkgs/development/libraries/glib-testing/installed-tests-path.patch
@@ -0,0 +1,32 @@
+diff --git a/libglib-testing/tests/meson.build b/libglib-testing/tests/meson.build
+index 4789c63..2b8525d 100644
+--- a/libglib-testing/tests/meson.build
++++ b/libglib-testing/tests/meson.build
+@@ -15,9 +15,9 @@ test_programs = [
+   ['signal-logger', [], deps],
+ ]
+ 
+-installed_tests_metadir = join_paths(datadir, 'installed-tests',
++installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests',
+                                      'libglib-testing-' + libglib_testing_api_version)
+-installed_tests_execdir = join_paths(libexecdir, 'installed-tests',
++installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests',
+                                      'libglib-testing-' + libglib_testing_api_version)
+ 
+ foreach program: test_programs
+@@ -48,4 +48,4 @@ foreach program: test_programs
+     exe,
+     env: envs,
+   )
+-endforeach
+\ No newline at end of file
++endforeach
+diff --git a/meson_options.txt b/meson_options.txt
+index e69263e..7cb1ee8 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -4,3 +4,4 @@ option(
+   value: false,
+   description: 'enable installed tests'
+ )
++option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests')
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index e54e0102e440..d36b0a9d03f1 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -11738,6 +11738,8 @@ in
 
   glib-networking = callPackage ../development/libraries/glib-networking {};
 
+  glib-testing = callPackage ../development/libraries/glib-testing { };
+
   glirc = haskell.lib.justStaticExecutables haskellPackages.glirc;
 
   gom = callPackage ../development/libraries/gom { };