From cc67617dd59d6ada1e7ee71adc145a3fdaafa78d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 3 May 2022 20:59:13 -0700 Subject: [PATCH] udiskie: 2.4.0 -> 2.4.2 https://github.com/coldfix/udiskie/blob/v2.4.2/CHANGES.rst --- pkgs/applications/misc/udiskie/default.nix | 55 ++++++++++--------- .../misc/udiskie/locale-path.patch | 17 ++++++ pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 48 insertions(+), 26 deletions(-) create mode 100644 pkgs/applications/misc/udiskie/locale-path.patch diff --git a/pkgs/applications/misc/udiskie/default.nix b/pkgs/applications/misc/udiskie/default.nix index fb9c7021b15b..d5d4b766e775 100644 --- a/pkgs/applications/misc/udiskie/default.nix +++ b/pkgs/applications/misc/udiskie/default.nix @@ -1,42 +1,47 @@ { lib +, asciidoc , fetchFromGitHub -, buildPythonApplication -, asciidoc-full -, docopt -, gettext , gobject-introspection , gtk3 -, keyutils +, installShellFiles , libappindicator-gtk3 , libnotify , librsvg -, nose -, pygobject3 -, pyyaml +, python3 , udisks2 , wrapGAppsHook }: -buildPythonApplication rec { +python3.pkgs.buildPythonApplication rec { pname = "udiskie"; - version = "2.4.0"; + version = "2.4.2"; + + format = "setuptools"; src = fetchFromGitHub { owner = "coldfix"; repo = "udiskie"; rev = "v${version}"; - hash = "sha256-T4kMPMXfehZT7P+TOd1llR2TbHPA/quNL545xxlmJfE="; + hash = "sha256-lQMJVSY3JeZYYOFDyV29Ye2j8r+ngE/ta2wQYipy4hU="; }; - outputs = [ "out" "man" ]; + patches = [ + ./locale-path.patch + ]; + + postPatch = '' + substituteInPlace udiskie/locale.py --subst-var out + ''; nativeBuildInputs = [ - asciidoc-full # Man page - gettext + asciidoc # Man page gobject-introspection + installShellFiles wrapGAppsHook ]; + dontWrapGApps = true; + buildInputs = [ gobject-introspection gtk3 @@ -46,8 +51,9 @@ buildPythonApplication rec { udisks2 ]; - propagatedBuildInputs = [ + propagatedBuildInputs = with python3.pkgs; [ docopt + keyutils pygobject3 pyyaml ]; @@ -57,21 +63,20 @@ buildPythonApplication rec { ''; postInstall = '' - mkdir -p $man/share/man/man8 - cp -v doc/udiskie.8 $man/share/man/man8/ + installManPage doc/udiskie.8 ''; - checkInputs = [ - keyutils - nose + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + ''; + + checkInputs = with python3.pkgs; [ + pytestCheckHook ]; - checkPhase = '' - nosetests - ''; - meta = with lib; { homepage = "https://github.com/coldfix/udiskie"; + changelog = "https://github.com/coldfix/udiskie/blob/${src.rev}/CHANGES.rst"; description = "Removable disk automounter for udisks"; longDescription = '' udiskie is a udisks2 front-end that allows to manage removeable media such @@ -88,6 +93,6 @@ buildPythonApplication rec { - password caching (requires python keyutils 0.3) ''; license = licenses.mit; - maintainers = with maintainers; [ AndersonTorres ]; + maintainers = with maintainers; [ AndersonTorres dotlambda ]; }; } diff --git a/pkgs/applications/misc/udiskie/locale-path.patch b/pkgs/applications/misc/udiskie/locale-path.patch new file mode 100644 index 000000000000..f454bee467db --- /dev/null +++ b/pkgs/applications/misc/udiskie/locale-path.patch @@ -0,0 +1,17 @@ +diff --git a/udiskie/locale.py b/udiskie/locale.py +index f12bea9..450e38b 100644 +--- a/udiskie/locale.py ++++ b/udiskie/locale.py +@@ -10,10 +10,8 @@ from gettext import translation + testdirs = [ + # manual override: + os.environ.get('TEXTDOMAINDIR'), +- # editable installation: +- os.path.join(os.path.dirname(__file__), '../build/locale'), +- # user or virtualenv installation: +- os.path.join(sys.prefix, 'share/locale'), ++ # Nix installation: ++ os.path.join('@out@', 'share/locale'), + ] + testfile = 'en_US/LC_MESSAGES/udiskie.mo' + localedir = next( diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 47d3dd1d701c..6df3439c015a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29348,7 +29348,7 @@ with pkgs; udevil = callPackage ../applications/misc/udevil {}; - udiskie = python3.pkgs.callPackage ../applications/misc/udiskie { }; + udiskie = callPackage ../applications/misc/udiskie { }; sacc = callPackage ../applications/networking/gopher/sacc { };