Unverified Commit a8526804 authored by Yohann Boniface's avatar Yohann Boniface Committed by GitHub
Browse files

pyspread: fix, adopt, modernize (#466075)

parents 9dc8df35 dbeb746d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -17325,6 +17325,11 @@
    github = "Mephistophiles";
    githubId = 4850908;
  };
  Merikei = {
    name = "Merikei";
    github = "Merikei";
    githubId = 73759842;
  };
  merrkry = {
    email = "merrkry@tsubasa.moe";
    name = "merrkry";
+32 −26
Original line number Diff line number Diff line
{
  lib,
  python3,
  python3Packages,
  fetchPypi,
  qt6,
  R,
  copyDesktopItems,
  libsForQt5,
  makeDesktopItem,
}:

let
  inherit (libsForQt5)
    qtsvg
    wrapQtAppsHook
    ;
in
python3.pkgs.buildPythonApplication (finalAttrs: {
  format = "setuptools";
python3Packages.buildPythonApplication (finalAttrs: {
  pname = "pyspread";
  version = "2.4";

  src = fetchPypi {
    pname = "pyspread";
    inherit (finalAttrs) version;
    hash = "sha256-MZlR2Rap5oMRfCmswg9W//FYFkSEki7eyMNhLoGZgJM=";
  };

  pyproject = true;

  nativeBuildInputs = [
    R
    copyDesktopItems
    wrapQtAppsHook
    qt6.wrapQtAppsHook
  ];

  buildInputs = [
    qtsvg
  ];
  buildInputs = [ qt6.qtsvg ];

  propagatedBuildInputs = with python3.pkgs; [
    python-dateutil
    markdown2
    matplotlib
  dependencies = with python3Packages; [
    pyqt6
    numpy
    pyenchant
    pyqt5
    setuptools
    markdown2

    # Optional
    matplotlib # data visualization
    pyenchant # spellchecker bindings
    pip # python package installer
    python-dateutil # extensions to standard datetime module
    rpy2 # interface to R
    plotnine # data visualization
    openpyxl # r/w Excel 2010 xlsx/xlsm files

    # Optional & not in nixpkgs
    #py-moneyed # currency & money classes
    #pycel # compile Excel spreadsheets to Python code
  ];

  strictDeps = true;

  doCheck = false; # it fails miserably with a core dump

  doCheck = true;
  pythonImportsCheck = [ "pyspread" ];

  desktopItems = [
@@ -55,7 +58,7 @@ python3.pkgs.buildPythonApplication (finalAttrs: {
      icon = "pyspread";
      desktopName = "Pyspread";
      genericName = "Spreadsheet";
      comment = "A Python-oriented spreadsheet application";
      comment = "Python-oriented spreadsheet application";
      categories = [
        "Office"
        "Development"
@@ -64,6 +67,8 @@ python3.pkgs.buildPythonApplication (finalAttrs: {
    })
  ];

  makeWrapperArgs = [ "--set R_HOME ${lib.getLib R}/lib/R" ];

  preFixup = ''
    makeWrapperArgs+=("''${qtWrapperArgs[@]}")
  '';
@@ -83,6 +88,7 @@ python3.pkgs.buildPythonApplication (finalAttrs: {
    '';
    license = with lib.licenses; [ gpl3Plus ];
    mainProgram = "pyspread";
    maintainers = [ ];
    maintainers = with lib.maintainers; [ Merikei ];
    platforms = lib.platforms.linux;
  };
})