diff --git a/textproc/py-pyjson5/Makefile b/textproc/py-pyjson5/Makefile new file mode 100644 index 00000000000..87c839c4887 --- /dev/null +++ b/textproc/py-pyjson5/Makefile @@ -0,0 +1,29 @@ +COMMENT= json5 serializer and parser written in Cython + +MODPY_DISTV= 2.0.0 +DISTNAME= pyjson5-${MODPY_DISTV} +PKGNAME= py-${DISTNAME} + +# https://pyjson5.readthedocs.io/en/latest/changelog.html +# https://github.com/Kijewski/pyjson5 +HOMEPAGE= https://pyjson5.readthedocs.io/ + +CATEGORIES= textproc + +# Apache 2.0 +PERMIT_PACKAGE= Yes + +WANTLIB += ${COMPILER_LIBCXX} m + +COMPILER= base-clang ports-gcc + +MODULES= lang/python +MODPY_PYBUILD= setuptools +MODPY_PI= Yes + +BUILD_DEPENDS= lang/cython + +# not in sdist; needs submodules to run from git +NO_TEST= Yes + +.include diff --git a/textproc/py-pyjson5/distinfo b/textproc/py-pyjson5/distinfo new file mode 100644 index 00000000000..281ff844769 --- /dev/null +++ b/textproc/py-pyjson5/distinfo @@ -0,0 +1,2 @@ +SHA256 (pyjson5-2.0.0.tar.gz) = fMyYWGz4ff6t+nbejfTJyww9IdG1WeKIEt2WM3SNbiU= +SIZE (pyjson5-2.0.0.tar.gz) = 305865 diff --git a/textproc/py-pyjson5/patches/patch-setup_py b/textproc/py-pyjson5/patches/patch-setup_py new file mode 100644 index 00000000000..c0dc91bb4ca --- /dev/null +++ b/textproc/py-pyjson5/patches/patch-setup_py @@ -0,0 +1,11 @@ +Index: setup.py +--- setup.py.orig ++++ setup.py +@@ -4,7 +4,6 @@ from setuptools import setup, Extension + + extra_compile_args = [ + "-std=c++11", +- "-O3", + "-fPIC", + "-g0", + "-pipe", diff --git a/textproc/py-pyjson5/patches/patch-third-party_fast_double_parser_include_fast_double_parser_h b/textproc/py-pyjson5/patches/patch-third-party_fast_double_parser_include_fast_double_parser_h new file mode 100644 index 00000000000..5b51103895b --- /dev/null +++ b/textproc/py-pyjson5/patches/patch-third-party_fast_double_parser_include_fast_double_parser_h @@ -0,0 +1,12 @@ +Index: third-party/fast_double_parser/include/fast_double_parser.h +--- third-party/fast_double_parser/include/fast_double_parser.h.orig ++++ third-party/fast_double_parser/include/fast_double_parser.h +@@ -10,7 +10,7 @@ + #include + #include + #include +-#if (defined(sun) || defined(__sun)) ++#if (defined(sun) || defined(__sun) || defined(__OpenBSD__)) + #define FAST_DOUBLE_PARSER_SOLARIS + #endif + diff --git a/textproc/py-pyjson5/pkg/DESCR b/textproc/py-pyjson5/pkg/DESCR new file mode 100644 index 00000000000..ee8f5966c97 --- /dev/null +++ b/textproc/py-pyjson5/pkg/DESCR @@ -0,0 +1,11 @@ +JSON5 serializer and parser library for Python 3 written in Cython. + +The serializer returns ASCII data that can safely be used in an HTML +template. Apostrophes, ampersands, greater-than, and less-then signs are +encoded as unicode escaped sequences. + +Unless the input contains infinite or NaN values, the result will be +valid JSON data. + +The parser can handle all valid JSON5 1.0.0 and JSON data can be read, +unless the nesting level is absurdly high. diff --git a/textproc/py-pyjson5/pkg/PLIST b/textproc/py-pyjson5/pkg/PLIST new file mode 100644 index 00000000000..ed2013d6591 --- /dev/null +++ b/textproc/py-pyjson5/pkg/PLIST @@ -0,0 +1,16 @@ +lib/python${MODPY_VERSION}/site-packages/pyjson5/ +lib/python${MODPY_VERSION}/site-packages/pyjson5-${MODPY_DISTV}.dist-info/ +lib/python${MODPY_VERSION}/site-packages/pyjson5-${MODPY_DISTV}.dist-info/METADATA +lib/python${MODPY_VERSION}/site-packages/pyjson5-${MODPY_DISTV}.dist-info/RECORD +lib/python${MODPY_VERSION}/site-packages/pyjson5-${MODPY_DISTV}.dist-info/WHEEL +lib/python${MODPY_VERSION}/site-packages/pyjson5-${MODPY_DISTV}.dist-info/licenses/ +lib/python${MODPY_VERSION}/site-packages/pyjson5-${MODPY_DISTV}.dist-info/licenses/LICENSE.Apache +lib/python${MODPY_VERSION}/site-packages/pyjson5-${MODPY_DISTV}.dist-info/licenses/LICENSE.MIT +lib/python${MODPY_VERSION}/site-packages/pyjson5-${MODPY_DISTV}.dist-info/top_level.txt +lib/python${MODPY_VERSION}/site-packages/pyjson5/__init__.py +lib/python${MODPY_VERSION}/site-packages/pyjson5/__init__.pyi +lib/python${MODPY_VERSION}/site-packages/pyjson5/${MODPY_PYCACHE}/ +lib/python${MODPY_VERSION}/site-packages/pyjson5/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION} +lib/python${MODPY_VERSION}/site-packages/pyjson5/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc +lib/python${MODPY_VERSION}/site-packages/pyjson5/py.typed +@so lib/python${MODPY_VERSION}/site-packages/pyjson5/pyjson5.${MODPY_PYC_MAGIC_TAG}so