Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Dec 2016 06:43:52 +0000 (UTC)
From:      Antoine Brodin <antoine@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r428645 - in head/emulators: . unicorn unicorn/files
Message-ID:  <201612160643.uBG6hq0k039696@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: antoine
Date: Fri Dec 16 06:43:52 2016
New Revision: 428645
URL: https://svnweb.freebsd.org/changeset/ports/428645

Log:
  New port: emulators/unicorn
  
  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/

Added:
  head/emulators/unicorn/
  head/emulators/unicorn/Makefile   (contents, props changed)
  head/emulators/unicorn/distinfo   (contents, props changed)
  head/emulators/unicorn/files/
  head/emulators/unicorn/files/patch-Makefile   (contents, props changed)
  head/emulators/unicorn/files/patch-qemu_configure   (contents, props changed)
  head/emulators/unicorn/files/patch-tests_unit_Makefile   (contents, props changed)
  head/emulators/unicorn/pkg-descr   (contents, props changed)
  head/emulators/unicorn/pkg-plist   (contents, props changed)
Modified:
  head/emulators/Makefile

Modified: head/emulators/Makefile
==============================================================================
--- head/emulators/Makefile	Fri Dec 16 06:19:36 2016	(r428644)
+++ head/emulators/Makefile	Fri Dec 16 06:43:52 2016	(r428645)
@@ -147,6 +147,7 @@
     SUBDIR += tuxnes
     SUBDIR += uae
     SUBDIR += ucon64
+    SUBDIR += unicorn
     SUBDIR += vba
     SUBDIR += vboxtool
     SUBDIR += vgb-bin

Added: head/emulators/unicorn/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/unicorn/Makefile	Fri Dec 16 06:43:52 2016	(r428645)
@@ -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>

Added: head/emulators/unicorn/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/unicorn/distinfo	Fri Dec 16 06:43:52 2016	(r428645)
@@ -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

Added: head/emulators/unicorn/files/patch-Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/unicorn/files/patch-Makefile	Fri Dec 16 06:43:52 2016	(r428645)
@@ -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)

Added: head/emulators/unicorn/files/patch-qemu_configure
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/unicorn/files/patch-qemu_configure	Fri Dec 16 06:43:52 2016	(r428645)
@@ -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

Added: head/emulators/unicorn/files/patch-tests_unit_Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/unicorn/files/patch-tests_unit_Makefile	Fri Dec 16 06:43:52 2016	(r428645)
@@ -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 $@ $^
+ 
+ 
+ 

Added: head/emulators/unicorn/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/unicorn/pkg-descr	Fri Dec 16 06:43:52 2016	(r428645)
@@ -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/

Added: head/emulators/unicorn/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/unicorn/pkg-plist	Fri Dec 16 06:43:52 2016	(r428645)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612160643.uBG6hq0k039696>