From 5f94da02857861966ffc085af3428c7747835917 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Dec 2017 07:06:21 +0100 Subject: [PATCH] gnome3.gtksourceview: enable tests --- .../gnome-3/core/gtksourceview/default.nix | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/pkgs/desktops/gnome-3/core/gtksourceview/default.nix b/pkgs/desktops/gnome-3/core/gtksourceview/default.nix index 642f687a5c7..7d3d43f5af0 100644 --- a/pkgs/desktops/gnome-3/core/gtksourceview/default.nix +++ b/pkgs/desktops/gnome-3/core/gtksourceview/default.nix @@ -1,13 +1,20 @@ { stdenv, fetchurl, pkgconfig, atk, cairo, glib, gtk3, pango -, libxml2, perl, intltool, gettext, gnome3 }: +, libxml2, perl, intltool, gettext, gnome3, dbus, xvfb_run, shared_mime_info }: stdenv.mkDerivation rec { inherit (import ./src.nix fetchurl) name src; - propagatedBuildInputs = [ gtk3 ]; + propagatedBuildInputs = [ + # Required by gtksourceview-3.0.pc + gtk3 + # Used by gtk_source_language_manager_guess_language + shared_mime_info + ]; - nativeBuildInputs = [ pkgconfig intltool gettext perl ]; + nativeBuildInputs = [ pkgconfig intltool gettext perl ] + ++ stdenv.lib.optionals doCheck checkInputs; buildInputs = [ atk cairo glib pango libxml2 ]; + checkInputs = [ xvfb_run dbus ]; preBuild = '' substituteInPlace gtksourceview/gtksourceview-utils.c --replace "@NIX_SHARE_PATH@" "$out/share" @@ -15,6 +22,14 @@ stdenv.mkDerivation rec { patches = [ ./nix_share_path.patch ]; + doCheck = true; + checkPhase = '' + export NO_AT_BRIDGE=1 + xvfb-run -s '-screen 0 800x600x24' dbus-run-session \ + --config-file=${dbus.daemon}/share/dbus-1/session.conf \ + make check + ''; + meta = with stdenv.lib; { platforms = with platforms; linux ++ darwin; maintainers = gnome3.maintainers;