2021-03-20 04:20:00 +00:00
|
|
|
{ python3Packages
|
|
|
|
, fetchFromGitHub
|
|
|
|
, wrapQtAppsHook
|
|
|
|
, lib
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "opensnitch-ui";
|
2023-08-10 07:59:29 +00:00
|
|
|
version = "1.6.1";
|
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}";
|
2023-08-10 07:59:29 +00:00
|
|
|
sha256 = "sha256-yEo5nga0WTbgZm8W2qbJcTOO4cCzFWrjRmTBCFH7GLg=";
|
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
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|