Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / po / portfolio / package.nix
blob1bc1d68a2970edfec7b81760ad002c11ff15a053
2   lib,
3   stdenv,
4   autoPatchelfHook,
5   fetchurl,
6   glib-networking,
7   glibc,
8   gcc-unwrapped,
9   gtk3,
10   openjdk17,
11   libsecret,
12   makeDesktopItem,
13   webkitgtk,
14   wrapGAppsHook3,
15   gitUpdater,
17 let
18   desktopItem = makeDesktopItem {
19     name = "Portfolio";
20     exec = "portfolio";
21     icon = "portfolio";
22     comment = "Calculate Investment Portfolio Performance";
23     desktopName = "Portfolio Performance";
24     categories = [ "Office" ];
25   };
27   runtimeLibs = lib.makeLibraryPath [
28     gtk3
29     webkitgtk
30   ];
32 stdenv.mkDerivation rec {
33   pname = "PortfolioPerformance";
34   version = "0.69.1";
36   src = fetchurl {
37     url = "https://github.com/buchen/portfolio/releases/download/${version}/PortfolioPerformance-${version}-linux.gtk.x86_64.tar.gz";
38     hash = "sha256-Q36pQkxFMwwb6qHZYqer/em6G4TlFmFwtFhB0YUsOlw=";
39   };
41   nativeBuildInputs = [
42     autoPatchelfHook
43     wrapGAppsHook3
44   ];
46   buildInputs = [
47     gcc-unwrapped
48     glib-networking
49     glibc
50     libsecret
51   ];
53   installPhase = ''
54     mkdir -p $out/portfolio
55     cp -av ./* $out/portfolio
57     makeWrapper $out/portfolio/PortfolioPerformance $out/bin/portfolio \
58       --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \
59       --prefix PATH : ${openjdk17}/bin
61     # Create desktop item
62     mkdir -p $out/share/applications
63     cp ${desktopItem}/share/applications/* $out/share/applications
64     mkdir -p $out/share/pixmaps
65     ln -s $out/portfolio/icon.xpm $out/share/pixmaps/portfolio.xpm
66   '';
68   passthru.updateScript = gitUpdater { url = "https://github.com/buchen/portfolio.git"; };
70   meta = with lib; {
71     description = "Simple tool to calculate the overall performance of an investment portfolio";
72     homepage = "https://www.portfolio-performance.info/";
73     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
74     license = licenses.epl10;
75     maintainers = with maintainers; [
76       kilianar
77       oyren
78       shawn8901
79     ];
80     mainProgram = "portfolio";
81     platforms = [ "x86_64-linux" ];
82   };