Import py-demjson.

---8<---
The demjson module, and the included jsonlint script, provide methods
for encoding and decoding JSON formatted data, as well as checking JSON
data for errors and/or portability issues. The jsonlint command/script
can be used from the command line without needing any programming.
--->8---

OK giovanni@, awolk@, Thanks.
This commit is contained in:
edd 2016-09-02 14:12:20 +00:00
parent 91219e521e
commit 4cbbbcdfc7
5 changed files with 89 additions and 0 deletions

View File

@ -0,0 +1,34 @@
# $OpenBSD: Makefile,v 1.1.1.1 2016/09/02 14:12:20 edd Exp $
COMMENT = encoder, decoder, and lint/validator for JSON
DISTNAME = demjson-${MODPY_EGG_VERSION}
MODPY_EGG_VERSION = 2.2.4
MODPY_PI = Yes
PKGNAME = py-${DISTNAME}
CATEGORIES = textproc devel
# LGPLv3
PERMIT_PACKAGE_CDROM = Yes
FLAVORS = python3
FLAVOR ?=
MODULES = lang/python
MODPY_SETUPTOOLS = Yes
TEST_DEPENDS += ${FULLPKGNAME}:${FULLPKGPATH}
do-test:
.if ${FLAVOR:Mpython3}
cd ${WRKSRC}/test && 2to3-${MODPY_VERSION} -w test_demjson.py
.endif
cd ${WRKSRC}/test && ${MODPY_BIN} -m unittest test_demjson
.if ${FLAVOR:Mpython3}
post-install:
mv ${PREFIX}/bin/jsonlint ${PREFIX}/bin/jsonlint${MODPY_BIN_SUFFIX}
.endif
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (demjson-2.2.4.tar.gz) = Md4gOKD92cTBH4vzsT/ne8KhKDB/llyNX7TcbW9r63k=
SIZE (demjson-2.2.4.tar.gz) = 131457

View File

@ -0,0 +1,34 @@
$OpenBSD: patch-setup_py,v 1.1.1.1 2016/09/02 14:12:20 edd Exp $
Use setup tools always for both Python 2 and 3.
(Using different tools would be asking for PLIST problems)
--- setup.py.orig Fri Sep 2 12:20:57 2016
+++ setup.py Fri Sep 2 12:21:18 2016
@@ -9,23 +9,8 @@ try:
except AttributeError:
py_major = sys.version_info[0]
-distmech = None
-if py_major >= 3:
- # Python 3, use setuptools first
- try:
- from setuptools import setup
- distmech = 'setuptools'
- except ImportError:
- from distutils.core import setup
- distmech = 'distutils'
-else:
- # Python 2, use distutils first
- try:
- from distutils.core import setup
- distmech = 'distutils'
- except ImportError:
- from setuptools import setup
- distmech = 'setuptools'
+from setuptools import setup
+distmech = 'setuptools'
if False:
sys.stdout.write("Using Python: %s\n" % sys.version.split(None,1)[0])

View File

@ -0,0 +1,10 @@
The demjson module, and the included jsonlint script, provide methods
for encoding and decoding JSON formatted data, as well as checking JSON
data for errors and/or portability issues. The jsonlint command/script
can be used from the command line without needing any programming.
Although the standard Python library now includes basic JSON support
(which it did not when demjson was first written), this module provides
a much more comprehensive implementation with many features not found
elsewhere. It is especially useful for error checking or for parsing
JavaScript data which may not strictly be valid JSON data.

View File

@ -0,0 +1,9 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2016/09/02 14:12:20 edd Exp $
bin/jsonlint${MODPY_BIN_SUFFIX}
lib/python${MODPY_VERSION}/site-packages/${MODPY_PYCACHE}demjson.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/demjson-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/
lib/python${MODPY_VERSION}/site-packages/demjson-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/PKG-INFO
lib/python${MODPY_VERSION}/site-packages/demjson-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/SOURCES.txt
lib/python${MODPY_VERSION}/site-packages/demjson-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/dependency_links.txt
lib/python${MODPY_VERSION}/site-packages/demjson-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/top_level.txt
lib/python${MODPY_VERSION}/site-packages/demjson.py