Unverified Commit e678a655 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

cpplint: 1.6.1 -> 1.7.0; Fix build (#339081)

parents e5eea31c 7eec60e5
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
{ lib, python3Packages, fetchFromGitHub }:
{ lib, fetchpatch, python3Packages, fetchFromGitHub }:

python3Packages.buildPythonApplication rec {
  pname = "cpplint";
  version = "1.6.1";
  version = "1.7.0";
  pyproject = true;

  # Fetch from github instead of pypi, since the test cases are not in the pypi archive
  src = fetchFromGitHub {
    owner = "cpplint";
    repo = "cpplint";
    rev = "refs/tags/${version}";
    hash = "sha256-N5YrlhEXQGYxhsJ4M5dGYZUzA81GKRSI83goaqbtCkI=";
    # Commit where version was bumped to 1.7.0, no tag available
    rev = "8f62396aff6dc850415cbe5ed7edf9dc95f4a731";
    hash = "sha256-EKD7vkxJjoKWfPrXEQRA0X3PyAoYXi9wGgUFT1zC4WM=";
  };

  patches = [
    # Whitespace fixes that make the tests pass
    (fetchpatch {
      url = "https://github.com/cpplint/cpplint/commit/fd257bd78db02888cf6b5985ab8f53d6b765704f.patch";
      hash = "sha256-BNyW8QEY9fUe2zMG4RZzBHASaIsu4d2FJt5rX3VgkrQ=";
    })
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace-fail '"pytest-runner==5.2"' ""

    patchShebangs cpplint_unittest.py

    substituteInPlace cpplint_unittest.py \
      --replace-fail "assertEquals" "assertEqual"
  '';

  build-system = with python3Packages; [