summary refs log tree commit diff
path: root/pkgs/desktops/gnome-3
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2018-02-14 22:19:56 +0100
committerJan Tojnar <jtojnar@gmail.com>2018-02-14 22:43:59 +0100
commit7713889556b013ef109c35be7fccb378a4f13b6d (patch)
tree0712d8a6df5a95cc871638f0aea0b788dc8fb7ed /pkgs/desktops/gnome-3
parentb2238b7383ed9cc1c53494235116b32e841c2ea2 (diff)
downloadnixlib-7713889556b013ef109c35be7fccb378a4f13b6d.tar
nixlib-7713889556b013ef109c35be7fccb378a4f13b6d.tar.gz
nixlib-7713889556b013ef109c35be7fccb378a4f13b6d.tar.bz2
nixlib-7713889556b013ef109c35be7fccb378a4f13b6d.tar.lz
nixlib-7713889556b013ef109c35be7fccb378a4f13b6d.tar.xz
nixlib-7713889556b013ef109c35be7fccb378a4f13b6d.tar.zst
nixlib-7713889556b013ef109c35be7fccb378a4f13b6d.zip
nixos/gjs: add test
Diffstat (limited to 'pkgs/desktops/gnome-3')
-rw-r--r--pkgs/desktops/gnome-3/core/gjs/default.nix25
1 files changed, 22 insertions, 3 deletions
diff --git a/pkgs/desktops/gnome-3/core/gjs/default.nix b/pkgs/desktops/gnome-3/core/gjs/default.nix
index deba5d47fd26..e2ae74931030 100644
--- a/pkgs/desktops/gnome-3/core/gjs/default.nix
+++ b/pkgs/desktops/gnome-3/core/gjs/default.nix
@@ -1,16 +1,35 @@
-{ fetchurl, stdenv, pkgconfig, gnome3, gtk3, gobjectIntrospection
-, spidermonkey_52, pango, readline, glib, libxml2, dbus }:
+{ fetchurl, stdenv, pkgconfig, gnome3, gtk3, atk, gobjectIntrospection
+, spidermonkey_52, pango, readline, glib, libxml2, dbus, gdk_pixbuf
+, makeWrapper }:
 
 stdenv.mkDerivation rec {
   inherit (import ./src.nix fetchurl) name src;
 
-  nativeBuildInputs = [ pkgconfig ];
+  outputs = [ "out" "installedTests" ];
+
+  nativeBuildInputs = [ pkgconfig makeWrapper ];
   buildInputs = [ libxml2 gobjectIntrospection gtk3 glib pango readline dbus ];
 
   propagatedBuildInputs = [ spidermonkey_52 ];
 
+  configureFlags = [
+    "--enable-installed-tests"
+  ];
+
+  postPatch = ''
+    for f in installed-tests/*.test.in; do
+      substituteInPlace "$f" --subst-var-by pkglibexecdir "$installedTests/libexec/gjs"
+    done
+  '';
+
   postInstall = ''
     sed 's|-lreadline|-L${readline.out}/lib -lreadline|g' -i $out/lib/libgjs.la
+
+    moveToOutput "share/installed-tests" "$installedTests"
+    moveToOutput "libexec/gjs/installed-tests" "$installedTests"
+
+    wrapProgram "$installedTests/libexec/gjs/installed-tests/minijasmine" \
+      --prefix GI_TYPELIB_PATH : "${stdenv.lib.makeSearchPath "lib/girepository-1.0" [ gtk3 atk pango.out gdk_pixbuf ]}:$installedTests/libexec/gjs/installed-tests"
   '';
 
   meta = with stdenv.lib; {