summary refs log tree commit diff
path: root/pkgs/development/libraries/glib-networking/default.nix
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2019-09-02 19:06:54 +0200
committerJan Tojnar <jtojnar@gmail.com>2019-09-03 16:11:38 +0200
commitecf6f4aeb1f82d869a52a1cf414a6b02caec1538 (patch)
tree6150dd40d9d7e4cc299ad765276d159a6f016c8d /pkgs/development/libraries/glib-networking/default.nix
parentce4036177bfb716cdc89d565c5dd57fac7b2116a (diff)
downloadnixpkgs-ecf6f4aeb1f82d869a52a1cf414a6b02caec1538.tar
nixpkgs-ecf6f4aeb1f82d869a52a1cf414a6b02caec1538.tar.gz
nixpkgs-ecf6f4aeb1f82d869a52a1cf414a6b02caec1538.tar.bz2
nixpkgs-ecf6f4aeb1f82d869a52a1cf414a6b02caec1538.tar.lz
nixpkgs-ecf6f4aeb1f82d869a52a1cf414a6b02caec1538.tar.xz
nixpkgs-ecf6f4aeb1f82d869a52a1cf414a6b02caec1538.tar.zst
nixpkgs-ecf6f4aeb1f82d869a52a1cf414a6b02caec1538.zip
glib-networking: add installed tests
Diffstat (limited to 'pkgs/development/libraries/glib-networking/default.nix')
-rw-r--r--pkgs/development/libraries/glib-networking/default.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/development/libraries/glib-networking/default.nix b/pkgs/development/libraries/glib-networking/default.nix
index 21fbd94d1bc..ae386f46bff 100644
--- a/pkgs/development/libraries/glib-networking/default.nix
+++ b/pkgs/development/libraries/glib-networking/default.nix
@@ -3,9 +3,11 @@
 , substituteAll
 , meson
 , ninja
+, nixosTests
 , pkgconfig
 , glib
 , gettext
+, makeWrapper
 , python3
 , gnutls
 , p11-kit
@@ -18,6 +20,8 @@ stdenv.mkDerivation rec {
   pname = "glib-networking";
   version = "2.60.3";
 
+  outputs = [ "out" "installedTests" ];
+
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1mfw44qpmwvz6yzj8c6spx6z357wrmkk15byrkc5byagd82860fm";
@@ -28,6 +32,8 @@ stdenv.mkDerivation rec {
       src = ./hardcode-gsettings.patch;
       gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas;
     })
+
+    ./installed-tests-path.patch
   ];
 
   postPatch = ''
@@ -40,6 +46,7 @@ stdenv.mkDerivation rec {
     ninja
     pkgconfig
     gettext
+    makeWrapper
     python3 # for install_script
   ];
 
@@ -53,10 +60,27 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # tests need to access the certificates (among other things)
 
+  mesonFlags = [
+    "-Dinstalled_tests=true"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+  ];
+
+  postFixup = ''
+    find "$installedTests/libexec" "$out/libexec" -type f -executable -print0 \
+      | while IFS= read -r -d "" file; do
+      echo "Wrapping program '$file'"
+      wrapProgram "$file" --prefix GIO_EXTRA_MODULES : "$out/lib/gio/modules"
+    done
+  '';
+
   passthru = {
     updateScript = gnome3.updateScript {
       packageName = pname;
     };
+
+    tests = {
+      installedTests = nixosTests.glib-networking;
+    };
   };
 
   meta = with stdenv.lib; {