Merge pull request #175954 from RamKromberg/fix/opensnitch-ui
opensnitch-ui: fix events table and notifications
This commit is contained in:
commit
a83de8a692
@ -1,4 +1,4 @@
|
||||
{ lib, buildPythonPackage, fetchPypi, }:
|
||||
{ lib, buildPythonPackage, fetchPypi, fetchFromGitHub, python, }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pyasn";
|
||||
@ -9,6 +9,18 @@ buildPythonPackage rec {
|
||||
sha256 = "sha256-6UK1SRY2Pse4tw6urs0OtOQe8bz0ojl7KabXFfzN+SU=";
|
||||
};
|
||||
|
||||
datasrc = fetchFromGitHub {
|
||||
owner = "hadiasghari";
|
||||
repo = "pyasn";
|
||||
rev = "${version}";
|
||||
sha256 = "sha256-R7Vi1Mn44Mg3HQLDk9O43MkXXwbLRr/jjVKSHJvgYj0";
|
||||
};
|
||||
|
||||
postInstall = ''
|
||||
install -dm755 $out/${python.sitePackages}/pyasn/data
|
||||
cp $datasrc/data/* $out/${python.sitePackages}/pyasn/data
|
||||
'';
|
||||
|
||||
doCheck = false; # Tests require internet connection which wont work
|
||||
|
||||
pythonImportsCheck = [ "pyasn" ];
|
||||
|
@ -15,6 +15,11 @@ python3Packages.buildPythonApplication rec {
|
||||
sha256 = "sha256-8IfupmQb1romGEvv/xqFkYhp0gGoY4ZEllX6rZYIkqw=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace ui/opensnitch/utils.py \
|
||||
--replace /usr/lib/python3/dist-packages/data ${python3Packages.pyasn}/${python3Packages.python.sitePackages}/pyasn/data
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
python3Packages.pyqt5
|
||||
wrapQtAppsHook
|
||||
@ -32,7 +37,9 @@ python3Packages.buildPythonApplication rec {
|
||||
|
||||
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/ui_pb2*
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
@ -44,7 +51,7 @@ python3Packages.buildPythonApplication rec {
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mv $out/lib/python3.9/site-packages/usr/* $out/
|
||||
mv $out/${python3Packages.python.sitePackages}/usr/* $out/
|
||||
'';
|
||||
|
||||
dontWrapQtApps = true;
|
||||
|
Loading…
Reference in New Issue
Block a user