about summary refs log tree commit diff
path: root/pkgs/tools/networking/offlineimap/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/networking/offlineimap/default.nix')
-rw-r--r--pkgs/tools/networking/offlineimap/default.nix37
1 files changed, 26 insertions, 11 deletions
diff --git a/pkgs/tools/networking/offlineimap/default.nix b/pkgs/tools/networking/offlineimap/default.nix
index 16bca4c2197da..b3743e74fe40a 100644
--- a/pkgs/tools/networking/offlineimap/default.nix
+++ b/pkgs/tools/networking/offlineimap/default.nix
@@ -15,12 +15,13 @@
 python3.pkgs.buildPythonApplication rec {
   pname = "offlineimap";
   version = "8.0.0";
+  pyproject = true;
 
   src = fetchFromGitHub {
     owner = "OfflineIMAP";
     repo = "offlineimap3";
     rev = "v${version}";
-    sha256 = "0y3giaz9i8vvczlxkbwymfkn3vi9fv599dy4pc2pn2afxsl4mg2w";
+    hash = "sha256-XLxKqO5OCXsFu8S3lMp2Ke5hp6uer9npZ3ujmL6Kb3g=";
   };
 
   patches = [
@@ -29,8 +30,30 @@ python3.pkgs.buildPythonApplication rec {
       url = "https://github.com/OfflineIMAP/offlineimap3/pull/139/commits/7cd32cf834b34a3d4675b29bebcd32dc1e5ef128.patch";
       hash = "sha256-xNq4jFHMf9XZaa9BFF1lOzZrEGa5BEU8Dr+gMOBkJE4=";
     })
+    (fetchpatch {
+      # https://github.com/OfflineIMAP/offlineimap3/pull/120
+      name = "python312-comaptibility.patch";
+      url = "https://github.com/OfflineIMAP/offlineimap3/commit/a1951559299b297492b8454850fcfe6eb9822a38.patch";
+      hash = "sha256-CBGMHi+ZzOBJt3TxBf6elrTRMIQ+8wr3JgptL2etkoA=";
+     })
+    (fetchpatch {
+      # https://github.com/OfflineIMAP/offlineimap3/pull/161
+      name = "python312-compatibility.patch";
+      url = "https://github.com/OfflineIMAP/offlineimap3/commit/3dd8ebc931e3f3716a90072bd34e50ac1df629fa.patch";
+      hash = "sha256-2IJ0yzESt+zk+r+Z+9js3oKhFF0+xok0xK8Jd3G/gYY=";
+     })
   ];
 
+  postPatch = ''
+    # Skip xmllint to stop failures due to no network access
+    sed -i docs/Makefile -e "s|a2x -v -d |a2x -L -v -d |"
+
+    # Provide CA certificates (Used when "sslcacertfile = OS-DEFAULT" is configured")
+    sed -i offlineimap/utils/distro_utils.py -e '/def get_os_sslcertfile():/a\ \ \ \ return "${cacert}/etc/ssl/certs/ca-bundle.crt"'
+  '';
+
+  build-system = [ python3.pkgs.setuptools ];
+
   nativeBuildInputs = [
     asciidoc
     docbook_xsl
@@ -39,7 +62,7 @@ python3.pkgs.buildPythonApplication rec {
     libxslt
   ];
 
-  propagatedBuildInputs = with python3.pkgs; [
+  dependencies = with python3.pkgs; [
     certifi
     distro
     imaplib2
@@ -48,14 +71,6 @@ python3.pkgs.buildPythonApplication rec {
     urllib3
   ];
 
-  postPatch = ''
-    # Skip xmllint to stop failures due to no network access
-    sed -i docs/Makefile -e "s|a2x -v -d |a2x -L -v -d |"
-
-    # Provide CA certificates (Used when "sslcacertfile = OS-DEFAULT" is configured")
-    sed -i offlineimap/utils/distro_utils.py -e '/def get_os_sslcertfile():/a\ \ \ \ return "${cacert}/etc/ssl/certs/ca-bundle.crt"'
-  '';
-
   postInstall = ''
     make -C docs man
     installManPage docs/offlineimap.1
@@ -75,7 +90,7 @@ python3.pkgs.buildPythonApplication rec {
     description = "Synchronize emails between two repositories, so that you can read the same mailbox from multiple computers";
     homepage = "http://offlineimap.org";
     license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ ];
+    maintainers = [ ];
     mainProgram = "offlineimap";
   };
 }