meld: 3.18.3 -> 3.20.0 (#53595)

Update and enable tests
This commit is contained in:
R. RyanTM 2019-01-13 13:05:01 -08:00 committed by xeji
parent bddaa4bc16
commit 27609af220

View File

@ -1,48 +1,53 @@
{ stdenv, fetchurl, itstool, python3Packages, intltool, wrapGAppsHook
, libxml2, gobject-introspection, gtk3, gnome3, cairo, file
{ stdenv, fetchurl, itstool, python3, intltool, wrapGAppsHook
, libxml2, gobject-introspection, gtk3, gtksourceview, gnome3
, dbus, xvfb_run
}:
let
python3.pkgs.buildPythonApplication rec {
pname = "meld";
version = "3.18.3";
inherit (python3Packages) python buildPythonApplication pycairo pygobject3;
in buildPythonApplication rec {
name = "${pname}-${version}";
version = "3.20.0";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "0vn1qx60f8113x8wh7f4bflhzir1vx7p0wdfi7nbip6fh8gaf3ln";
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "11khi1sg02k3b9qdag3r939cwi27cql4kjim7jhxf9ckfhpzwh6b";
};
buildInputs = [
intltool wrapGAppsHook itstool libxml2
gnome3.gtksourceview gnome3.gsettings-desktop-schemas pycairo cairo
gnome3.defaultIconTheme gnome3.dconf file
nativeBuildInputs = [
intltool itstool libxml2 gobject-introspection wrapGAppsHook
];
propagatedBuildInputs = [ gobject-introspection pygobject3 gtk3 ];
buildInputs = [
gtk3 gtksourceview gnome3.gsettings-desktop-schemas gnome3.defaultIconTheme
];
propagatedBuildInputs = with python3.pkgs; [ pygobject3 pycairo ];
checkInputs = [ xvfb_run python3.pkgs.pytest dbus ];
installPhase = ''
mkdir -p "$out/lib/${python.libPrefix}/site-packages"
export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
${python}/bin/${python.executable} setup.py install \
--install-lib=$out/lib/${python.libPrefix}/site-packages \
--prefix="$out"
mkdir -p $out/share/gsettings-schemas/$name
mv $out/share/glib-2.0 $out/share/gsettings-schemas/$name/
runHook preInstall
${python3.interpreter} setup.py install --prefix=$out
runHook postInstall
'';
patchPhase = ''
patchShebangs bin/meld
checkPhase = ''
runHook preCheck
# Unable to create user data directory '/homeless-shelter/.local/share' for storing the recently used files list: Permission denied
mkdir test-home
export HOME=$(pwd)/test-home
# GLib.GError: gtk-icon-theme-error-quark: Icon 'meld-change-apply-right' not present in theme Adwaita
export XDG_DATA_DIRS="$out/share:$XDG_DATA_DIRS"
# ModuleNotFoundError: No module named 'meld'
export PYTHONPATH=$out/${python3.sitePackages}:$PYTHONPATH
# Gtk-CRITICAL **: gtk_icon_theme_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
--config-file=${dbus.daemon}/share/dbus-1/session.conf \
py.test
runHook postCheck
'';
pythonPath = [ gtk3 ];
doCheck = false;
passthru = {
updateScript = gnome3.updateScript {
packageName = pname;
@ -52,8 +57,8 @@ in buildPythonApplication rec {
meta = with stdenv.lib; {
description = "Visual diff and merge tool";
homepage = http://meldmerge.org/;
license = stdenv.lib.licenses.gpl2;
platforms = platforms.linux ++ stdenv.lib.platforms.darwin;
maintainers = [ maintainers.mimadrid ];
license = licenses.gpl2;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ jtojnar mimadrid ];
};
}