1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-29 05:38:00 +00:00

devel/py-python-dtrace: Update to 0.0.11

I have committed changes upstream to allow building against Python3 as well
as patches to build on FreeBSD, so the current patches are no longer needed.

Reviewed by:	swills
Differential Revision:	https://reviews.freebsd.org/D28020
This commit is contained in:
Alex Richardson 2021-01-10 16:10:45 +00:00
parent 0bb581cd3c
commit 539efbdf26
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=561084
5 changed files with 18 additions and 103 deletions

View File

@ -1,7 +1,7 @@
# $FreeBSD$
PORTNAME= python-dtrace
PORTVERSION= 0.0.9
PORTVERSION= 0.0.11
CATEGORIES= devel python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -12,11 +12,22 @@ COMMENT= DTrace consumer for Python based on libdtrace
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= python:3.6+ zip
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR}
USES= python:3.6+
USE_PYTHON= autoplist distutils cython cython_run
.if !exists(${SRC_BASE}/sys/cddl/contrib/opensolaris/uts/common/dtrace.h)
IGNORE= you must have "device dtrace" included in your kernel to build this package
# TODO: Adjust this check once python-dtrace handles installed dtrace headers
# (https://reviews.freebsd.org/D27884).
MAKE_ENV+= FREEBSD_SRC_DIR=${SRC_BASE}
.if !exists(${SRC_BASE}/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h)
IGNORE= requires kernel source files in SRC_BASE=${SRC_BASE}
.endif
# Tests not included in the release tarball, uncomment if this changes.
# TEST_DEPENDS=→${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR}
#do-test:
# @cd ${WRKSRC} && ${PYTHON_CMD} -m pytest -rs -v
.include <bsd.port.mk>

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1476182943
SHA256 (python-dtrace-0.0.9.zip) = 9daa24fe3b5d16c17c4afed00d3b2b2f869598efc5a8100b8570342713328912
SIZE (python-dtrace-0.0.9.zip) = 21764
TIMESTAMP = 1610032322
SHA256 (python-dtrace-0.0.11.tar.gz) = b343728e61cb697ab76eb8091a361d7de6735527c788fc85b979db8356640fbc
SIZE (python-dtrace-0.0.11.tar.gz) = 15143

View File

@ -1,35 +0,0 @@
--- dtrace_cython/consumer.pyx.orig 2015-01-24 23:40:08 UTC
+++ dtrace_cython/consumer.pyx
@@ -2,7 +2,7 @@
import time
import threading
from threading import Thread
-from dtrace_consumer.dtrace_h cimport *
+from dtrace_cython.dtrace_h cimport *
# ----------------------------------------------------------------------------
# The DTrace callbacks
@@ -333,6 +333,11 @@ cdef class DTraceConsumer:
dtrace_errmsg(self.handle,
dtrace_errno(self.handle)))
+ def setopt(self, key, value):
+ if dtrace_setopt(self.handle, key, value) != 0:
+ raise Exception(dtrace_errmsg(self.handle,
+ dtrace_errno(self.handle)))
+
cdef class DTraceContinuousConsumer:
"""
@@ -434,6 +439,11 @@ cdef class DTraceContinuousConsumer:
return status
+ def setopt(self, key, value):
+ if dtrace_setopt(self.handle, key, value) != 0:
+ raise Exception(dtrace_errmsg(self.handle,
+ dtrace_errno(self.handle)))
+
class DTraceConsumerThread(Thread):
"""

View File

@ -1,43 +0,0 @@
--- dtrace_cython/dtrace_h.pxd.orig 2015-01-24 23:30:44 UTC
+++ dtrace_cython/dtrace_h.pxd
@@ -7,7 +7,7 @@ cdef extern from "libelf_workaround.h":
pass
-IF UNAME_SYSNAME == "Darwin":
+IF UNAME_SYSNAME == "Darwin" or UNAME_SYSNAME == "FreeBSD":
cdef extern from "stdint.h":
# needed for quantize mths.
cdef int64_t INT64_MAX
@@ -18,7 +18,6 @@ ELSE:
cdef int64_t INT64_MAX
cdef int64_t INT64_MIN
-
cdef extern from "sys/dtrace.h":
ctypedef enum agg_actions:
@@ -34,10 +33,12 @@ cdef extern from "sys/dtrace.h":
DTRACEAGG_QUANTIZE = (DTRACEACT_AGGREGATION + 7)
DTRACEAGG_LQUANTIZE = (DTRACEACT_AGGREGATION + 8)
- ctypedef enum quantize_types:
+ cdef int DTRACE_QUANTIZE_NBUCKETS
+ cdef int DTRACE_QUANTIZE_ZEROBUCKET
+ #ctypedef enum quantize_types:
# NBBY = 8
- DTRACE_QUANTIZE_NBUCKETS = (((sizeof (uint64_t) * 8) - 1) * 2 + 1)
- DTRACE_QUANTIZE_ZEROBUCKET = ((sizeof (uint64_t) * 8) - 1)
+ # DTRACE_QUANTIZE_NBUCKETS = (((sizeof (uint64_t) * 8) - 1) * 2 + 1)
+ # DTRACE_QUANTIZE_ZEROBUCKET = ((sizeof (uint64_t) * 8) - 1)
ctypedef struct dtrace_recdesc_t:
# Taken from sys/dtrace.h:931
@@ -56,7 +57,6 @@ cdef extern from "sys/dtrace.h":
cdef int32_t DTRACE_LQUANTIZE_BASE(long x)
cdef int64_t DTRACE_QUANTIZE_BUCKETVAL(long buck)
-
cdef extern from "dtrace.h":
ctypedef enum dtrace_probespec_t:

View File

@ -1,18 +0,0 @@
--- setup.py.orig 2015-01-26 14:26:50 UTC
+++ setup.py
@@ -14,9 +14,12 @@ try:
from Cython.Distutils import build_ext
BUILD_EXTENSION = {'build_ext': build_ext}
- EXT_MODULES = [Extension("dtrace", ["dtrace_cython/dtrace_h.pxd",
- "dtrace_cython/consumer.pyx"],
- libraries=["dtrace"])]
+ EXT_MODULES = [Extension("dtrace",
+ ["dtrace_cython/dtrace_h.pxd", "dtrace_cython/consumer.pyx"],
+ libraries=["dtrace","proc","ctf","elf","z","rtld_db","pthread","util"],
+ include_dirs=['/sys/cddl/compat/opensolaris',
+ '/sys/cddl/contrib/opensolaris/uts/common',
+ '/usr/src/cddl/contrib/opensolaris/lib/libdtrace/common'])]
except ImportError:
BUILD_EXTENSION = {}