From df8017a8f58ae965f245ee1cdd83eb45616a7c15 Mon Sep 17 00:00:00 2001
From: Fabian Affolter <mail@fabian-affolter.ch>
Date: Fri, 7 Oct 2022 22:34:56 +0200
Subject: [PATCH] python310Packages.dissect-target: init at 3.1

---
 .../python-modules/dissect-target/default.nix | 110 ++++++++++++++++++
 pkgs/top-level/python-packages.nix            |   2 +
 2 files changed, 112 insertions(+)
 create mode 100644 pkgs/development/python-modules/dissect-target/default.nix

diff --git a/pkgs/development/python-modules/dissect-target/default.nix b/pkgs/development/python-modules/dissect-target/default.nix
new file mode 100644
index 000000000000..84f75fad709e
--- /dev/null
+++ b/pkgs/development/python-modules/dissect-target/default.nix
@@ -0,0 +1,110 @@
+{ lib
+, asn1crypto
+, buildPythonPackage
+, defusedxml
+, dissect-cim
+, dissect-clfs
+, dissect-cstruct
+, dissect-esedb
+, dissect-etl
+, dissect-eventlog
+, dissect-evidence
+, dissect-extfs
+, dissect-fat
+, dissect-ffs
+, dissect-hypervisor
+, dissect-ntfs
+, dissect-regf
+, dissect-sql
+, dissect-util
+, dissect-volume
+, dissect-xfs
+, fetchFromGitHub
+, flow-record
+, fusepy
+, ipython
+, pytestCheckHook
+, pythonOlder
+, pyyaml
+, setuptools
+, setuptools-scm
+, structlog
+, yara-python
+, zstandard
+}:
+
+buildPythonPackage rec {
+  pname = "dissect-target";
+  version = "3.1";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "fox-it";
+    repo = "dissect.target";
+    rev = version;
+    hash = "sha256-vZzdwkfUMGkrRN0zvDukS5c0RokEyXWgqZENPWF1yXE=";
+  };
+
+  SETUPTOOLS_SCM_PRETEND_VERSION = version;
+
+  nativeBuildInputs = [
+    setuptools
+    setuptools-scm
+  ];
+
+  propagatedBuildInputs = [
+    dissect-cstruct
+    dissect-eventlog
+    dissect-evidence
+    dissect-hypervisor
+    dissect-ntfs
+    dissect-regf
+    dissect-util
+    dissect-volume
+    flow-record
+    structlog
+  ];
+
+  passthru.optional-dependencies = {
+    full = [
+      asn1crypto
+      defusedxml
+      dissect-cim
+      dissect-clfs
+      dissect-esedb
+      dissect-etl
+      dissect-extfs
+      dissect-fat
+      dissect-ffs
+      dissect-sql
+      dissect-xfs
+      fusepy
+      ipython
+      pyyaml
+      yara-python
+      zstandard
+    ];
+  };
+
+  checkInputs = [
+    pytestCheckHook
+  ] ++ passthru.optional-dependencies.full;
+
+  pythonImportsCheck = [
+    "dissect.target"
+  ];
+
+  disabledTests = [
+    # Test requires rdump
+    "test_exec_target_command"
+  ];
+
+  meta = with lib; {
+    description = "Dissect module that provides a programming API and command line tools";
+    homepage = "https://github.com/fox-it/dissect.target";
+    license = licenses.agpl3Only;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 70a01777552b..a78f65e00527 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -2509,6 +2509,8 @@ in {
 
   dissect-sql = callPackage ../development/python-modules/dissect-sql { };
 
+  dissect-target = callPackage ../development/python-modules/dissect-target { };
+
   dissect-util = callPackage ../development/python-modules/dissect-util { };
 
   dissect-vmfs = callPackage ../development/python-modules/dissect-vmfs { };