heroic: use qt6 version of kdialog (#372495)
[NixPkgs.git] / pkgs / by-name / ti / timeline / package.nix
bloba3ca865e83e692334fae042eef8502a94d325d6d
2   lib,
3   fetchurl,
4   python3,
5   gettext,
6   makeDesktopItem,
7   copyDesktopItems,
8   wrapGAppsHook3,
9 }:
11 python3.pkgs.buildPythonApplication rec {
12   pname = "timeline";
13   version = "2.6.0";
14   format = "other";
16   src = fetchurl {
17     url = "mirror://sourceforge/thetimelineproj/${pname}-${version}.zip";
18     sha256 = "sha256-qwH2mt3Va62QJKJGOpt5WV3QksqQaRGEif4CcPC5F2E=";
19   };
21   nativeBuildInputs = [
22     python3.pkgs.wrapPython
23     copyDesktopItems
24     wrapGAppsHook3
25   ];
27   pythonPath = with python3.pkgs; [
28     wxpython
29     humblewx
30     icalendar
31     markdown
32   ];
34   nativeCheckInputs = [
35     gettext
36     python3.pkgs.mock
37   ];
39   desktopItems = [
40     (makeDesktopItem {
41       desktopName = "Timeline";
42       name = "timeline";
43       comment = "Display and navigate information on a timeline";
44       icon = "timeline";
45       exec = "timeline";
46       categories = [
47         "Office"
48         "Calendar"
49       ];
50     })
51   ];
53   dontBuild = true;
54   doCheck = false;
56   patchPhase = ''
57     sed -i "s|_ROOT =.*|_ROOT = \"$out/usr/share/timeline/\"|" source/timelinelib/config/paths.py
58   '';
60   installPhase = ''
61     runHook preInstall
63     site_packages=$out/${python3.pkgs.python.sitePackages}
64     install -D -m755 source/timeline.py $out/bin/timeline
65     mkdir -p $site_packages
66     cp -r source/timelinelib $site_packages/
68     mkdir -p $out/usr/share/timeline/locale
69     cp -r icons $out/usr/share/timeline/
70     cp -r translations/ $out/usr/share/timeline/
72     mkdir -p $out/share/icons/hicolor/{48x48,32x32,16x16}/apps
73     cp icons/48.png $out/share/icons/hicolor/48x48/apps/timeline.png
74     cp icons/32.png $out/share/icons/hicolor/32x32/apps/timeline.png
75     cp icons/16.png $out/share/icons/hicolor/16x16/apps/timeline.png
77     runHook postInstall
78   '';
80   # tests fail because they need an x server
81   # Unable to access the X Display, is $DISPLAY set properly?
82   checkPhase = ''
83     runHook preCheck
84     ${python3.interpreter} tools/execute-specs.py
85     runHook postCheck
86   '';
88   dontWrapGApps = true;
90   preFixup = ''
91     makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
92   '';
94   meta = with lib; {
95     homepage = "https://thetimelineproj.sourceforge.net/";
96     changelog = "https://thetimelineproj.sourceforge.net/changelog.html";
97     description = "Display and navigate information on a timeline";
98     mainProgram = "timeline";
99     license = with licenses; [
100       gpl3Only
101       cc-by-sa-30
102     ];
103     platforms = with platforms; unix;
104     maintainers = with maintainers; [ davidak ];
105   };