irpf: change from using rec to finalAttrs syntax

This commit is contained in:
loco-choco 2024-03-29 20:23:46 -03:00 committed by Locochoco
parent df0ba5c92d
commit 0bd8b0ed2f

View File

@ -10,16 +10,16 @@
, writeScript
}:
stdenvNoCC.mkDerivation rec {
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "irpf";
version = "2024-1.1";
# https://www.gov.br/receitafederal/pt-br/centrais-de-conteudo/download/pgd/dirpf
# Para outros sistemas operacionais -> Multi
src = let
year = lib.head (lib.splitVersion version);
year = lib.head (lib.splitVersion finalAttrs.version);
in fetchzip {
url = "https://downloadirpf.receita.fazenda.gov.br/irpf/${year}/irpf/arquivos/IRPF${version}.zip";
url = "https://downloadirpf.receita.fazenda.gov.br/irpf/${year}/irpf/arquivos/IRPF${finalAttrs.version}.zip";
hash = "sha256-7Eh5XhZKs2DAQC33ICUG+mgjEU7H3jdYZSeiHNJ6I6Q=";
};
@ -37,8 +37,8 @@ stdenvNoCC.mkDerivation rec {
desktopItems = [
(makeDesktopItem {
name = pname;
exec = pname;
name = finalAttrs.pname;
exec = finalAttrs.pname;
icon = "rfb64";
desktopName = "Imposto de Renda Pessoa Física";
comment = "Programa Oficial da Receita para elaboração do IRPF";
@ -49,7 +49,7 @@ stdenvNoCC.mkDerivation rec {
installPhase = ''
runHook preInstall
BASEDIR="$out/share/${pname}"
BASEDIR="$out/share/${finalAttrs.pname}"
mkdir -p "$BASEDIR"
cp --no-preserve=mode -r help lib lib-modulos "$BASEDIR"
@ -57,10 +57,10 @@ stdenvNoCC.mkDerivation rec {
install -Dm644 irpf.jar Leia-me.htm offline.png online.png pgd-updater.jar "$BASEDIR"
# make xdg-open overrideable at runtime
makeWrapper ${jdk11}/bin/java $out/bin/${pname} \
makeWrapper ${jdk11}/bin/java $out/bin/${finalAttrs.pname} \
--add-flags "-Dawt.useSystemAAFontSettings=on" \
--add-flags "-Dswing.aatext=true" \
--add-flags "-jar $BASEDIR/${pname}.jar" \
--add-flags "-jar $BASEDIR/${finalAttrs.pname}.jar" \
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \
--set _JAVA_AWT_WM_NONREPARENTING 1 \
--set AWT_TOOLKIT MToolkit
@ -85,4 +85,4 @@ stdenvNoCC.mkDerivation rec {
maintainers = with maintainers; [ atila bryanasdev000 ];
mainProgram = "irpf";
};
}
})