nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 106 lines 2.5 kB view raw
1{ 2 lib, 3 fetchurl, 4 python3, 5 gettext, 6 makeDesktopItem, 7 copyDesktopItems, 8 wrapGAppsHook3, 9}: 10 11python3.pkgs.buildPythonApplication rec { 12 pname = "timeline"; 13 version = "2.10.0"; 14 format = "other"; 15 16 src = fetchurl { 17 url = "mirror://sourceforge/thetimelineproj/${pname}-${version}.zip"; 18 sha256 = "sha256-xUWIIpnOohcpD/1esjHQTUxndo4j91hyyAXTmV3Eo0k="; 19 }; 20 21 nativeBuildInputs = [ 22 python3.pkgs.wrapPython 23 copyDesktopItems 24 wrapGAppsHook3 25 ]; 26 27 pythonPath = with python3.pkgs; [ 28 wxpython 29 humblewx 30 icalendar 31 markdown 32 ]; 33 34 nativeCheckInputs = [ 35 gettext 36 python3.pkgs.mock 37 ]; 38 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 ]; 52 53 dontBuild = true; 54 doCheck = false; 55 56 patchPhase = '' 57 sed -i "s|_ROOT =.*|_ROOT = \"$out/usr/share/timeline/\"|" source/timelinelib/config/paths.py 58 ''; 59 60 installPhase = '' 61 runHook preInstall 62 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/ 67 68 mkdir -p $out/usr/share/timeline/locale 69 cp -r icons $out/usr/share/timeline/ 70 cp -r translations/ $out/usr/share/timeline/ 71 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 76 77 runHook postInstall 78 ''; 79 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 ''; 87 88 dontWrapGApps = true; 89 90 preFixup = '' 91 makeWrapperArgs+=("''${gappsWrapperArgs[@]}") 92 ''; 93 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 }; 106}