Commit ab3c49d8 authored by Martin Weinelt's avatar Martin Weinelt Committed by Kerstin
Browse files

afew: fix build, use sphinxHook, use pep517 build

parent 8e2ed1cc
Loading
Loading
Loading
Loading
+27 −19
Original line number Diff line number Diff line
{ lib, python3Packages, fetchPypi, notmuch }:
{ lib, python3Packages, fetchPypi, pkgs }:

python3Packages.buildPythonApplication rec {
  pname = "afew";
  version = "3.0.1";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    sha256 = "0wpfqbqjlfb9z0hafvdhkm7qw56cr9kfy6n8vb0q42dwlghpz1ff";
  };

  nativeBuildInputs = with python3Packages; [ sphinx setuptools-scm ];

  propagatedBuildInputs = with python3Packages; [
    python3Packages.setuptools python3Packages.notmuch chardet dkimpy
  nativeBuildInputs = with python3Packages; [
    sphinxHook
    setuptools
    setuptools-scm
  ];

  nativeCheckInputs = with python3Packages; [
    freezegun notmuch
  sphinxBuilders = [
    "html"
    "man"
  ];

  makeWrapperArgs = [
    ''--prefix PATH ':' "${notmuch}/bin"''
  propagatedBuildInputs = with python3Packages; [
    chardet
    dkimpy
    notmuch
  ];

  outputs = [ "out" "doc" ];
  nativeCheckInputs = [
    pkgs.notmuch
  ] ++ (with python3Packages; [
    freezegun
    pytestCheckHook
  ]);

  postBuild =  ''
    ${python3Packages.python.pythonOnBuildForHost.interpreter} setup.py build_sphinx -b html,man
  '';

  postInstall = ''
    install -D -v -t $out/share/man/man1 build/sphinx/man/*
    mkdir -p $out/share/doc/afew
    cp -R build/sphinx/html/* $out/share/doc/afew
  '';
  makeWrapperArgs = [
    ''--prefix PATH ':' "${pkgs.notmuch}/bin"''
  ];

  outputs = [
    "out"
    "doc"
    "man"
  ];

  meta = with lib; {
    homepage = "https://github.com/afewmail/afew";