summary refs log tree commit diff
path: root/pkgs/applications/misc/openlp/lib.nix
blob: 045211c3af6a63f12ef4db18dcc3d83db7645d15 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# This file contains the base package, some of which is compiled.
# Runtime glue to optinal runtime dependencies is in 'default.nix'.
{ fetchurl, lib, qt5

# python deps
, python, buildPythonPackage
, alembic, beautifulsoup4, chardet, lxml, mako, pyenchant
, pyqt5_with_qtwebkit, pyxdg, sip_4, sqlalchemy, sqlalchemy-migrate
}:

buildPythonPackage rec {
  pname = "openlp";
  version = "2.4.6";

  src = fetchurl {
    url = "https://get.openlp.org/${version}/OpenLP-${version}.tar.gz";
    sha256 = "f63dcf5f1f8a8199bf55e806b44066ad920d26c9cf67ae432eb8cdd1e761fc30";
  };

  doCheck = false;
  # FIXME: checks must be disabled because they are lacking the qt env.
  #        They fail like this, even if built and wrapped with all Qt and
  #        runtime dependencies:
  #
  #     running install tests
  #     qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
  #     This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
  #
  #     Available platform plugins are: wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx.
  #
  # See also https://discourse.nixos.org/t/qt-plugin-path-unset-in-test-phase/

  #nativeCheckInputs = [ mock nose ];
  nativeBuildInputs = [ qt5.qttools ];
  propagatedBuildInputs = [
    alembic
    beautifulsoup4
    chardet
    lxml
    mako
    pyenchant
    pyqt5_with_qtwebkit
    pyxdg
    sip_4
    sqlalchemy
    sqlalchemy-migrate
  ];

  prePatch = ''
    echo 'from vlc import *' > openlp/core/ui/media/vendor/vlc.py
  '';

  dontWrapQtApps = true;
  dontWrapGApps = true;
  postInstall = ''
    ( # use subshell because of cd
      tdestdir="$out/i18n"
      mkdir -p "$tdestdir"
      cd ./resources/i18n
      for file in *.ts; do
          lconvert -i "$file" -o "$tdestdir/''${file%%ts}qm"
      done
    )
  '';

  preFixup = ''
    rm -r $out/${python.sitePackages}/tests
    rm -r $out/bin
  '';

  meta = with lib; {
    description = "Free church presentation software";
    homepage = "https://openlp.org/";
    downloadPage = "https://openlp.org/#downloads";
    platforms = platforms.unix;
    license = licenses.gpl2Only;
    maintainers = [ maintainers.jorsn ];

    longDescription = ''
      OpenLP is a free church presentation software.

      Features:

      * Cross platform between Linux, Windows, OS X and FreeBSD
      * Display songs, Bible verses, presentations, images, audio and video
      * Control OpenLP remotely via the Android remote, iOS remote or mobile web browser
      * Quickly and easily import songs from other popular presentation packages
      * Easy enough to use to get up and running in less than 10 minutes

      Remark: This pkg only supports sqlite dbs. If you wish to have support for
            mysql or postgresql dbs, or Jenkins, please contact the maintainer.

      Bugs which affect this software packaged in Nixpkgs:

      1. The package must disable checks, because they are lacking the qt env.
         (see pkg source and https://discourse.nixos.org/t/qt-plugin-path-unset-in-test-phase/)
      2. There is a segfault on exit. Not a real problem, according to debug log, everything
         shuts down correctly. Maybe related to https://forums.openlp.org/discussion/3620/crash-on-exit.
         Plan: Wait for OpenLP-3, since it is already in beta 1
         (2021-02-09; news: https://openlp.org/blog/).
    '';
  };
}