From owner-svn-ports-all@freebsd.org Thu Nov 7 20:29:44 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 045C21BFD50; Thu, 7 Nov 2019 20:29:44 +0000 (UTC) (envelope-from dvl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478FPg6Nhhz4HSg; Thu, 7 Nov 2019 20:29:43 +0000 (UTC) (envelope-from dvl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B96FA1B4E9; Thu, 7 Nov 2019 20:29:43 +0000 (UTC) (envelope-from dvl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7KTh2H060469; Thu, 7 Nov 2019 20:29:43 GMT (envelope-from dvl@FreeBSD.org) Received: (from dvl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7KTg1h060465; Thu, 7 Nov 2019 20:29:42 GMT (envelope-from dvl@FreeBSD.org) Message-Id: <201911072029.xA7KTg1h060465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dvl set sender to dvl@FreeBSD.org using -f From: Dan Langille Date: Thu, 7 Nov 2019 20:29:42 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r517010 - in head/devel: . py-pyjq py-pyjq/files X-SVN-Group: ports-head X-SVN-Commit-Author: dvl X-SVN-Commit-Paths: in head/devel: . py-pyjq py-pyjq/files X-SVN-Commit-Revision: 517010 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 20:29:44 -0000 Author: dvl Date: Thu Nov 7 20:29:42 2019 New Revision: 517010 URL: https://svnweb.freebsd.org/changeset/ports/517010 Log: Add pyjq: Binding for jq JSON Processor My thanks to swills# for his help in this. Submitted by: Gilbert Morgan Differential Revision: https://reviews.freebsd.org/D22278 Added: head/devel/py-pyjq/ head/devel/py-pyjq/Makefile (contents, props changed) head/devel/py-pyjq/distinfo (contents, props changed) head/devel/py-pyjq/files/ head/devel/py-pyjq/files/patch-setup.py (contents, props changed) head/devel/py-pyjq/pkg-descr (contents, props changed) Modified: head/devel/Makefile Modified: head/devel/Makefile ============================================================================== --- head/devel/Makefile Thu Nov 7 20:25:08 2019 (r517009) +++ head/devel/Makefile Thu Nov 7 20:29:42 2019 (r517010) @@ -4866,6 +4866,7 @@ SUBDIR += py-pyinotify SUBDIR += py-pyinstaller SUBDIR += py-pyjsparser + SUBDIR += py-pyjq SUBDIR += py-pyke SUBDIR += py-pylama SUBDIR += py-pylibsrtp Added: head/devel/py-pyjq/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/py-pyjq/Makefile Thu Nov 7 20:29:42 2019 (r517010) @@ -0,0 +1,27 @@ +# $FreeBSD$ + +PORTNAME= pyjq +PORTVERSION= 2.4.0 +CATEGORIES= devel python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= gmm@tutanota.com +COMMENT= Python binding for jq + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +LIB_DEPENDS= libjq.so:textproc/jq \ + libonig.so:devel/oniguruma + +USES= localbase python +USE_PYTHON= autoplist distutils + +post-patch: + @${RM} -r ${WRKSRC}/dependencies + +post-install: + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/python3.6/site-packages/_pyjq.so + +.include Added: head/devel/py-pyjq/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/py-pyjq/distinfo Thu Nov 7 20:29:42 2019 (r517010) @@ -0,0 +1,3 @@ +TIMESTAMP = 1573147120 +SHA256 (pyjq-2.4.0.tar.gz) = 651f7a3ab2087e7c69cf00f1ba5433d7afe7b72f4ff499dcaf9c86cb1c2ae3c1 +SIZE (pyjq-2.4.0.tar.gz) = 2033014 Added: head/devel/py-pyjq/files/patch-setup.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/py-pyjq/files/patch-setup.py Thu Nov 7 20:29:42 2019 (r517010) @@ -0,0 +1,89 @@ +--- setup.py.orig 2019-09-18 06:52:51 UTC ++++ setup.py +@@ -12,86 +12,20 @@ from setuptools import setup + from setuptools.extension import Extension + from setuptools.command.build_ext import _build_ext + +- +-dependencies_dir_path = join(abspath(dirname(__file__)), "dependencies") +- +-onig_tarball_path = join(dependencies_dir_path, "onig-6.9.0.tar.gz") +-onig_install_path = join(dependencies_dir_path, "onig_install") +-onig_source_path = join(dependencies_dir_path, "onig-6.9.0") +- +-jq_tarball_path = join(dependencies_dir_path, "jq-1.5.tar.gz") +-jq_install_path = join(dependencies_dir_path, "jq_install") +-jq_source_path = join(dependencies_dir_path, "jq-jq-1.5") +- +- + class build_ext(_build_ext): + def run(self): +- self._build_oniguruma() +- self._build_libjq() + _build_ext.run(self) + +- def _build_oniguruma(self): +- self._safe_rmtree(onig_install_path) +- self._safe_rmtree(onig_source_path) +- +- self._extract_tarball(onig_tarball_path, dependencies_dir_path) +- self._build_lib( +- lib_dir=onig_source_path, +- commands=[ +- ["./configure", "CFLAGS=-fPIC", "--disable-shared", "--prefix", onig_install_path], +- ["make"], +- ["make", "install"], +- ] +- ) +- +- def _build_libjq(self): +- self._safe_rmtree(jq_install_path) +- self._safe_rmtree(jq_source_path) +- +- self._extract_tarball(jq_tarball_path, dependencies_dir_path) +- self._build_lib( +- lib_dir=jq_source_path, +- commands=[ +- ["autoreconf", "-i"], +- ["./configure", "CFLAGS=-fPIC", "--disable-maintainer-mode", +- "--enable-all-static", "--disable-shared", +- "--with-oniguruma=" + onig_install_path, "--prefix", jq_install_path], +- ["make", "install-libLTLIBRARIES", "install-includeHEADERS"], +- ] +- ) +- +- def _build_lib(self, lib_dir, commands): +- macosx_deployment_target = sysconfig.get_config_var("MACOSX_DEPLOYMENT_TARGET") +- if macosx_deployment_target: +- os.environ['MACOSX_DEPLOYMENT_TARGET'] = macosx_deployment_target +- +- for command in commands: +- subprocess.check_call(command, cwd=lib_dir) +- +- def _extract_tarball(self, tarball_path, workdir_path): +- tarfile.open(tarball_path, "r:gz").extractall(workdir_path) +- +- def _safe_rmtree(self, d): +- try: +- shutil.rmtree(d) +- except OSError: +- pass +- + libraries = ["jq", "onig"] +-if platform.architecture()[1] == 'WindowsPE': +- libraries.append("shlwapi") + + pyjq = Extension( + "_pyjq", + sources=["_pyjq.c"], +- include_dirs=["dependencies/jq_install/include"], + libraries=libraries, +- library_dirs=["dependencies/jq_install/lib", "dependencies/onig_install/lib"] + ) + + setup( + test_suite='test_pyjq', + ext_modules=[pyjq], + cmdclass={"build_ext": build_ext}, +- package_data={'': [onig_tarball_path, jq_tarball_path]}, + ) Added: head/devel/py-pyjq/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/py-pyjq/pkg-descr Thu Nov 7 20:29:42 2019 (r517010) @@ -0,0 +1,15 @@ +pyjq is a Python bindings for jq (http://stedolan.github.io/jq/). + + jq is like sed for JSON data - you can use it to slice and filter and map + and transform structured data with the same ease that sed, awk, grep and + friends let you play with text. + + http://stedolan.github.io/jq/ + +You can seamlessly call jq script (like regular expression) and process a plain +python data structure. + +For your information, https://pypi.python.org/pypi/jq is a also jq bindings but +different and incompatible with pyjq. + +WWW: https://github.com/doloopwhile/pyjq