14 stdenvNoCC.mkDerivation (finalAttrs: {
18 # https://www.gov.br/receitafederal/pt-br/centrais-de-conteudo/download/pgd/dirpf
19 # Para outros sistemas operacionais -> Multi
22 year = lib.head (lib.splitVersion finalAttrs.version);
25 url = "https://downloadirpf.receita.fazenda.gov.br/irpf/${year}/irpf/arquivos/IRPF${finalAttrs.version}.zip";
26 hash = "sha256-Pz8oI96GpLcHFEtnKUHnUHtZL3/QGhtG93ab5Au/tw0=";
29 passthru.updateScript = writeScript "update-irpf" ''
30 #!/usr/bin/env nix-shell
31 #!nix-shell -i bash -p curl pup common-updater-scripts
34 #parses the html with the install links for the containers that contain the instalation files of type 'file archive, gets the version number of each version, and sorts to get the latest one on the website
35 version="$(curl -s https://www.gov.br/receitafederal/pt-br/centrais-de-conteudo/download/pgd/dirpf | pup '.rfb_container .rfb_ositem:parent-of(.fa-file-archive) attr{href}' | grep -oP "IRPF\K(\d+)-[\d.]+\d" | sort -r | head -1)"
36 update-source-version irpf "$version"
47 name = finalAttrs.pname;
48 exec = finalAttrs.pname;
50 desktopName = "Imposto de Renda Pessoa Física";
51 comment = "Programa Oficial da Receita para elaboração do IRPF";
52 categories = [ "Office" ];
59 BASEDIR="$out/share/${finalAttrs.pname}"
62 cp --no-preserve=mode -r help lib lib-modulos "$BASEDIR"
64 install -Dm644 irpf.jar Leia-me.htm offline.png online.png pgd-updater.jar "$BASEDIR"
66 # make xdg-open overrideable at runtime
67 makeWrapper ${jdk11}/bin/java $out/bin/${finalAttrs.pname} \
68 --add-flags "-Dawt.useSystemAAFontSettings=on" \
69 --add-flags "-Dswing.aatext=true" \
70 --add-flags "-jar $BASEDIR/${finalAttrs.pname}.jar" \
71 --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \
72 --set _JAVA_AWT_WM_NONREPARENTING 1 \
73 --set AWT_TOOLKIT MToolkit
75 mkdir -p $out/share/pixmaps
76 unzip -j lib/ppgd-icones-4.0.jar icones/rfb64.png -d $out/share/pixmaps
82 description = "Brazillian government application for reporting income tax";
84 Brazillian government application for reporting income tax.
86 IRFP - Imposto de Renda Pessoa Física - Receita Federal do Brasil.
88 homepage = "https://www.gov.br/receitafederal/pt-br";
89 license = licenses.unfree;
90 platforms = platforms.all;
91 sourceProvenance = with sourceTypes; [ binaryBytecode ];
92 maintainers = with maintainers; [