Skip to content

Commit

Permalink
textproc/py-jq: NEW: lightweight and flexible JSON processor
Browse files Browse the repository at this point in the history
  • Loading branch information
mandree committed May 22, 2021
1 parent ca87f3d commit ef0c7dd
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
25 changes: 25 additions & 0 deletions textproc/py-jq/Makefile
@@ -0,0 +1,25 @@
PORTNAME= jq
PORTVERSION= 1.1.3
CATEGORIES= textproc python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}

MAINTAINER= mandree@FreeBSD.org
COMMENT= jq.py: a lightweight and flexible JSON processor

LICENSE= BSD2CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE

LIB_DEPENDS= libjq.so:textproc/jq \
libonig.so:devel/oniguruma

RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR}
BUILD_DEPENDS= ${RUN_DEPENDS}

USES= localbase python:3.4+
USE_PYTHON= autoplist distutils

post-install:
${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/jq.*.so

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions textproc/py-jq/distinfo
@@ -0,0 +1,3 @@
TIMESTAMP = 1621674990
SHA256 (jq-1.1.3.tar.gz) = f9ec1dfa7f9875b04495f3e08e85ee96f37a3b843e5bca738a3300732865dde7
SIZE (jq-1.1.3.tar.gz) = 71393
24 changes: 24 additions & 0 deletions textproc/py-jq/files/patch-setup.py
@@ -0,0 +1,24 @@
--- setup.py.orig 2021-05-03 13:00:29 UTC
+++ setup.py
@@ -43,8 +43,6 @@ class jq_build_ext(build_ext):
def run(self):
if not os.path.exists(dependency_path(".")):
os.makedirs(dependency_path("."))
- self._build_oniguruma()
- self._build_libjq()
build_ext.run(self)

def _build_oniguruma(self):
@@ -103,11 +101,7 @@ jq_extension = Extension(
"jq",
sources=["jq.c"],
include_dirs=[os.path.join(jq_lib_dir, "src")],
- extra_link_args=["-lm"],
- extra_objects=[
- os.path.join(jq_lib_dir, ".libs/libjq.a"),
- os.path.join(oniguruma_lib_install_dir, "lib/libonig.a"),
- ],
+ extra_link_args=["-lm", "-ljq", "-lonig"],
)

setup(
5 changes: 5 additions & 0 deletions textproc/py-jq/pkg-descr
@@ -0,0 +1,5 @@
jq.py: a lightweight and flexible JSON processor

py-jq contains Python bindings for jq.

WWW: https://github.com/mwilliamson/jq.py

0 comments on commit ef0c7dd

Please sign in to comment.