{ stdenv
, fetchurl
, lib

, libatomic_ops
}:

let
  version = "7.6.8";
in
stdenv.mkDerivation rec {
  name = "boehm-gc-${version}";

  src = fetchurl {
    url = "https://github.com/ivmai/bdwgc/releases/download/v${version}/gc-${version}.tar.gz";
    sha256 = "040ac5cdbf1bebc7c8cd4928996bbae0c54497c151ea5639838fa0128102e258";
  };

  buildInputs = [
    libatomic_ops
  ];

  configureFlags = [
    "--enable-cplusplus"
    "--enable-large-config"
  ];

  meta = with lib; {
    description = "The Boehm-Demers-Weiser conservative garbage collector for C and C++";
    homepage = http://hboehm.info/gc/;
    license = licenses.free;
    maintainers = with maintainers; [
      wkennington
    ];
    platforms = with platforms;
      x86_64-linux;
  };
}

{ stdenv
, fetchurl
, lib

, libatomic_ops
}:

let
  version = "7.6.6";
in
stdenv.mkDerivation rec {
  name = "boehm-gc-${version}";

  src = fetchurl {
    url = "https://github.com/ivmai/bdwgc/releases/download/v${version}/gc-${version}.tar.gz";
    # We need the multihash because they delete old releases
    multihash = "QmZCCEGDkqYPG3TJU9M5YcmiMgJAeCBYLtqGjrszHSQvXs";
    sha256 = "e968edf8f80d83284dd473e00a5e3377addc2df261ffb7e6dc77c9a34a0039dc";
  };

  buildInputs = [
    libatomic_ops
  ];

  configureFlags = [
    "--enable-cplusplus"
    "--enable-large-config"
  ];

  meta = with lib; {
    description = "The Boehm-Demers-Weiser conservative garbage collector for C and C++";
    homepage = http://hboehm.info/gc/;
    license = licenses.free;
    maintainers = with maintainers; [
      wkennington
    ];
    platforms = with platforms;
      x86_64-linux;
  };
}

Revert "boehm-gc: 7.6.6 -> 7.6.8"
Revert "boehm-gc: 7.6.6 -> 7.6.8"

This reverts commit 55d6bdc79ca7ec9f082a2f7828c26df2f3ddb7b0.

This breaks api compatibility with Nix 2.0.4.
