summary refs log tree commit diff
path: root/pkgs/applications/office/paperwork/paperwork-backend.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/office/paperwork/paperwork-backend.nix')
-rw-r--r--pkgs/applications/office/paperwork/paperwork-backend.nix16
1 files changed, 5 insertions, 11 deletions
diff --git a/pkgs/applications/office/paperwork/paperwork-backend.nix b/pkgs/applications/office/paperwork/paperwork-backend.nix
index cbb57496427..95608b26e2f 100644
--- a/pkgs/applications/office/paperwork/paperwork-backend.nix
+++ b/pkgs/applications/office/paperwork/paperwork-backend.nix
@@ -1,6 +1,5 @@
 { buildPythonPackage
 , lib
-, fetchpatch
 , fetchFromGitLab
 , pyenchant
 , scikit-learn
@@ -8,7 +7,6 @@
 , pycountry
 , whoosh
 , termcolor
-, levenshtein
 , pygobject3
 , pyocr
 , natsort
@@ -24,34 +22,30 @@
 , shared-mime-info
 , libreoffice
 , unittestCheckHook
+, setuptools-scm
 }:
 
 buildPythonPackage rec {
   pname = "paperwork-backend";
   inherit (import ./src.nix { inherit fetchFromGitLab; }) version src;
+  format = "pyproject";
 
   sourceRoot = "${src.name}/paperwork-backend";
 
   patches = [
     # disables a flaky test https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/issues/1035#note_1493700
     ./flaky_test.patch
-    (fetchpatch {
-      url = "https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/commit/0f5cf0fe7ef223000e02c28e4c7576f74a778fe6.patch";
-      hash = "sha256-NIK3j2TdydfeK3/udS/Pc+tJa/pPkfAmSPPeaYuaCq4=";
-    })
   ];
 
   patchFlags = [ "-p2" ];
 
   postPatch = ''
-    substituteInPlace setup.py \
-      --replace python-Levenshtein Levenshtein
-
-    echo 'version = "${version}"' > src/paperwork_backend/_version.py
     chmod a+w -R ..
     patchShebangs ../tools
   '';
 
+  env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
+
   propagatedBuildInputs = [
     distro
     gtk3
@@ -63,7 +57,6 @@ buildPythonPackage rec {
     pygobject3
     pyocr
     pypillowfight
-    levenshtein
     poppler_gi
     scikit-learn
     termcolor
@@ -74,6 +67,7 @@ buildPythonPackage rec {
     gettext
     shared-mime-info
     which
+    setuptools-scm
   ];
 
   preBuild = ''