ports/devel/py-protobuf-compiler/files/patch-protobuf__compiler_main.py
Mateusz Piotrowski b7aef02ff7 Add devel/py-protobuf-compiler
Python protobuf compiler can be used to compile collections protobuf files
and create a single package distribution suitable for installing with pip.

WWW: https://github.com/netsaj/python-protobuf-compiler
2021-02-24 10:39:04 +00:00

20 lines
984 B
Python

--- protobuf_compiler/main.py.orig 2021-02-24 09:06:33 UTC
+++ protobuf_compiler/main.py
@@ -100,7 +100,7 @@ def main():
for f in files:
file_name = f.split(os.path.sep)[-1]
folder = f.replace(file_name,"").replace(input_dir + os.path.sep, "")
- command = "python3 -m grpc_tools.protoc -I. \
+ command = "%%PYTHON_CMD%% -m grpc_tools.protoc -I. \
--proto_path=" + input_dir + " \
--python_out=" + os.path.join(output_dir, package_name) + " \
--grpc_python_out=" + os.path.join(output_dir, package_name) + " \
@@ -130,7 +130,7 @@ setup(
description=''
)
""")
- command = "cd " + os.path.join(output_dir, package_name) + " && python3 setup.py sdist"
+ command = "cd " + os.path.join(output_dir, package_name) + " && %%PYTHON_CMD%% setup.py sdist"
out = os.system(command)
# print(out)
if args.repository != '':