From a8672602224e674248b828ab9b870c883587c14b Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 16 May 2019 14:26:48 -0500 Subject: [PATCH] whatstyle: init at 0.1.7 --- .../tools/misc/whatstyle/default.nix | 30 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +++ 2 files changed, 34 insertions(+) create mode 100644 pkgs/development/tools/misc/whatstyle/default.nix diff --git a/pkgs/development/tools/misc/whatstyle/default.nix b/pkgs/development/tools/misc/whatstyle/default.nix new file mode 100644 index 000000000000..0c6e4f568ffc --- /dev/null +++ b/pkgs/development/tools/misc/whatstyle/default.nix @@ -0,0 +1,30 @@ +{ stdenv, python3, fetchFromGitHub, clang-unwrapped }: + +python3.pkgs.buildPythonApplication rec { + pname = "whatstyle"; + version = "0.1.7"; + src = fetchFromGitHub { + owner = "mikr"; + repo = pname; + rev = "v${version}"; + sha256 = "16ak4g149cr764c1lqakiyzmf5s98w8bdc4gk69m8qacimfg3mzm"; + }; + + # Fix references to previous version, to avoid confusion: + postPatch = '' + substituteInPlace setup.py --replace 0.1.6 ${version} + substituteInPlace ${pname}.py --replace 0.1.6 ${version} + ''; + + checkInputs = [ clang-unwrapped /* clang-format */ ]; + + doCheck = false; # 3 or 4 failures depending on version, haven't investigated. + + meta = with stdenv.lib; { + description = "Find a code format style that fits given source files"; + homepage = https://github.com/mikr/whatstyle; + license = licenses.mit; + maintainers = with maintainers; [ dtzWill ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3d9f4b8ae604..8d2e49510b3a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9694,6 +9694,10 @@ in vtable-dumper = callPackage ../development/tools/misc/vtable-dumper { }; + whatstyle = callPackage ../development/tools/misc/whatstyle { + inherit (llvmPackages) clang-unwrapped; + }; + watson-ruby = callPackage ../development/tools/misc/watson-ruby {}; xc3sprog = callPackage ../development/tools/misc/xc3sprog { };