Commit 2772a883 authored by mackb's avatar mackb
Browse files

dfu-programmer: 0.7.2 -> 1.1.0

Fixes migration to GCC 15 and the gnu23 reserved words errors
https://github.com/NixOS/nixpkgs/issues/475479
parent 0a1589e5
Loading
Loading
Loading
Loading
+35 −13
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchurl,
  libusb-compat-0_1,
  fetchFromGitHub,
  autoreconfHook,
  libusb1,
  nix-update-script,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "dfu-programmer";
  version = "0.7.2";
  version = "1.1.0";

  buildInputs = [ libusb-compat-0_1 ];

  src = fetchurl {
    url = "mirror://sourceforge/dfu-programmer/${pname}-${version}.tar.gz";
    sha256 = "15gr99y1z9vbvhrkd25zqhnzhg6zjmaam3vfjzf2mazd39mx7d0x";
  src = fetchFromGitHub {
    owner = "dfu-programmer";
    repo = "dfu-programmer";
    rev = "v${finalAttrs.version}";
    hash = "sha256-YhiBD8rpzEVVaP3Rdfq74lhZ0Mu7OEbrMsM3fBL1Kvk";
  };

  configureFlags = [ "--disable-libusb_1_0" ];
  buildInputs = [
    libusb1
  ];

  nativeBuildInputs = [
    autoreconfHook
  ];

  # No build configured in source, automake requires ChangeLog to exist
  preAutoreconf = ''
    touch ChangeLog
  '';

  postPatch = ''
    patchShebangs --build bootstrap.sh
    patchShebangs --build update-bash-completion.sh
  '';

  env.NIX_CFLAGS_COMPILE = "-std=gnu17";
  passthru.updateScript = nix-update-script { };

  meta = {
    license = lib.licenses.gpl2;
    description = "Device Firmware Update based USB programmer for Atmel chips with a USB bootloader";
    mainProgram = "dfu-programmer";
    homepage = "http://dfu-programmer.sourceforge.net/";
    homepage = "https://github.com/dfu-programmer/dfu-programmer";
    maintainers = with lib.maintainers; [
      mbinns
      cybardev
    ];
    platforms = lib.platforms.unix;
  };
}
})