From 1f685465b7a0f78e1f61832d4fd74c173961abfd Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Mon, 18 Aug 2025 12:16:20 +0200 Subject: [PATCH] opensnitch-ui: migrate to python-slugify to fix build --- pkgs/by-name/op/opensnitch-ui/package.nix | 9 ++++++++- .../by-name/op/opensnitch-ui/use_python_slugify.patch | 11 +++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/op/opensnitch-ui/use_python_slugify.patch diff --git a/pkgs/by-name/op/opensnitch-ui/package.nix b/pkgs/by-name/op/opensnitch-ui/package.nix index 0c9bdbdb1ca8..2c7a17b2266f 100644 --- a/pkgs/by-name/op/opensnitch-ui/package.nix +++ b/pkgs/by-name/op/opensnitch-ui/package.nix @@ -12,6 +12,13 @@ python3Packages.buildPythonApplication { inherit (opensnitch) src version; sourceRoot = "${opensnitch.src.name}/ui"; + patches = [ + # https://github.com/evilsocket/opensnitch/pull/1413 + # unicode-slugify has failing tests and is overall unmaintained and broken. + # python-slugify is a preferrable replacement + ./use_python_slugify.patch + ]; + postPatch = '' substituteInPlace opensnitch/utils/__init__.py \ --replace-fail /usr/lib/python3/dist-packages/data ${python3Packages.pyasn}/${python3Packages.python.sitePackages}/pyasn/data @@ -38,7 +45,7 @@ python3Packages.buildPythonApplication { pyinotify pyqt5 qt-material - unicode-slugify + python-slugify unidecode ]; diff --git a/pkgs/by-name/op/opensnitch-ui/use_python_slugify.patch b/pkgs/by-name/op/opensnitch-ui/use_python_slugify.patch new file mode 100644 index 000000000000..877b5006251a --- /dev/null +++ b/pkgs/by-name/op/opensnitch-ui/use_python_slugify.patch @@ -0,0 +1,11 @@ +diff --git a/requirements.txt b/requirements.txt +index 66e0de13..68d651b1 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -1,5 +1,5 @@ + grpcio-tools>=1.10.1 + pyinotify==0.9.6 +-unicode_slugify==0.1.5 ++python-slugify>=7.0.0 + pyqt5>=5.6 + protobuf