aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo-Chuan Hsieh <sunpoet@FreeBSD.org>2024-08-04 16:44:05 +0000
committerPo-Chuan Hsieh <sunpoet@FreeBSD.org>2024-08-04 17:13:52 +0000
commita9619e5670cdccaa8f9930b955a5e191cabb45a0 (patch)
tree88f76bbd687fb4ef561200b9646a615cb7e39076
parent1085cb600502071abd35ead7ac74439f30ad1b5d (diff)
devel/py-xasm: Add py-xasm 1.2.0
The Python xasm module has routines for assembly, and has a command to assemble bytecode for several different versions of Python. Here are some potential uses: - Make small changes to existing Python bytecode when you don't have source - Craft custom and efficient bytecode - Write an instruction-level optimizing compiler - Experiment with and learn about Python bytecode - Foil decompilers like uncompyle6 so that they can't disassemble bytecode (at least for now) This support the same kinds of bytecode that xdis supports. This is pretty much all released bytecode, although we tend to lag behind the latest Python releases.
-rw-r--r--devel/Makefile1
-rw-r--r--devel/py-xasm/Makefile25
-rw-r--r--devel/py-xasm/distinfo3
-rw-r--r--devel/py-xasm/files/patch-____pkginfo____.py17
-rw-r--r--devel/py-xasm/pkg-descr14
5 files changed, 60 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 531922000688..8d30ff65f664 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -6023,6 +6023,7 @@
SUBDIR += py-xarray
SUBDIR += py-xarray-einstats
SUBDIR += py-xarray-simlab
+ SUBDIR += py-xasm
SUBDIR += py-xattr
SUBDIR += py-xdg
SUBDIR += py-xdis
diff --git a/devel/py-xasm/Makefile b/devel/py-xasm/Makefile
new file mode 100644
index 000000000000..34b250404ac4
--- /dev/null
+++ b/devel/py-xasm/Makefile
@@ -0,0 +1,25 @@
+PORTNAME= xasm
+PORTVERSION= 1.2.0
+CATEGORIES= devel python
+MASTER_SITES= PYPI \
+ https://github.com/rocky/python-xasm/releases/download/${PORTVERSION}/
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= sunpoet@FreeBSD.org
+COMMENT= Python cross-version byte-code assembler
+WWW= https://github.com/rocky/python-xasm
+
+LICENSE= GPLv2
+LICENSE_FILE= ${WRKSRC}/LICENSE.gpl2
+
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}xdis>=6.0.3:devel/py-xdis@${PY_FLAVOR}
+TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}six>=1.10.0:devel/py-six@${PY_FLAVOR}
+
+USES= python
+USE_PYTHON= autoplist concurrent pep517
+
+NO_ARCH= yes
+
+.include <bsd.port.mk>
diff --git a/devel/py-xasm/distinfo b/devel/py-xasm/distinfo
new file mode 100644
index 000000000000..3635d0d8e558
--- /dev/null
+++ b/devel/py-xasm/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1722711125
+SHA256 (xasm-1.2.0.tar.gz) = 800ed4d0e2b582fa85c39362ea2958020b8fe48e96d13c2f0895c7f7b1f5f81f
+SIZE (xasm-1.2.0.tar.gz) = 39887
diff --git a/devel/py-xasm/files/patch-____pkginfo____.py b/devel/py-xasm/files/patch-____pkginfo____.py
new file mode 100644
index 000000000000..b4e7591c79d0
--- /dev/null
+++ b/devel/py-xasm/files/patch-____pkginfo____.py
@@ -0,0 +1,17 @@
+--- __pkginfo__.py.orig 2021-11-07 21:37:38 UTC
++++ __pkginfo__.py
+@@ -35,12 +35,12 @@ ftp_url = None
+ author = "Rocky Bernstein"
+ author_email = "rb@dustyfeet.com"
+ ftp_url = None
+-install_requires = [_six]
++install_requires = ["xdis >= 6.0.3"]
+ license = "GPL-2.0"
+ mailing_list = "python-debugger@googlegroups.com"
+ modname = "xasm"
+ py_modules = None
+-setup_requires = ["pytest-runner", "xdis >= 6.0.3, < 6.1.0"]
++setup_requires = []
+ # scripts = ['bin/pydisasm']
+ short_desc = "Python cross-version byte-code assembler"
+ tests_require = ["pytest", _six]
diff --git a/devel/py-xasm/pkg-descr b/devel/py-xasm/pkg-descr
new file mode 100644
index 000000000000..c6b9580c6385
--- /dev/null
+++ b/devel/py-xasm/pkg-descr
@@ -0,0 +1,14 @@
+The Python xasm module has routines for assembly, and has a command to assemble
+bytecode for several different versions of Python.
+
+Here are some potential uses:
+- Make small changes to existing Python bytecode when you don't have source
+- Craft custom and efficient bytecode
+- Write an instruction-level optimizing compiler
+- Experiment with and learn about Python bytecode
+- Foil decompilers like uncompyle6 so that they can't disassemble bytecode (at
+ least for now)
+
+This support the same kinds of bytecode that xdis supports. This is pretty much
+all released bytecode, although we tend to lag behind the latest Python
+releases.