diff options
author | Átila Saraiva <atilasaraiva@gmail.com> | 2022-03-08 13:53:26 -0300 |
---|---|---|
committer | AtilaSaraiva <atilasaraiva@gmail.com> | 2022-03-14 11:10:11 -0300 |
commit | 899f1131d406ee4881b8e3962b14f06e2219cb87 (patch) | |
tree | 37d0b2c003012a05c85095df155da3db043cfd9c /pkgs/applications/finance/irpf | |
parent | b783c48432cdfc35224a39bd95666daa62fef126 (diff) |
irpf: init at 2022-1.0
Diffstat (limited to 'pkgs/applications/finance/irpf')
-rw-r--r-- | pkgs/applications/finance/irpf/default.nix | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/applications/finance/irpf/default.nix b/pkgs/applications/finance/irpf/default.nix new file mode 100644 index 0000000000000..e7ac78da18ef4 --- /dev/null +++ b/pkgs/applications/finance/irpf/default.nix @@ -0,0 +1,66 @@ +{ lib +, stdenvNoCC +, fetchzip +, copyDesktopItems +, jdk11 +, makeDesktopItem +, makeWrapper +, unzip +}: + +stdenvNoCC.mkDerivation rec { + pname = "irpf"; + version = "2022-1.0"; + + src = let + year = lib.head (lib.splitVersion version); + in fetchzip { + url = "https://downloadirpf.receita.fazenda.gov.br/irpf/${year}/irpf/arquivos/IRPF${version}.zip"; + sha256 = "0h8f51ilvg7m6hlx0y5mpxhac90p32ksbrffw0hxdqbilgjz1s68"; + }; + + nativeBuildInputs = [ unzip makeWrapper copyDesktopItems ]; + + desktopItems = [ + (makeDesktopItem rec { + name = pname; + exec = pname; + icon = "rfb64"; + desktopName = "Imposto de Renda Pessoa Física"; + comment = "Programa Oficial da Receita para elaboração do IRPF"; + categories = [ "Office" ]; + }) + ]; + + installPhase = '' + runHook preInstall + + BASEDIR="$out/share/${pname}" + mkdir -p "$BASEDIR" + + cp -r help lib lib-modulos "$BASEDIR" + + install -Dm755 irpf.jar "$BASEDIR/${pname}.jar" + install -Dm644 Leia-me.htm offline.png online.png pgd-updater.jar "$BASEDIR" + + makeWrapper ${jdk11}/bin/java $out/bin/${pname} \ + --add-flags "-Dawt.useSystemAAFontSettings=on" \ + --add-flags "-Dswing.aatext=true" \ + --add-flags "-jar $BASEDIR/${pname}.jar" \ + --set _JAVA_AWT_WM_NONREPARENTING 1 \ + --set AWT_TOOLKIT MToolkit + + mkdir -p $out/share/pixmaps + unzip -j lib/ppgd-icones-4.0.jar icones/rfb64.png -d $out/share/pixmaps + + runHook postInstall + ''; + + meta = with lib; { + description = "Programa Oficial da Receita para elaboração do IRPF"; + homepage = "https://www.gov.br/receitafederal/pt-br"; + license = licenses.unfree; + platforms = platforms.all; + maintainers = with maintainers; [ atila ]; + }; +} |