aboutsummaryrefslogtreecommitdiff
path: root/devel/capstone
diff options
context:
space:
mode:
authorKubilay Kocak <koobs@FreeBSD.org>2014-01-27 07:00:24 +0000
committerKubilay Kocak <koobs@FreeBSD.org>2014-01-27 07:00:24 +0000
commitf7980a1f735ad3e5bc95c7ee0728ba33571638a7 (patch)
treec006b097c60af6794d3aee4002c19f0a330a1bb0 /devel/capstone
parent6d9c0ebc96f6a0034baea3384635baa53626b440 (diff)
downloadports-f7980a1f735ad3e5bc95c7ee0728ba33571638a7.tar.gz
ports-f7980a1f735ad3e5bc95c7ee0728ba33571638a7.zip
Notes
Diffstat (limited to 'devel/capstone')
-rw-r--r--devel/capstone/Makefile22
-rw-r--r--devel/capstone/distinfo2
-rw-r--r--devel/capstone/files/patch-Makefile52
-rw-r--r--devel/capstone/files/patch-tests_Makefile22
-rw-r--r--devel/capstone/pkg-descr16
-rw-r--r--devel/capstone/pkg-plist10
6 files changed, 124 insertions, 0 deletions
diff --git a/devel/capstone/Makefile b/devel/capstone/Makefile
new file mode 100644
index 000000000000..098c9185d8f0
--- /dev/null
+++ b/devel/capstone/Makefile
@@ -0,0 +1,22 @@
+# $FreeBSD$
+
+PORTNAME= capstone
+PORTVERSION= 2.0
+CATEGORIES= devel
+MASTER_SITES= http://capstone-engine.org/download/2.0/
+
+MAINTAINER= oliver.pntr@gmail.com
+COMMENT= Multi-platform, multi-architecture disassembly framework
+
+LICENSE= BSD3CLAUSE
+
+USES= gmake
+USE_LDCONFIG= yes
+
+MAKE_ENV= INSTALL_LIBRARY="${INSTALL_LIB}"
+
+post-build:
+ # The pkgconfig file is generated and points to stagedir
+ ${REINPLACE_CMD} -e '/libdir/s|\(libdir=\)\(.*\)\(devel/capstone/work/stage\)|\1|g' ${WRKSRC}/capstone.pc
+
+.include <bsd.port.mk>
diff --git a/devel/capstone/distinfo b/devel/capstone/distinfo
new file mode 100644
index 000000000000..9c59fdf5dc3f
--- /dev/null
+++ b/devel/capstone/distinfo
@@ -0,0 +1,2 @@
+SHA256 (capstone-2.0.tar.gz) = 5d871b1e52047d1b2882bbcc6f049205ba6acc8d55d746937d22af5d0b33fa9e
+SIZE (capstone-2.0.tar.gz) = 1731759
diff --git a/devel/capstone/files/patch-Makefile b/devel/capstone/files/patch-Makefile
new file mode 100644
index 000000000000..7c18ee252e29
--- /dev/null
+++ b/devel/capstone/files/patch-Makefile
@@ -0,0 +1,52 @@
+--- Makefile.orig 2014-01-22 11:33:35.000000000 +0100
++++ Makefile 2014-01-25 19:13:32.000000000 +0100
+@@ -15,7 +15,7 @@
+ STRIP = $(CROSS)strip
+ endif
+
+-CFLAGS += -fPIC -O3 -Wall -Iinclude
++CFLAGS += -fPIC -Wall -Iinclude
+
+ ifeq ($(USE_SYS_DYN_MEM),yes)
+ CFLAGS += -DUSE_SYS_DYN_MEM
+@@ -38,6 +38,14 @@
+ endif
+ endif
+
++LIBDATADIR = $(LIBDIR)
++UNAME_S := $(shell uname -s)
++ifeq ($(UNAME_S), FreeBSD)
++LIBDATADIR = $(DESTDIR)$(PREFIX)/libdata
++else
++LIBDATADIR = $(LIBDIR)
++endif
++
+ INSTALL_BIN ?= install
+ INSTALL_DATA ?= $(INSTALL_BIN) -m0644
+ INSTALL_LIBRARY ?= $(INSTALL_BIN) -m0755
+@@ -88,7 +96,6 @@
+
+ LIBOBJ += MCInst.o
+
+-UNAME_S := $(shell uname -s)
+ # OSX?
+ ifeq ($(UNAME_S),Darwin)
+ EXT = dylib
+@@ -156,14 +163,14 @@
+ $(INSTALL_DATA) lib$(LIBNAME).$(AR_EXT) $(LIBDIR)
+ mkdir -p $(INCDIR)/$(LIBNAME)
+ $(INSTALL_DATA) include/*.h $(INCDIR)/$(LIBNAME)
+- mkdir -p $(LIBDIR)/pkgconfig
+- $(INSTALL_DATA) $(PKGCFGF) $(LIBDIR)/pkgconfig/
++ mkdir -p $(LIBDATADIR)/pkgconfig
++ $(INSTALL_DATA) $(PKGCFGF) $(LIBDATADIR)/pkgconfig/
+
+ uninstall:
+ rm -rf $(INCDIR)/$(LIBNAME)
+ rm -f $(LIBDIR)/lib$(LIBNAME).$(EXT)
+ rm -f $(LIBDIR)/lib$(LIBNAME).$(AR_EXT)
+- rm -f $(LIBDIR)/pkgconfig/$(LIBNAME).pc
++ rm -f $(LIBDATADIR)/pkgconfig/$(LIBNAME).pc
+
+ clean:
+ rm -f $(LIBOBJ) lib$(LIBNAME).*
diff --git a/devel/capstone/files/patch-tests_Makefile b/devel/capstone/files/patch-tests_Makefile
new file mode 100644
index 000000000000..ea971411ffc1
--- /dev/null
+++ b/devel/capstone/files/patch-tests_Makefile
@@ -0,0 +1,22 @@
+--- tests/Makefile.orig 2014-01-25 19:14:03.000000000 +0100
++++ tests/Makefile 2014-01-25 19:14:24.000000000 +0100
+@@ -11,7 +11,7 @@
+ endif
+
+
+-CFLAGS += -fPIC -O3 -Wall -I$(INCDIR) -L$(LIBDIR)
++CFLAGS += -fPIC -Wall -I$(INCDIR) -L$(LIBDIR)
+
+ LIBNAME = capstone
+
+@@ -48,8 +48,8 @@
+ $(BINARY): $(OBJS)
+
+ %$(BIN_EXT): %.o
+- ${CC} $(CFLAGS) $(LDFLAGS) $< -O3 -Wall -l$(LIBNAME) -o $@
+- ${CC} $(CFLAGS) $(LDFLAGS) $< -O3 -Wall ../lib$(LIBNAME).$(AR_EXT) -o $(subst $(BIN_EXT),,$@).static$(BIN_EXT)
++ ${CC} $(CFLAGS) $(LDFLAGS) $< -Wall -l$(LIBNAME) -o $@
++ ${CC} $(CFLAGS) $(LDFLAGS) $< -Wall ../lib$(LIBNAME).$(AR_EXT) -o $(subst $(BIN_EXT),,$@).static$(BIN_EXT)
+
+ %.o: %.c
+ ${CC} ${CFLAGS} -c $< -o $@
diff --git a/devel/capstone/pkg-descr b/devel/capstone/pkg-descr
new file mode 100644
index 000000000000..fcd3cdb17cb6
--- /dev/null
+++ b/devel/capstone/pkg-descr
@@ -0,0 +1,16 @@
+Capstone is a lightweight multi-platform, multi-architecture disassembly
+framework.
+
+Features:
+ * Supported architectures: ARM, ARM64 (aka ARMv8), Mips, PowerPC & X86
+ * Clean/simple/lightweight/intuitive architecture-neutral API
+ * Provide details on disassembled instruction (called "decomposer")
+ * Provide some semantics of the disassembled instruction, such as list of
+ implicit registers read & written.
+ * Implemented in pure C language, with bindings for Python, Ruby, C#, Java,
+ GO, OCaml & Vala available.
+ * Native support for Windows & *nix (including MacOSX, Linux, *BSD & Solaris)
+ * Thread-safe by design
+ * Distributed under the open source BSD license
+
+WWW: http://capstone-engine.org/
diff --git a/devel/capstone/pkg-plist b/devel/capstone/pkg-plist
new file mode 100644
index 000000000000..702037f2ee97
--- /dev/null
+++ b/devel/capstone/pkg-plist
@@ -0,0 +1,10 @@
+include/capstone/arm.h
+include/capstone/arm64.h
+include/capstone/capstone.h
+include/capstone/mips.h
+include/capstone/ppc.h
+include/capstone/x86.h
+lib/libcapstone.a
+lib/libcapstone.so
+libdata/pkgconfig/capstone.pc
+@dirrmtry include/capstone