Unverified Commit ba6ce53a authored by Bruno Bigras's avatar Bruno Bigras Committed by GitHub
Browse files

kcc: 7.5.1 -> 8.0.4, fix wrapping, use pyproject = true, remove leftover files (#426382)

parents cca77928 5856066e
Loading
Loading
Loading
Loading
+0 −48
Original line number Diff line number Diff line
{
  lib,
  python3Packages,
  fetchPypi,
  libsForQt5,
  p7zip,
  archiveSupport ? true,
}:

python3Packages.buildPythonApplication rec {
  pname = "kcc";
  version = "5.5.1";
  format = "setuptools";

  src = fetchPypi {
    inherit version;
    pname = "KindleComicConverter";
    sha256 = "5dbee5dc5ee06a07316ae5ebaf21ffa1970094dbae5985ad735e2807ef112644";
  };

  nativeBuildInputs = [ libsForQt5.wrapQtAppsHook ];

  propagatedBuildInputs = with python3Packages; [
    pillow
    pyqt5
    psutil
    python-slugify
    raven
  ];

  qtWrapperArgs = lib.optionals archiveSupport [
    "--prefix"
    "PATH"
    ":"
    "${lib.makeBinPath [ p7zip ]}"
  ];

  postFixup = ''
    wrapProgram $out/bin/kcc "''${qtWrapperArgs[@]}"
  '';

  meta = with lib; {
    description = "Python app to convert comic/manga files or folders to EPUB, Panel View MOBI or E-Ink optimized CBZ";
    homepage = "https://github.com/ciromattia/kcc";
    license = licenses.isc;
    maintainers = with maintainers; [ dawidsowa ];
  };
}
+27 −13
Original line number Diff line number Diff line
{
  stdenv,
  lib,
  qt6,
  python3,
  fetchFromGitHub,

  qt6,
  archiveSupport ? true,
  p7zip,

  versionCheckHook,
  nix-update-script,
  python3,
  archiveSupport ? true,
}:

python3.pkgs.buildPythonApplication rec {
  pname = "kcc";
  version = "7.5.1";
  format = "setuptools";
  version = "8.0.4";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "ciromattia";
    repo = "kcc";
    tag = "v${version}";
    hash = "sha256-XB+xss/QiZuo6gWphyjFh9DO74O5tNqfX5LUzsa4gqo=";
    hash = "sha256-8rnuSGlfwH5AVp8GQn3RTtiTYFdTNp7Wqq+ATibpkNA=";
  };

  nativeBuildInputs = [ qt6.wrapQtAppsHook ];

  buildInputs = [ qt6.qtbase ] ++ lib.optionals stdenv.hostPlatform.isLinux [ qt6.qtwayland ];
  propagatedBuildInputs = with python3.pkgs; [
    packaging
  buildInputs = [ qt6.qtbase ];

  build-system = with python3.pkgs; [ setuptools ];

  dependencies = with python3.pkgs; [
    packaging # undeclared dependency
    pyside6
    pillow
    psutil
    python-slugify
    raven
    requests
    natsort
    mozjpeg_lossless_optimization
    natsort
    distro
    pyside6
    numpy
  ];

  qtWrapperArgs = lib.optionals archiveSupport [ ''--prefix PATH : ${lib.makeBinPath [ p7zip ]}'' ];
  # Note: python scripts wouldn't get wrapped anyway, but let's be explicit about it
  dontWrapQtApps = true;

  makeWrapperArgs =
    [
      "\${qtWrapperArgs[@]}"
    ]
    ++ lib.optionals archiveSupport [
      ''--prefix PATH : ${lib.makeBinPath [ p7zip ]}''
    ];

  nativeInstallCheckInputs = [ versionCheckHook ];
  versionCheckProgram = "${placeholder "out"}/bin/kcc-c2e";