opensnitch: 1.7.2 -> 1.8.0, switch to Qt6 (#435841)

This commit is contained in:
Grimmauld
2025-12-29 12:38:32 +00:00
committed by GitHub
3 changed files with 9 additions and 46 deletions
+4 -13
View File
@@ -1,6 +1,6 @@
{
python3Packages,
qt5,
qt6,
lib,
opensnitch,
}:
@@ -12,29 +12,21 @@ python3Packages.buildPythonApplication {
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
qt6.wrapQtAppsHook
];
buildInputs = [
qt5.qtwayland
qt6.qtwayland
];
build-system = with python3Packages; [
setuptools
pyqt5
];
dependencies = with python3Packages; [
@@ -43,7 +35,7 @@ python3Packages.buildPythonApplication {
packaging
pyasn
pyinotify
pyqt5
pyqt6
qt-material
python-slugify
unidecode
@@ -52,7 +44,6 @@ python3Packages.buildPythonApplication {
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*
'';
@@ -1,11 +0,0 @@
diff --git a/requirements.txt b/requirements.txt
index 66e0de13..68d651b1 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
grpcio-tools>=1.10.1
pyinotify==0.9.6
-unicode_slugify==0.1.5
+python-slugify>=7.0.0
pyqt5>=5.6
protobuf
+5 -22
View File
@@ -1,7 +1,6 @@
{
buildGoModule,
fetchFromGitHub,
fetchpatch,
protobuf,
go-protobuf,
pkg-config,
@@ -35,29 +34,15 @@ let
in
buildGoModule (finalAttrs: {
pname = "opensnitch";
version = "1.7.2";
version = "1.8.0";
src = fetchFromGitHub {
owner = "evilsocket";
repo = "opensnitch";
tag = "v${finalAttrs.version}";
hash = "sha256-XAR7yZjAzbMxIVGSV82agpAGwlejkILGgDI6iRicZuQ=";
hash = "sha256-Bz5h2DEC61vpkeWZxFlogh6NvTubJcnHuwgTNSzZd68=";
};
patches = [
(fetchpatch {
# https://github.com/evilsocket/opensnitch/pull/1418
# allow configuring the audit socket path
url = "https://github.com/evilsocket/opensnitch/commit/f9358a464f204068359bf5174e6ff43288f12c7e.patch?full_index=1";
hash = "sha256-s9CM1CyGpfJZXEtihXCM7nfPhBY8XuwubynTotqtf3E=";
})
(fetchpatch {
# add missing colon in test definition
url = "https://github.com/evilsocket/opensnitch/commit/4b38ca1260295d2e0f8c4a7313529f83dcca4554.patch?full_index=1";
hash = "sha256-/z3iFRpcv75FyarVnpK8/PTU2fcFHS+SNbHn7M5Etk8=";
})
];
postPatch = ''
# Allow configuring Version at build time
substituteInPlace daemon/core/version.go --replace-fail "const " "var "
@@ -87,13 +72,11 @@ buildGoModule (finalAttrs: {
postBuild = ''
mv $GOPATH/bin/daemon $GOPATH/bin/opensnitchd
mkdir -p $out/etc/opensnitchd $out/lib/systemd/system
cp system-fw.json $out/etc/opensnitchd/
substitute default-config.json $out/etc/opensnitchd/default-config.json \
cp -r data/{rules,*.json} $out/etc/opensnitchd/
substituteInPlace $out/etc/opensnitchd/default-config.json \
--replace-fail "/var/log/opensnitchd.log" "/dev/stdout"
# Do not mkdir rules path
sed -i '8d' opensnitchd.service
# Fixup hardcoded paths
substitute opensnitchd.service $out/lib/systemd/system/opensnitchd.service \
substitute data/init/opensnitchd.service $out/lib/systemd/system/opensnitchd.service \
--replace-fail "/usr/local/bin/opensnitchd" "$out/bin/opensnitchd"
'';