From 579c17d7bcbe500b26cbacaa445608289f32ddd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Mancilla?= Date: Sat, 31 Jul 2021 15:29:25 -0400 Subject: [PATCH] pympress: 1.5.1 -> 1.6.3 This also makes the application ready to work on Darwin (but still not working until #113777 is fixed). Version 1.5.1 did not build on Darwin because libcanberra-gtk3 is broken, and python-vlc is required but only works on Linux. Version 1.6.x fixed the python-vlc requirement to make it optional, so now both libcanberra-gtk3 and python-vlc inputs can be made optional, and enabled by default on Linux. This means that on Darwin there is no support for media, but it is still better than not having the application at all. Unfortunately, until watchdog 2.x is fixed, the Darwin build will be still broken. ----- The setup.py file now parses the setuptools version, so it needs to be patched to fix an error with the 'post0' suffix in the version. Also, setuptools is needed in propagatedBuildInputs to fix the `ModuleNotFoundError: No module named 'pkg_resources'` error. --- pkgs/applications/office/pympress/default.nix | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/office/pympress/default.nix b/pkgs/applications/office/pympress/default.nix index ebc93edba6e..2a97de6ca5b 100644 --- a/pkgs/applications/office/pympress/default.nix +++ b/pkgs/applications/office/pympress/default.nix @@ -1,21 +1,34 @@ { lib +, stdenv +, fetchpatch , python3Packages , wrapGAppsHook , gtk3 , gobject-introspection , libcanberra-gtk3 , poppler_gi +, withGstreamer ? stdenv.isLinux +, withVLC ? stdenv.isLinux }: python3Packages.buildPythonApplication rec { pname = "pympress"; - version = "1.5.1"; + version = "1.6.3"; src = python3Packages.fetchPypi { inherit pname version; - sha256 = "173d9scf2z29qg279jf33zcl7sgc3wp662fgpm943bn9667q18wf"; + sha256 = "sha256-f+OjE0x/3yfJYHCLB+on7TT7MJ2vNu87SHRi67qFDCM="; }; + patches = [ + # Should not be needed once v1.6.4 is released + (fetchpatch { + name = "fix-setuptools-version-parsing.patch"; + url = "https://github.com/Cimbali/pympress/commit/474514d71396ac065e210fd846e07ed1139602d0.diff"; + sha256 = "sha256-eiw54sjMrXrNrhtkAXxiSTatzoA0NDA03L+HpTDax58="; + }) + ]; + nativeBuildInputs = [ wrapGAppsHook ]; @@ -23,16 +36,15 @@ python3Packages.buildPythonApplication rec { buildInputs = [ gtk3 gobject-introspection - libcanberra-gtk3 poppler_gi - ]; + ] ++ lib.optional withGstreamer libcanberra-gtk3; propagatedBuildInputs = with python3Packages; [ pycairo pygobject3 - python-vlc + setuptools watchdog - ]; + ] ++ lib.optional withVLC python-vlc; doCheck = false; # there are no tests