2021-03-20 04:20:00 +00:00
|
|
|
{ python3Packages
|
|
|
|
, fetchFromGitHub
|
2024-02-29 20:09:43 +00:00
|
|
|
, qt5
|
2021-03-20 04:20:00 +00:00
|
|
|
, lib
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "opensnitch-ui";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "1.6.5.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}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-IVrAAHzLS7A7cYhRk+IUx8/5TGKeqC7M/7iXOpPe2ZA=";
|
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
|
2024-02-29 20:09:43 +00:00
|
|
|
qt5.wrapQtAppsHook
|
2022-01-03 16:56:52 +00:00
|
|
|
];
|
2021-03-20 04:20:00 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
buildInputs = [
|
2024-02-29 20:09:43 +00:00
|
|
|
qt5.qtwayland
|
2023-11-16 04:20:00 +00:00
|
|
|
];
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
grpcio-tools
|
2022-02-10 20:34:41 +00:00
|
|
|
notify2
|
2022-03-05 16:20:37 +00:00
|
|
|
pyasn
|
2024-02-29 20:09:43 +00:00
|
|
|
pyinotify
|
|
|
|
pyqt5
|
|
|
|
qt-material
|
|
|
|
unicode-slugify
|
|
|
|
unidecode
|
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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Application firewall";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "opensnitch-ui";
|
2021-03-20 04:20:00 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|