thunderbird*: 128.5.*esr -> 128.5.2esr (#364288)
[NixPkgs.git] / pkgs / by-name / po / portfolio / package.nix
blob9d1b41fa6624b48ad26e6c28fbf7773fa20415e5
2   autoPatchelfHook,
3   fetchurl,
4   glib,
5   glib-networking,
6   gtk3,
7   lib,
8   libsecret,
9   makeDesktopItem,
10   openjdk21,
11   stdenvNoCC,
12   webkitgtk_4_0,
13   wrapGAppsHook3,
14   gitUpdater,
16 let
17   desktopItem = makeDesktopItem {
18     name = "Portfolio";
19     exec = "portfolio";
20     icon = "portfolio";
21     comment = "Calculate Investment Portfolio Performance";
22     desktopName = "Portfolio Performance";
23     categories = [ "Office" ];
24   };
26   runtimeLibs = lib.makeLibraryPath [
27     glib
28     glib-networking
29     gtk3
30     libsecret
31     webkitgtk_4_0
32   ];
34 stdenvNoCC.mkDerivation (finalAttrs: {
35   pname = "PortfolioPerformance";
36   version = "0.72.2";
38   src = fetchurl {
39     url = "https://github.com/buchen/portfolio/releases/download/${finalAttrs.version}/PortfolioPerformance-${finalAttrs.version}-linux.gtk.x86_64.tar.gz";
40     hash = "sha256-IYidpwN82j/XKUV+Z3V2pNkxTh9BTTCYD+322ILxZgU=";
41   };
43   nativeBuildInputs = [
44     autoPatchelfHook
45     wrapGAppsHook3
46   ];
48   dontConfigure = true;
49   dontBuild = true;
51   installPhase = ''
52     mkdir -p $out/portfolio
53     cp -av ./* $out/portfolio
55     makeWrapper $out/portfolio/PortfolioPerformance $out/bin/portfolio \
56       --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \
57       --prefix PATH : ${openjdk21}/bin
59     # Create desktop item
60     mkdir -p $out/share/applications
61     cp ${desktopItem}/share/applications/* $out/share/applications
62     mkdir -p $out/share/pixmaps
63     ln -s $out/portfolio/icon.xpm $out/share/pixmaps/portfolio.xpm
64   '';
66   passthru.updateScript = gitUpdater { url = "https://github.com/buchen/portfolio.git"; };
68   meta = {
69     description = "Simple tool to calculate the overall performance of an investment portfolio";
70     homepage = "https://www.portfolio-performance.info/";
71     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
72     license = lib.licenses.epl10;
73     maintainers = with lib.maintainers; [
74       kilianar
75       oyren
76       shawn8901
77     ];
78     mainProgram = "portfolio";
79     platforms = [ "x86_64-linux" ];
80   };