From e03e64c721c5d57e4ebe130b04fb73635f7dbaa9 Mon Sep 17 00:00:00 2001 From: Steve Wills Date: Mon, 14 May 2018 18:43:01 +0000 Subject: [PATCH] devel/plasma: create port PLASMA is an interactive disassembler. It can generate a more readable assembly (pseudo code) with a colored syntax. One can write scripts with the available Python API. It supports : * Architectures : x86{64}, ARM, MIPS{64} (partially for ARM and MIPS) * Formats : ELF, PE, RAW WWW: https://www.github.com/plasma-disassembler/plasma PR: 225669 Submitted by: Kai --- devel/Makefile | 1 + devel/plasma/Makefile | 46 +++++++++++++++++++++++++++++++ devel/plasma/distinfo | 3 ++ devel/plasma/files/patch-setup.py | 45 ++++++++++++++++++++++++++++++ devel/plasma/pkg-descr | 10 +++++++ devel/plasma/pkg-message | 11 ++++++++ 6 files changed, 116 insertions(+) create mode 100644 devel/plasma/Makefile create mode 100644 devel/plasma/distinfo create mode 100644 devel/plasma/files/patch-setup.py create mode 100644 devel/plasma/pkg-descr create mode 100644 devel/plasma/pkg-message diff --git a/devel/Makefile b/devel/Makefile index ce3c04ab8f5f..0eff81b48f6d 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -4132,6 +4132,7 @@ SUBDIR += pkg-info.el SUBDIR += pkgconf SUBDIR += plan9port + SUBDIR += plasma SUBDIR += plasma5-khotkeys SUBDIR += plasma5-kwrited SUBDIR += plasma5-plasma-sdk diff --git a/devel/plasma/Makefile b/devel/plasma/Makefile new file mode 100644 index 000000000000..6b3234b0dff8 --- /dev/null +++ b/devel/plasma/Makefile @@ -0,0 +1,46 @@ +# $FreeBSD$ + +PORTNAME= plasma +DISTVERSION= g20171121 +CATEGORIES= devel python + +MAINTAINER= freebsd_ports@k-worx.org +COMMENT= Interactive disassembler for x86/ARM/MIPS + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= bash:shells/bash \ + binutils>=2:devel/binutils \ + capstone>=3:devel/capstone3 +RUN_DEPENDS= binutils>=2:devel/binutils \ + ${PYTHON_PKGNAMEPREFIX}capstone>=3:devel/py-capstone@${FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}future>=0:devel/py-future@${FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}keystone-engine>=:devel/py-keystone-engine@${FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}msgpack>=0:devel/py-msgpack@${FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}nose>=0:devel/py-nose@${FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pefile>=0:devel/py-pefile@${FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pyelftools>=0:devel/py-pyelftools@${FLAVOR} + +USES= python:3.4+ shebangfix + +USE_GITHUB= yes +GH_ACCOUNT= plasma-disassembler +GH_PROJECT= plasma +GH_TAGNAME= 8ec3bb7 + +USE_PYTHON= distutils flavors autoplist +SHEBANG_FILES= tests/analyzer/run.sh +SHEBANG_GLOB= *.py + +OPTIONS_DEFINE= MEMMAP +OPTIONS_DEFAULT= MEMMAP +MEMMAP_DESC= View memory maps (pulls in QT4) +MEMMAP_USES= pyqt:4 +MEMMAP_USE= PYQT=gui_run + +post-patch: + @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/setup.py + @${REINPLACE_CMD} -e 's|python3|${PYTHON_CMD}|g' ${WRKSRC}/Makefile + +.include diff --git a/devel/plasma/distinfo b/devel/plasma/distinfo new file mode 100644 index 000000000000..83981530990d --- /dev/null +++ b/devel/plasma/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1517675748 +SHA256 (plasma-disassembler-plasma-g20171121-8ec3bb7_GH0.tar.gz) = 5ae00ef3fa3326000968323bd6843fa293938a1024b2fcb6176b624c99e8c050 +SIZE (plasma-disassembler-plasma-g20171121-8ec3bb7_GH0.tar.gz) = 352158 diff --git a/devel/plasma/files/patch-setup.py b/devel/plasma/files/patch-setup.py new file mode 100644 index 000000000000..0c59c85a3327 --- /dev/null +++ b/devel/plasma/files/patch-setup.py @@ -0,0 +1,45 @@ +--- setup.py.orig 2018-04-15 11:48:52 UTC ++++ setup.py +@@ -6,30 +6,33 @@ except ImportError: + from distutils.core import setup + + +-from pip.req import parse_requirements ++#from pip.req import parse_requirements + from distutils.core import Extension + import plasma + +-requirements = parse_requirements('requirements.txt', session=False) ++#requirements = parse_requirements('requirements.txt', session=False) + + requires = [] +-for item in requirements: ++#for item in requirements: + # we want to handle package names and also repo urls +- if getattr(item, 'url', None): # older pip has url +- links.append(str(item.url)) +- if getattr(item, 'link', None): # newer pip has link +- links.append(str(item.link)) +- if item.req: +- requires.append(str(item.req)) ++# if getattr(item, 'url', None): # older pip has url ++# links.append(str(item.url)) ++# if getattr(item, 'link', None): # newer pip has link ++# links.append(str(item.link)) ++# if item.req: ++# requires.append(str(item.req)) + + + x86_analyzer = Extension('plasma.lib.arch.x86.analyzer', ++ include_dirs = ['%%PREFIX%%/include'], + sources = ['plasma/lib/arch/x86/analyzer.c']) + + mips_analyzer = Extension('plasma.lib.arch.mips.analyzer', ++ include_dirs = ['%%PREFIX%%/include'], + sources = ['plasma/lib/arch/mips/analyzer.c']) + + arm_analyzer = Extension('plasma.lib.arch.arm.analyzer', ++ include_dirs = ['%%PREFIX%%/include'], + sources = ['plasma/lib/arch/arm/analyzer.c']) + + diff --git a/devel/plasma/pkg-descr b/devel/plasma/pkg-descr new file mode 100644 index 000000000000..b5238a65ade8 --- /dev/null +++ b/devel/plasma/pkg-descr @@ -0,0 +1,10 @@ +PLASMA is an interactive disassembler. It can generate a more readable assembly + (pseudo code) with a colored syntax. One can write scripts with the available + Python API. + +It supports : + +* Architectures : x86{64}, ARM, MIPS{64} (partially for ARM and MIPS) +* Formats : ELF, PE, RAW + +WWW: https://www.github.com/plasma-disassembler/plasma diff --git a/devel/plasma/pkg-message b/devel/plasma/pkg-message new file mode 100644 index 000000000000..7a228357c758 --- /dev/null +++ b/devel/plasma/pkg-message @@ -0,0 +1,11 @@ + +============================================================================== + +To use the visual mode (command 'v' in the interactive mode) the terminal must +support 256 colors. + +For xterm this can be enabled by + +export TERM=xterm-256color + +==============================================================================