svn commit: r566466 - in head/devel: . py-protobuf-compiler py-protobuf-compiler/files

Mateusz Piotrowski 0mp at FreeBSD.org
Wed Feb 24 10:39:06 UTC 2021


Author: 0mp
Date: Wed Feb 24 10:39:04 2021
New Revision: 566466
URL: https://svnweb.freebsd.org/changeset/ports/566466

Log:
  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

Added:
  head/devel/py-protobuf-compiler/
  head/devel/py-protobuf-compiler/Makefile   (contents, props changed)
  head/devel/py-protobuf-compiler/distinfo   (contents, props changed)
  head/devel/py-protobuf-compiler/files/
  head/devel/py-protobuf-compiler/files/patch-protobuf__compiler_main.py   (contents, props changed)
  head/devel/py-protobuf-compiler/files/patch-setup.py   (contents, props changed)
  head/devel/py-protobuf-compiler/pkg-descr   (contents, props changed)
Modified:
  head/devel/Makefile

Modified: head/devel/Makefile
==============================================================================
--- head/devel/Makefile	Wed Feb 24 10:37:11 2021	(r566465)
+++ head/devel/Makefile	Wed Feb 24 10:39:04 2021	(r566466)
@@ -4837,6 +4837,7 @@
     SUBDIR += py-proselint
     SUBDIR += py-proto-plus
     SUBDIR += py-protobuf
+    SUBDIR += py-protobuf-compiler
     SUBDIR += py-proxmoxer
     SUBDIR += py-ptable
     SUBDIR += py-ptpython

Added: head/devel/py-protobuf-compiler/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/py-protobuf-compiler/Makefile	Wed Feb 24 10:39:04 2021	(r566466)
@@ -0,0 +1,49 @@
+# $FreeBSD$
+
+PORTNAME=	protobuf-compiler
+DISTVERSION=	1.0.20
+CATEGORIES=	devel python
+MASTER_SITES=	CHEESESHOP
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+DISTNAME=	${PORTNAME:S/-/_/}-${DISTVERSION}
+DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
+
+MAINTAINER=	0mp at FreeBSD.org
+COMMENT=	Compile all protobuf files and create package distributions
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC_tests}/LICENSE
+
+BUILD_DEPENDS=	${_MY_DEPENDS}
+RUN_DEPENDS=	${_MY_DEPENDS}
+
+USES=		python:3.6+ shebangfix
+USE_GITHUB=	nodefault
+GH_TUPLE=	netsaj:python-${PORTNAME}:7cb32ab8188cbfecb91034cbf7803394ed1c25b6:tests
+USE_PYTHON=	autoplist concurrent distutils
+SHEBANG_GLOB=	*.py
+
+TEST_ENV=	PYTHONPATH="${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}"
+NO_ARCH=	yes
+TEST_WRKSRC=	${WRKSRC_tests}
+
+_MY_DEPENDS=	${PYTHON_PKGNAMEPREFIX}bleach>=2.1.0:www/py-bleach@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}colorama>=0.3.3:devel/py-colorama@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}grpcio-tools>=1.18.0:devel/py-grpcio-tools@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}grpcio>=1.18.0:devel/py-grpcio@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}termcolor>=1.1.0:devel/py-termcolor@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}tqdm>=4.31.1:misc/py-tqdm@${PY_FLAVOR}
+
+post-patch:
+	${REINPLACE_CMD} 's|%%PYTHON_CMD%%|${PYTHON_CMD}|g' \
+		${WRKSRC}/protobuf_compiler/main.py
+
+do-test:
+# Loosely based on the upstream test_protopy.py.
+	${RM} -r ${TEST_WRKSRC}/run_test
+	cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} \
+		${PYTHON_CMD} ${STAGEDIR}${PREFIX}/bin/protopy \
+		-o ./run_test -d ./test -p mytesting -v 1.0.1
+	${TEST} -e ${TEST_WRKSRC}/run_test/mytesting-1.0.1.tar.gz
+
+.include <bsd.port.mk>

Added: head/devel/py-protobuf-compiler/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/py-protobuf-compiler/distinfo	Wed Feb 24 10:39:04 2021	(r566466)
@@ -0,0 +1,5 @@
+TIMESTAMP = 1614156744
+SHA256 (protobuf_compiler-1.0.20.tar.gz) = ac8daa7187fb9cac7752008368b79d8d8e44dd1b154423fa7afd227a31d062f6
+SIZE (protobuf_compiler-1.0.20.tar.gz) = 5296
+SHA256 (netsaj-python-protobuf-compiler-7cb32ab8188cbfecb91034cbf7803394ed1c25b6_GH0.tar.gz) = 72b8f59ef6ee9999701b09b2611fc3d79d7c500821fbb2edc4e8a1d4db864771
+SIZE (netsaj-python-protobuf-compiler-7cb32ab8188cbfecb91034cbf7803394ed1c25b6_GH0.tar.gz) = 7499

Added: head/devel/py-protobuf-compiler/files/patch-protobuf__compiler_main.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/py-protobuf-compiler/files/patch-protobuf__compiler_main.py	Wed Feb 24 10:39:04 2021	(r566466)
@@ -0,0 +1,20 @@
+--- 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 != '':

Added: head/devel/py-protobuf-compiler/files/patch-setup.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/py-protobuf-compiler/files/patch-setup.py	Wed Feb 24 10:39:04 2021	(r566466)
@@ -0,0 +1,21 @@
+--- setup.py.orig	2021-02-24 08:56:12 UTC
++++ setup.py
+@@ -24,12 +24,12 @@ setup(
+         "Programming Language :: Python :: 3.6",
+     ],
+     install_requires=[
+-        'grpcio==1.18.0',
+-        'grpcio-tools==1.18.0',
+-        'colorama==0.3.3',
+-        'termcolor==1.1.0',
+-        'tqdm==4.31.1',
+-        'bleach==2.1.0'
++        'grpcio>=1.18.0',
++        'grpcio-tools>=1.18.0',
++        'colorama>=0.3.3',
++        'termcolor>=1.1.0',
++        'tqdm>=4.31.1',
++        'bleach>=2.1.0'
+     ],
+     entry_points={
+         'console_scripts': [

Added: head/devel/py-protobuf-compiler/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/py-protobuf-compiler/pkg-descr	Wed Feb 24 10:39:04 2021	(r566466)
@@ -0,0 +1,4 @@
+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


More information about the svn-ports-all mailing list