From 66c20b3b2d9bd25121bf92d64cdbbd44b630bafb Mon Sep 17 00:00:00 2001 From: natsukium Date: Thu, 20 Jun 2024 18:18:09 +0900 Subject: [PATCH] offlineimap: refactor --- pkgs/tools/networking/offlineimap/default.nix | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/networking/offlineimap/default.nix b/pkgs/tools/networking/offlineimap/default.nix index 91e03e2af82a..9ddc2164b456 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 = [ @@ -43,6 +44,16 @@ python3.pkgs.buildPythonApplication rec { }) ]; + 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 @@ -51,7 +62,7 @@ python3.pkgs.buildPythonApplication rec { libxslt ]; - propagatedBuildInputs = with python3.pkgs; [ + dependencies = with python3.pkgs; [ certifi distro imaplib2 @@ -60,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