17 # Documentation building doesn't work on Darwin. It fails with:
18 # Undefined subroutine &Locale::Messages::dgettext called in ... texi2html
20 # https://github.com/NixOS/nixpkgs/issues/224761
21 docSupport ? (!stdenv.hostPlatform.isDarwin),
29 useElfutils = lib.meta.availableOn stdenv.hostPlatform elfutils;
32 stdenv.mkDerivation (finalAttrs: {
36 src = fetchFromGitHub {
39 rev = "v${finalAttrs.version}";
40 sha256 = "w58HVCvKuWpGJwllupbj7ndeq4iE9LPs/IjFSUN0DOU=";
50 ++ lib.optionals docSupport [
58 (if useElfutils then elfutils else finalAttrs.finalPackage.passthru.libelf)
67 postPatch = lib.optionalString (!useElfutils) ''
68 # vendored libelf is a static library
69 sed -i "s/PREFERRED_LIBELF elf/PREFERRED_LIBELF libelf.a elf/" CMakeLists.txt
73 # -DHAVE_LINUXGPIO=ON because it's incompatible with libgpiod 2.x
75 lib.optionals docSupport [ "-DBUILD_DOC=ON" ]
76 ++ lib.optionals stdenv.hostPlatform.isLinux [
82 # Vendored and mutated copy of libelf for avrdudes use.
83 # Produces a static library only.
84 libelf = callPackage ./libelf.nix { };
88 description = "Command-line tool for programming Atmel AVR microcontrollers";
89 mainProgram = "avrdude";
91 AVRDUDE (AVR Downloader/UploaDEr) is an utility to
92 download/upload/manipulate the ROM and EEPROM contents of AVR
93 microcontrollers using the in-system programming technique (ISP).
95 homepage = "https://www.nongnu.org/avrdude/";
96 license = licenses.gpl2Plus;
97 platforms = with platforms; linux ++ darwin;
98 maintainers = [ maintainers.bjornfor ];