2021-10-09 14:59:57 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-05-29 06:06:01 +00:00
|
|
|
, autoPatchelfHook
|
|
|
|
, fetchurl
|
2022-09-09 14:08:57 +00:00
|
|
|
, glib-networking
|
2020-05-29 06:06:01 +00:00
|
|
|
, glibc
|
|
|
|
, gcc-unwrapped
|
|
|
|
, gtk3
|
|
|
|
, jre
|
|
|
|
, libsecret
|
|
|
|
, makeDesktopItem
|
|
|
|
, webkitgtk
|
|
|
|
, wrapGAppsHook
|
2022-12-02 08:20:57 +00:00
|
|
|
, writeScript
|
2020-05-29 06:06:01 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "Portfolio";
|
|
|
|
exec = "portfolio";
|
|
|
|
icon = "portfolio";
|
|
|
|
comment = "Calculate Investment Portfolio Performance";
|
|
|
|
desktopName = "Portfolio Performance";
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Office" ];
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
runtimeLibs = lib.makeLibraryPath [ gtk3 webkitgtk ];
|
2020-05-29 06:06:01 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "PortfolioPerformance";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.67.0";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/buchen/portfolio/releases/download/${version}/PortfolioPerformance-${version}-linux.gtk.x86_64.tar.gz";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-bm38t8wgLEYZVDsMnOv3Wj6TgKu2s36wo8q0Sj7pPNI=";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gcc-unwrapped
|
2022-09-09 14:08:57 +00:00
|
|
|
glib-networking
|
|
|
|
glibc
|
2020-05-29 06:06:01 +00:00
|
|
|
libsecret
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/portfolio
|
|
|
|
cp -av ./* $out/portfolio
|
|
|
|
|
|
|
|
makeWrapper $out/portfolio/PortfolioPerformance $out/bin/portfolio \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${runtimeLibs}" \
|
|
|
|
--prefix PATH : ${jre}/bin
|
|
|
|
|
|
|
|
# Create desktop item
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp ${desktopItem}/share/applications/* $out/share/applications
|
|
|
|
mkdir -p $out/share/pixmaps
|
|
|
|
ln -s $out/portfolio/icon.xpm $out/share/pixmaps/portfolio.xpm
|
|
|
|
'';
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
passthru.updateScript = writeScript "update.sh" ''
|
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
#!nix-shell -i bash -p curl jq common-updater-scripts
|
|
|
|
version="$(curl -sL "https://api.github.com/repos/buchen/portfolio/tags" | jq '.[0].name' --raw-output)"
|
|
|
|
update-source-version portfolio "$version"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-19 00:13:06 +00:00
|
|
|
description = "A simple tool to calculate the overall performance of an investment portfolio";
|
2020-05-29 06:06:01 +00:00
|
|
|
homepage = "https://www.portfolio-performance.info/";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-05-29 06:06:01 +00:00
|
|
|
license = licenses.epl10;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ elohmeier kilianar oyren shawn8901 ];
|
2022-12-02 08:20:57 +00:00
|
|
|
mainProgram = "portfolio";
|
2020-05-29 06:06:01 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|