diff options
author | Antoine Brodin <antoine@FreeBSD.org> | 2016-12-16 06:43:52 +0000 |
---|---|---|
committer | Antoine Brodin <antoine@FreeBSD.org> | 2016-12-16 06:43:52 +0000 |
commit | 75c2527913dc3efcfbd29ed2323564f1059be754 (patch) | |
tree | 17ca3d88fc78035b599f44c923589b653ca08c0f | |
parent | 4427c5e61a66639164b9c377f664c2a4d3352885 (diff) | |
download | ports-75c2527913dc3efcfbd29ed2323564f1059be754.tar.gz ports-75c2527913dc3efcfbd29ed2323564f1059be754.zip |
Notes
-rw-r--r-- | emulators/Makefile | 1 | ||||
-rw-r--r-- | emulators/unicorn/Makefile | 28 | ||||
-rw-r--r-- | emulators/unicorn/distinfo | 3 | ||||
-rw-r--r-- | emulators/unicorn/files/patch-Makefile | 61 | ||||
-rw-r--r-- | emulators/unicorn/files/patch-qemu_configure | 18 | ||||
-rw-r--r-- | emulators/unicorn/files/patch-tests_unit_Makefile | 22 | ||||
-rw-r--r-- | emulators/unicorn/pkg-descr | 17 | ||||
-rw-r--r-- | emulators/unicorn/pkg-plist | 12 |
8 files changed, 162 insertions, 0 deletions
diff --git a/emulators/Makefile b/emulators/Makefile index 62264ec0813c..c7f7515d909a 100644 --- a/emulators/Makefile +++ b/emulators/Makefile @@ -147,6 +147,7 @@ SUBDIR += tuxnes SUBDIR += uae SUBDIR += ucon64 + SUBDIR += unicorn SUBDIR += vba SUBDIR += vboxtool SUBDIR += vgb-bin diff --git a/emulators/unicorn/Makefile b/emulators/unicorn/Makefile new file mode 100644 index 000000000000..8ceea79bf5c8 --- /dev/null +++ b/emulators/unicorn/Makefile @@ -0,0 +1,28 @@ +# $FreeBSD$ + +PORTNAME= unicorn +PORTVERSION= 0.9 +CATEGORIES= emulators + +MAINTAINER= antoine@FreeBSD.org +COMMENT= Unicorn CPU emulator framework + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/COPYING + +TEST_DEPENDS= cmocka>0:sysutils/cmocka + +USE_GITHUB= yes +GH_ACCOUNT= unicorn-engine + +USES= gmake pkgconfig python:2.7,build +USE_GNOME= glib20 +USE_LDCONFIG= yes +MAKE_ENV= INSTALL_LIB="${INSTALL_LIB}" \ + UNICORN_QEMU_FLAGS=--python=${PYTHON_CMD} \ + V=1 +TEST_TARGET= test +TEST_WRKSRC= ${WRKSRC}/tests/unit +BROKEN_FreeBSD_9_i386= fails to link + +.include <bsd.port.mk> diff --git a/emulators/unicorn/distinfo b/emulators/unicorn/distinfo new file mode 100644 index 000000000000..77d344f5d9b6 --- /dev/null +++ b/emulators/unicorn/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1481841704 +SHA256 (unicorn-engine-unicorn-0.9_GH0.tar.gz) = 1ca03b1c8f6360335567b528210713461e839d47c4eb7c676ba3aa4f72b8cf10 +SIZE (unicorn-engine-unicorn-0.9_GH0.tar.gz) = 2576109 diff --git a/emulators/unicorn/files/patch-Makefile b/emulators/unicorn/files/patch-Makefile new file mode 100644 index 000000000000..2ac7df696b77 --- /dev/null +++ b/emulators/unicorn/files/patch-Makefile @@ -0,0 +1,61 @@ +--- Makefile.orig 2015-10-15 16:22:04 UTC ++++ Makefile +@@ -59,9 +59,9 @@ UNICORN_CFLAGS += -fPIC + V ?= 0 + + ifeq ($(UNICORN_DEBUG),yes) +-CFLAGS += -O3 ++#CFLAGS += -O3 + else +-CFLAGS += -g ++#CFLAGS += -g + endif + + ifeq ($(CROSS),) +@@ -158,7 +158,7 @@ LIBDIRARCH ?= lib + # Or better, pass 'LIBDIRARCH=lib64' to 'make install/uninstall' via 'make.sh'. + #LIBDIRARCH ?= lib64 + +-LIBDIR ?= $(DESTDIR)$(PREFIX)/$(LIBDIRARCH) ++LIBDIR = $(DESTDIR)$(PREFIX)/$(LIBDIRARCH) + INCDIR ?= $(DESTDIR)$(PREFIX)/include + + LIBDATADIR ?= $(LIBDIR) +@@ -181,7 +181,7 @@ else + PKGCFGDIR ?= $(LIBDATADIR)/pkgconfig + endif + +-all: compile_lib ++all: compile_lib $(PKGCFGF) + ifeq (,$(findstring yes,$(UNICORN_BUILD_CORE_ONLY))) + ifeq ($(UNICORN_SHARED),yes) + ifeq ($(V),0) +@@ -213,9 +213,8 @@ else + endif + + compile_lib: config qemu/config-host.h-timestamp +- rm -rf lib$(LIBNAME)* $(LIBNAME)*.lib $(LIBNAME)*.dll && cd qemu && $(MAKE) -j 8 ++ cd qemu && $(MAKE) + $(MAKE) unicorn +- cd samples && $(MAKE) clean + + unicorn: $(LIBRARY) $(ARCHIVE) + +@@ -225,7 +224,7 @@ ifeq ($(V),0) + $(call log,GEN,$(LIBRARY)) + @$(CC) $(CFLAGS) -shared $^ -o $(LIBRARY) $(GLIB) -lm + else +- $(CC) $(CFLAGS) -shared $^ -o $(LIBRARY) $(GLIB) -lm ++ $(CC) $(CFLAGS) -shared -Wl,-soname,libunicorn.so $^ -o $(LIBRARY) $(GLIB) -lm + endif + endif + +@@ -254,7 +253,7 @@ test: all + $(MAKE) -C tests/unit test + + +-install: all $(PKGCFGF) ++install: all + mkdir -p $(LIBDIR) + ifeq ($(UNICORN_SHARED),yes) + $(INSTALL_LIB) $(LIBRARY) $(LIBDIR) diff --git a/emulators/unicorn/files/patch-qemu_configure b/emulators/unicorn/files/patch-qemu_configure new file mode 100644 index 000000000000..91f0ee783c3a --- /dev/null +++ b/emulators/unicorn/files/patch-qemu_configure @@ -0,0 +1,18 @@ +--- qemu/configure.orig 2015-10-15 16:22:04 UTC ++++ qemu/configure +@@ -285,11 +285,11 @@ QEMU_CFLAGS="-Wstrict-prototypes -Wredun + QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" + QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include" + if test "$debug_info" = "yes"; then +- CFLAGS="-g $CFLAGS" +- LDFLAGS="-g $LDFLAGS" ++# CFLAGS="-g $CFLAGS" ++# LDFLAGS="-g $LDFLAGS" + else +- CFLAGS="-O3 $CFLAGS" +- LDFLAGS="-O3 $LDFLAGS" ++# CFLAGS="-O3 $CFLAGS" ++# LDFLAGS="-O3 $LDFLAGS" + fi + + # make source path absolute diff --git a/emulators/unicorn/files/patch-tests_unit_Makefile b/emulators/unicorn/files/patch-tests_unit_Makefile new file mode 100644 index 000000000000..7eea075b0f63 --- /dev/null +++ b/emulators/unicorn/files/patch-tests_unit_Makefile @@ -0,0 +1,22 @@ +--- tests/unit/Makefile.orig 2015-10-15 16:22:04 UTC ++++ tests/unit/Makefile +@@ -1,8 +1,8 @@ + + CFLAGS += -Wall -Werror -Wno-unused-function -g +-CFLAGS += -L ../../ ++CFLAGS += -L ../../ -L $(PREFIX)/lib + CFLAGS += -lcmocka -lunicorn +-CFLAGS += -I ../../include ++CFLAGS += -I ../../include -I $(PREFIX)/include + + ALL_TESTS = test_sanity test_x86 test_mem_map + +@@ -25,7 +25,7 @@ test_x86: test_x86.c + test_mem_map: test_mem_map.c + + ${ALL_TESTS}: +- gcc ${CFLAGS} -o $@ $^ ++ $(CC) ${CFLAGS} -o $@ $^ + + + diff --git a/emulators/unicorn/pkg-descr b/emulators/unicorn/pkg-descr new file mode 100644 index 000000000000..0354c95f24c0 --- /dev/null +++ b/emulators/unicorn/pkg-descr @@ -0,0 +1,17 @@ +Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator +framework based on QEMU. + +Unicorn offers some unparalleled features: +- Multi-architecture: ARM, ARM64 (ARMv8), M68K, MIPS, SPARC, and X86 (16, 32, + 64-bit) +- Clean/simple/lightweight/intuitive architecture-neutral API +- Implemented in pure C language, with bindings for Perl, Rust, Ruby, Python, + Java, MSVC, .NET, Go, Delphi/Free Pascal and Haskell. +- Native support for Windows & *nix (with Mac OSX, Linux, *BSD & Solaris + confirmed) +- High performance via Just-In-Time compilation +- Support for fine-grained instrumentation at various levels +- Thread-safety by design +- Distributed under free software license GPLv2 + +WWW: http://www.unicorn-engine.org/ diff --git a/emulators/unicorn/pkg-plist b/emulators/unicorn/pkg-plist new file mode 100644 index 000000000000..b399f79d7556 --- /dev/null +++ b/emulators/unicorn/pkg-plist @@ -0,0 +1,12 @@ +include/unicorn/arm.h +include/unicorn/arm64.h +include/unicorn/m68k.h +include/unicorn/mips.h +include/unicorn/platform.h +include/unicorn/sparc.h +include/unicorn/unicorn.h +include/unicorn/x86.h +lib/libunicorn.a +lib/libunicorn.so +lib/libunicorn.so.0 +libdata/pkgconfig/unicorn.pc |