aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/protobuf/py3/.yandex_meta/build.ym
blob: 0c9f6c0d70dda0984bb83e246b82118ba6244c93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{% extends '//builtin/bag.ym' %}

{% block ya_module_type %}PY3_LIBRARY{% endblock %}

{% block current_version %}4.22.5{% endblock %}

{% block current_url %}
https://github.com/protocolbuffers/protobuf/archive/refs/tags/v{{self.version().strip()}}.tar.gz
{% endblock %}

{% block patch_source %}
{{super()}}
rm -rf CMakeLists.txt
(find . -type f -name '*_test.py') | while read l; do
    rm -rf ${l}
done
rm -rf python/google/protobuf/internal/import_test_package
rm -rf python/google/protobuf/internal/test_util.py
{% endblock %}

{% block ya_make %}
PEERDIR(
    contrib/libs/protobuf
    contrib/libs/protobuf/builtin_proto/protos_from_protobuf
    contrib/libs/protobuf/builtin_proto/protos_from_protoc
    contrib/libs/python
    contrib/restricted/abseil-cpp-tstring/y_absl/strings
    contrib/restricted/abseil-cpp-tstring/y_absl/log
)

NO_LINT()
ADDINCL(contrib/python/protobuf/py3)
CFLAGS(-DPYTHON_PROTO2_CPP_IMPL_V2)

INCLUDE(ya.make.inc)

PY_REGISTER(
    google.protobuf.internal._api_implementation
    google.protobuf.pyext._message
)

{% endblock %}


{% block prepare_yamake %}
{{super()}}
cd ${SRC}/python/google
(
echo 'PY_SRCS('
echo '    TOP_LEVEL'
find . -type f -name '*.py' | sort | sed -En 's|\.\/|    google\/|p'
echo ')'
) > ya.make.inc

cd ${SRC}/python/google
(
echo 'SRCS('
find . -type f -name '*.cc' |  sort | sed -En 's|\.\/|    google\/|p'
echo ')'
) >> ya.make.inc

cd -
{% endblock %}


{% block move_to_output %}
{{super()}}

cd ${SRC}/python/google
(
    find . -type f -name '*.cc'
    find . -type f -name '*.h'
    find . -type f -name '*.py'
) | while read l; do
    install -v -D -m 0644 ${l} ${OUTPUT}/google/${l}
done

cp ya.make.inc ${OUTPUT}/

{% endblock %}