about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/office/pyspread/default.nix
blob: 0b657e38f7fe22bacd460caf90b755c7445af222 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{ lib
, buildPythonApplication
, fetchPypi
, makeDesktopItem
, makePythonPath
, dateutil
, matplotlib
, numpy
, pyenchant
, pyqt5
, pytest
, python
, qtsvg
, runtimeShell
, wrapQtAppsHook
}:

buildPythonApplication rec {
  pname = "pyspread";
  version = "1.99.5";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-05bC+Uvx72FAh3qxkgXm8jdb/gHRv1D/M7tjOEdE3Xg=";
  };

  pythonLibs = [
    dateutil
    matplotlib
    numpy
    pyenchant
    pyqt5
  ];

  nativeBuildInputs = [ wrapQtAppsHook ];
  buildInputs = pythonLibs ++ [
    qtsvg
  ];

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

  desktopItem = makeDesktopItem rec {
    name = pname;
    exec = name;
    icon = name;
    desktopName = "Pyspread";
    genericName = "Spreadsheet";
    comment = meta.description;
    categories = "Office;Development;Spreadsheet;";
  };

  postInstall = ''
    runHook preInstall
    install -D $out/share/applications
    install -m 644 $desktopItem/share/applications/* $out/share/applications
    runHook postInstall
  '';

  fixupPhase = ''
    runHook preFixup
    sed -i -e "s|#!/bin/bash|#!${runtimeShell}|" $out/bin/pyspread
    wrapProgram $out/bin/pyspread \
      --prefix PYTHONPATH ':' $(toPythonPath $out):${makePythonPath pythonLibs} \
      --prefix PATH ':' ${python}/bin/ \
      ''${qtWrapperArgs[@]}
    runHook postFixup
  '';

  meta = with lib; {
    homepage = "https://pyspread.gitlab.io/";
    description = "A Python-oriented spreadsheet application";
    longDescription = ''
      pyspread is a non-traditional spreadsheet application that is based on and
      written in the programming language Python. The goal of pyspread is to be
      the most pythonic spreadsheet.

      pyspread expects Python expressions in its grid cells, which makes a
      spreadsheet specific language obsolete. Each cell returns a Python object
      that can be accessed from other cells. These objects can represent
      anything including lists or matrices.
    '';
    license = with licenses; gpl3Plus;
    maintainers = with maintainers; [ AndersonTorres ];
    platforms = with platforms; all;
  };
}