From 7eec60e5e7b4ef5c21a48404bfdb66816c2fce2c Mon Sep 17 00:00:00 2001 From: tu-maurice Date: Mon, 2 Sep 2024 20:56:18 +0200 Subject: [PATCH] cpplint: 1.6.1 -> 1.7.0; Fix build --- .../tools/analysis/cpplint/default.nix | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pkgs/development/tools/analysis/cpplint/default.nix b/pkgs/development/tools/analysis/cpplint/default.nix index f4dcd71f0b3c..d9603ca0548d 100644 --- a/pkgs/development/tools/analysis/cpplint/default.nix +++ b/pkgs/development/tools/analysis/cpplint/default.nix @@ -1,26 +1,32 @@ -{ 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; [