Saturday, June 01, 2019

py-unicorn: enable Python 3 flavor

The reason unicorn is Python 2 only is QEMU's configure script depending
on Python >=2.4,<3.

But that's it; you can still build the rest with latest Python and use
it as some software does I'm currently trying to get running.

Thoughts?

Index: devel/Makefile
===================================================================
RCS file: /cvs/ports/devel/Makefile,v
retrieving revision 1.1860
diff -u -p -r1.1860 Makefile
--- devel/Makefile 23 May 2019 17:50:11 -0000 1.1860
+++ devel/Makefile 1 Jun 2019 11:26:25 -0000
@@ -1664,6 +1664,7 @@
SUBDIR += py-uncompyle6
SUBDIR += py-uncompyle6,python3
SUBDIR += py-unicorn
+ SUBDIR += py-unicorn,python3
SUBDIR += py-unit
SUBDIR += py-unit,no_x11
SUBDIR += py-unittest2
Index: devel/py-unicorn//Makefile
===================================================================
RCS file: /cvs/ports/devel/py-unicorn/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- devel/py-unicorn//Makefile 2 Apr 2019 13:09:12 -0000 1.3
+++ devel/py-unicorn//Makefile 1 Jun 2019 11:30:14 -0000
@@ -23,9 +23,11 @@ MODULES = lang/python
MODPY_PI = Yes
MODPY_SETUPTOOLS = Yes

-# XXX: ERROR: Cannot use '/usr/local/bin/python3.6', Python 2.4 or later is required.
-#FLAVORS = python3
-#FLAVOR ?=
+FLAVORS = python3
+FLAVOR ?=
+
+# see patches/patch-src_Makefile
+BUILD_DEPENDS = lang/python/${MODPY_DEFAULT_VERSION_2}

USE_GMAKE = Yes

Index: devel/py-unicorn//patches/patch-src_Makefile
===================================================================
RCS file: /cvs/ports/devel/py-unicorn/patches/patch-src_Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-src_Makefile
--- devel/py-unicorn//patches/patch-src_Makefile 1 Apr 2019 02:24:07 -0000 1.1.1.1
+++ devel/py-unicorn//patches/patch-src_Makefile 30 May 2019 21:50:56 -0000
@@ -1,5 +1,7 @@
$OpenBSD: patch-src_Makefile,v 1.1.1.1 2019/04/01 02:24:07 jasper Exp $

+ERROR: Cannot use '/usr/local/bin/python3.6', Python 2.4 or later is required.
+
Index: src/Makefile
--- src/Makefile.orig
+++ src/Makefile
@@ -8,7 +10,7 @@ Index: src/Makefile
qemu/config-host.h-timestamp:
cd qemu && \
- ./configure --cc="${CC}" --extra-cflags="$(UNICORN_CFLAGS)" --target-list="$(UNICORN_TARGETS)" ${UNICORN_QEMU_FLAGS}
-+ ./configure --cc="${CC}" --extra-cflags="$(UNICORN_CFLAGS)" --target-list="$(UNICORN_TARGETS)" ${UNICORN_QEMU_FLAGS} --python=${MODPY_BIN}
++ ./configure --cc="${CC}" --extra-cflags="$(UNICORN_CFLAGS)" --target-list="$(UNICORN_TARGETS)" ${UNICORN_QEMU_FLAGS} --python=${LOCALBASE}/bin/python2
printf "$(UNICORN_ARCHS)" > config.log
$(MAKE) -C qemu $(SMP_MFLAGS)
$(eval UC_TARGET_OBJ += $$(wildcard qemu/util/*.o) $$(wildcard qemu/*.o) $$(wildcard qemu/qom/*.o) $$(wildcard qemu/hw/core/*.o) $$(wildcard qemu/qapi/*.o) $$(wildcard qemu/qobject/*.o))
Index: devel/py-unicorn//pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/py-unicorn/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- devel/py-unicorn//pkg/PLIST 2 Apr 2019 13:09:12 -0000 1.2
+++ devel/py-unicorn//pkg/PLIST 30 May 2019 21:55:52 -0000
@@ -7,11 +7,18 @@ lib/python${MODPY_VERSION}/site-packages
lib/python${MODPY_VERSION}/site-packages/unicorn-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/top_level.txt
lib/python${MODPY_VERSION}/site-packages/unicorn-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/zip-safe
lib/python${MODPY_VERSION}/site-packages/unicorn/__init__.py
+${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}/
lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
-lib/python${MODPY_VERSION}/site-packages/unicorn/arm64_const.py
lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}arm64_const.${MODPY_PYC_MAGIC_TAG}pyc
-lib/python${MODPY_VERSION}/site-packages/unicorn/arm_const.py
lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}arm_const.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}m68k_const.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}mips_const.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}sparc_const.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}unicorn.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}unicorn_const.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}x86_const.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/unicorn/arm64_const.py
+lib/python${MODPY_VERSION}/site-packages/unicorn/arm_const.py
lib/python${MODPY_VERSION}/site-packages/unicorn/include/
lib/python${MODPY_VERSION}/site-packages/unicorn/include/unicorn/
lib/python${MODPY_VERSION}/site-packages/unicorn/include/unicorn/arm.h
@@ -25,14 +32,8 @@ lib/python${MODPY_VERSION}/site-packages
lib/python${MODPY_VERSION}/site-packages/unicorn/lib/libunicorn.a
lib/python${MODPY_VERSION}/site-packages/unicorn/lib/libunicorn.so
lib/python${MODPY_VERSION}/site-packages/unicorn/m68k_const.py
-lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}m68k_const.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/unicorn/mips_const.py
-lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}mips_const.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/unicorn/sparc_const.py
-lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}sparc_const.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/unicorn/unicorn.py
-lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}unicorn.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/unicorn/unicorn_const.py
-lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}unicorn_const.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/unicorn/x86_const.py
-lib/python${MODPY_VERSION}/site-packages/unicorn/${MODPY_PYCACHE}x86_const.${MODPY_PYC_MAGIC_TAG}pyc

No comments:

Post a Comment