13 stdenvNoCC.mkDerivation (finalAttrs: {
17 # https://www.gov.br/receitafederal/pt-br/centrais-de-conteudo/download/pgd/dirpf
18 # Para outros sistemas operacionais -> Multi
20 year = lib.head (lib.splitVersion finalAttrs.version);
22 url = "https://downloadirpf.receita.fazenda.gov.br/irpf/${year}/irpf/arquivos/IRPF${finalAttrs.version}.zip";
23 hash = "sha256-223PZyGlLSK5GzR143IlGzhmJlXmvtBdscC2roPiQhc=";
26 passthru.updateScript = writeScript "update-irpf" ''
27 #!/usr/bin/env nix-shell
28 #!nix-shell -i bash -p curl pup common-updater-scripts
31 #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
32 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)"
33 update-source-version irpf "$version"
36 nativeBuildInputs = [ unzip makeWrapper copyDesktopItems ];
40 name = finalAttrs.pname;
41 exec = finalAttrs.pname;
43 desktopName = "Imposto de Renda Pessoa Física";
44 comment = "Programa Oficial da Receita para elaboração do IRPF";
45 categories = [ "Office" ];
52 BASEDIR="$out/share/${finalAttrs.pname}"
55 cp --no-preserve=mode -r help lib lib-modulos "$BASEDIR"
57 install -Dm644 irpf.jar Leia-me.htm offline.png online.png pgd-updater.jar "$BASEDIR"
59 # make xdg-open overrideable at runtime
60 makeWrapper ${jdk11}/bin/java $out/bin/${finalAttrs.pname} \
61 --add-flags "-Dawt.useSystemAAFontSettings=on" \
62 --add-flags "-Dswing.aatext=true" \
63 --add-flags "-jar $BASEDIR/${finalAttrs.pname}.jar" \
64 --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \
65 --set _JAVA_AWT_WM_NONREPARENTING 1 \
66 --set AWT_TOOLKIT MToolkit
68 mkdir -p $out/share/pixmaps
69 unzip -j lib/ppgd-icones-4.0.jar icones/rfb64.png -d $out/share/pixmaps
75 description = "Brazillian government application for reporting income tax";
77 Brazillian government application for reporting income tax.
79 IRFP - Imposto de Renda Pessoa Física - Receita Federal do Brasil.
81 homepage = "https://www.gov.br/receitafederal/pt-br";
82 license = licenses.unfree;
83 platforms = platforms.all;
84 sourceProvenance = with sourceTypes; [ binaryBytecode ];
85 maintainers = with maintainers; [ atila bryanasdev000 ];