Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
87 lines
1.9 KiB
Nix
87 lines
1.9 KiB
Nix
{
|
|
python3Packages,
|
|
qt5,
|
|
lib,
|
|
opensnitch,
|
|
}:
|
|
|
|
python3Packages.buildPythonApplication {
|
|
pyproject = true;
|
|
pname = "opensnitch-ui";
|
|
|
|
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
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
qt5.wrapQtAppsHook
|
|
];
|
|
|
|
buildInputs = [
|
|
qt5.qtwayland
|
|
];
|
|
|
|
build-system = with python3Packages; [
|
|
setuptools
|
|
pyqt5
|
|
];
|
|
|
|
dependencies = with python3Packages; [
|
|
grpcio-tools
|
|
notify2
|
|
packaging
|
|
pyasn
|
|
pyinotify
|
|
pyqt5
|
|
qt-material
|
|
python-slugify
|
|
unidecode
|
|
];
|
|
|
|
preBuild = ''
|
|
make -C ../proto ../ui/opensnitch/ui_pb2.py
|
|
# sourced from ui/Makefile
|
|
pyrcc5 -o opensnitch/resources_rc.py opensnitch/res/resources.qrc
|
|
sed -i 's/^import ui_pb2/from . import ui_pb2/' opensnitch/proto/ui_pb2*
|
|
'';
|
|
|
|
preCheck = ''
|
|
export PYTHONPATH=opensnitch:$PYTHONPATH
|
|
'';
|
|
|
|
postInstall = ''
|
|
mv $out/${python3Packages.python.sitePackages}/usr/* $out/
|
|
'';
|
|
|
|
dontWrapQtApps = true;
|
|
makeWrapperArgs = [ "\${qtWrapperArgs[@]}" ];
|
|
|
|
# All tests are sandbox-incompatible and disabled for now
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "opensnitch" ];
|
|
|
|
meta = {
|
|
description = "Application firewall";
|
|
mainProgram = "opensnitch-ui";
|
|
homepage = "https://github.com/evilsocket/opensnitch/wiki";
|
|
license = lib.licenses.gpl3Only;
|
|
maintainers = with lib.maintainers; [
|
|
onny
|
|
grimmauld
|
|
];
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
}
|