From 2468315f2b4715ea3392450966e832aab756bc41 Mon Sep 17 00:00:00 2001 From: freezeboy Date: Mon, 21 Sep 2020 15:10:08 +0200 Subject: [PATCH] python3Packages.crc32c: init at 1.0.0 --- .../python-modules/google-crc32c/default.nix | 31 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 +++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/development/python-modules/google-crc32c/default.nix diff --git a/pkgs/development/python-modules/google-crc32c/default.nix b/pkgs/development/python-modules/google-crc32c/default.nix new file mode 100644 index 000000000000..fbed406cebce --- /dev/null +++ b/pkgs/development/python-modules/google-crc32c/default.nix @@ -0,0 +1,31 @@ +{ lib, buildPythonPackage, isPy3k, fetchFromGitHub, cffi, crc32c, pytestCheckHook }: + +buildPythonPackage rec { + pname = "google-crc32c"; + version = "1.0.0"; + + disabled = !isPy3k; + + src = fetchFromGitHub { + owner = "googleapis"; + repo = "python-crc32c"; + rev = "v${version}"; + sha256 = "0n3ggsxmk1fhq0kz6p5rcj4gypfb05i26fcn7lsawakgl7fzxqyl"; + }; + + buildInputs = [ crc32c ]; + propagatedBuildInputs = [ cffi ]; + + LDFLAGS = "-L${crc32c}/lib"; + CFLAGS = "-I${crc32c}/include"; + + checkInputs = [ pytestCheckHook crc32c ]; + pythonImportsCheck = [ "google_crc32c" ]; + + meta = with lib; { + homepage = "https://github.com/googleapis/python-crc32c"; + description = "Wrapper the google/crc32c hardware-based implementation of the CRC32C hashing algorithm"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ freezeboy ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e3c07aea7494..6aa278ce17f7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2467,6 +2467,10 @@ in { google-compute-engine = callPackage ../tools/virtualization/google-compute-engine { }; + google-crc32c = callPackage ../development/python-modules/google-crc32c { + inherit (pkgs) crc32c; + }; + google-i18n-address = callPackage ../development/python-modules/google-i18n-address { }; google-music = callPackage ../development/python-modules/google-music { };