avrdude: use finalAttrs instead of rec

This commit is contained in:
Philip Taron 2024-04-11 12:59:01 -07:00 committed by Sandro Jäckel
parent 55ddcaf70d
commit 07b7ca8345
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -10,14 +10,14 @@ let
useElfutils = lib.meta.availableOn stdenv.hostPlatform elfutils; useElfutils = lib.meta.availableOn stdenv.hostPlatform elfutils;
in in
stdenv.mkDerivation rec { stdenv.mkDerivation (finalAttrs: {
pname = "avrdude"; pname = "avrdude";
version = "7.3"; version = "7.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "avrdudes"; owner = "avrdudes";
repo = pname; repo = "avdude";
rev = "v${version}"; rev = "v${finalAttrs.version}";
sha256 = "sha256-JqW3AOMmAfcy+PQRcqviWlxA6GoMSEfzIFt1pRYY7Dw="; sha256 = "sha256-JqW3AOMmAfcy+PQRcqviWlxA6GoMSEfzIFt1pRYY7Dw=";
}; };
@ -43,16 +43,13 @@ stdenv.mkDerivation rec {
''; '';
# Not used: # Not used:
#
# -DHAVE_LINUXGPIO=ON because it's incompatible with libgpiod 2.x # -DHAVE_LINUXGPIO=ON because it's incompatible with libgpiod 2.x
# cmakeFlags = lib.optionals docSupport [ "-DBUILD_DOC=ON" ]
cmakeFlags = [ ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "-DHAVE_LINUXSPI=ON" "-DHAVE_PARPORT=ON" ];
++ lib.optionals stdenv.hostPlatform.isLinux [ "-DHAVE_LINUXSPI=ON" "-DHAVE_PARPORT=ON" ]
++ lib.optionals docSupport [ "-DBUILD_DOC=ON" ];
# dvips output references texlive in comments, resulting in a huge closure # dvips output references texlive in comments, resulting in a huge closure
postInstall = lib.optionalString docSupport '' postInstall = lib.optionalString docSupport ''
rm $out/share/doc/${pname}/*.ps rm $out/share/doc/avrdude/*.ps
''; '';
passthru = { passthru = {
@ -74,4 +71,4 @@ stdenv.mkDerivation rec {
platforms = with platforms; linux ++ darwin; platforms = with platforms; linux ++ darwin;
maintainers = [ maintainers.bjornfor ]; maintainers = [ maintainers.bjornfor ];
}; };
} })