1{ lib
2, buildPythonPackage
3, fetchpatch
4, fetchPypi
5, re2
6}:
7
8buildPythonPackage rec {
9 pname = "fb-re2";
10 version = "1.0.7";
11
12 src = fetchPypi {
13 inherit pname version;
14 sha256 = "83b2c2cd58d3874e6e3a784cf4cf2f1a57ce1969e50180f92b010eea24ef26cf";
15 };
16
17 patches = [
18 # Bump stdlib to c++17 to fix build with recent re2
19 # https://github.com/facebook/pyre2/issues/24
20 # https://github.com/facebook/pyre2/pull/25
21 (fetchpatch {
22 url = "https://github.com/facebook/pyre2/pull/25/commits/08fb06ec3ccd412ca69483d27234684a04cb91a0.patch";
23 hash = "sha256-kzxE2AxpE1tJJK0dJgoFfVka9zy2u0HEqiHoS7DQDQ0=";
24 })
25 ];
26
27 buildInputs = [ re2 ];
28
29 # no tests in PyPI tarball
30 doCheck = false;
31
32 meta = {
33 description = "Python wrapper for Google's RE2";
34 homepage = "https://github.com/facebook/pyre2";
35 license = lib.licenses.bsd3;
36 maintainers = with lib.maintainers; [ ivan ];
37 };
38}