2021-03-20 04:20:00 +00:00
|
|
|
{ python3Packages
|
|
|
|
, fetchFromGitHub
|
2023-11-16 04:20:00 +00:00
|
|
|
, qtwayland
|
2021-03-20 04:20:00 +00:00
|
|
|
, wrapQtAppsHook
|
|
|
|
, lib
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "opensnitch-ui";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "1.6.4";
|
2021-03-20 04:20:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "evilsocket";
|
|
|
|
repo = "opensnitch";
|
2022-04-27 09:35:20 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-fkRykhcjWZ4MDl2HZ1ZFaQmEeRYhiCBeUxG/Eu7D8NA=";
|
2021-03-20 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
2023-08-10 07:59:29 +00:00
|
|
|
substituteInPlace ui/opensnitch/utils/__init__.py \
|
2022-06-16 17:23:12 +00:00
|
|
|
--replace /usr/lib/python3/dist-packages/data ${python3Packages.pyasn}/${python3Packages.python.sitePackages}/pyasn/data
|
|
|
|
'';
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
python3Packages.pyqt5
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
2021-03-20 04:20:00 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
buildInputs = [
|
|
|
|
qtwayland
|
|
|
|
];
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
grpcio-tools
|
|
|
|
pyqt5
|
|
|
|
unidecode
|
|
|
|
unicode-slugify
|
|
|
|
pyinotify
|
2022-02-10 20:34:41 +00:00
|
|
|
notify2
|
2022-03-05 16:20:37 +00:00
|
|
|
pyasn
|
2021-03-20 04:20:00 +00:00
|
|
|
];
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
preBuild = ''
|
|
|
|
make -C ../proto ../ui/opensnitch/ui_pb2.py
|
2022-06-16 17:23:12 +00:00
|
|
|
# sourced from ui/Makefile
|
2022-01-03 16:56:52 +00:00
|
|
|
pyrcc5 -o opensnitch/resources_rc.py opensnitch/res/resources.qrc
|
2022-06-16 17:23:12 +00:00
|
|
|
sed -i 's/^import ui_pb2/from . import ui_pb2/' opensnitch/ui_pb2*
|
2022-01-03 16:56:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
preConfigure = ''
|
|
|
|
cd ui
|
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export PYTHONPATH=opensnitch:$PYTHONPATH
|
|
|
|
'';
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
postInstall = ''
|
2022-06-16 17:23:12 +00:00
|
|
|
mv $out/${python3Packages.python.sitePackages}/usr/* $out/
|
2022-01-03 16:56:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
makeWrapperArgs = [ "\${qtWrapperArgs[@]}" ];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
# All tests are sandbox-incompatible and disabled for now
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "An application firewall";
|
|
|
|
homepage = "https://github.com/evilsocket/opensnitch/wiki";
|
|
|
|
license = licenses.gpl3Only;
|
2022-12-17 10:02:37 +00:00
|
|
|
maintainers = with maintainers; [ onny ];
|
2021-03-20 04:20:00 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|