From 77638708fc90f1d765642d312729a48abc977e3e Mon Sep 17 00:00:00 2001 From: Oliver Pinter Date: Fri, 14 Mar 2014 17:20:12 +0100 Subject: [PATCH 1/4] capstone: updated package for FreeBSD Signed-off-by: Oliver Pinter --- packages/freebsd/ports/devel/capstone/Makefile | 7 ++++--- packages/freebsd/ports/devel/capstone/distinfo | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/freebsd/ports/devel/capstone/Makefile b/packages/freebsd/ports/devel/capstone/Makefile index 098c9185d8..0063b35ff9 100644 --- a/packages/freebsd/ports/devel/capstone/Makefile +++ b/packages/freebsd/ports/devel/capstone/Makefile @@ -1,9 +1,9 @@ # $FreeBSD$ PORTNAME= capstone -PORTVERSION= 2.0 +PORTVERSION= 2.1.1 CATEGORIES= devel -MASTER_SITES= http://capstone-engine.org/download/2.0/ +MASTER_SITES= http://capstone-engine.org/download/2.1/ MAINTAINER= oliver.pntr@gmail.com COMMENT= Multi-platform, multi-architecture disassembly framework @@ -13,7 +13,8 @@ LICENSE= BSD3CLAUSE USES= gmake USE_LDCONFIG= yes -MAKE_ENV= INSTALL_LIBRARY="${INSTALL_LIB}" +MAKE_ENV+= INSTALL_LIB="${INSTALL_LIB}" \ + INSTALL_DATA="${INSTALL_DATA}" post-build: # The pkgconfig file is generated and points to stagedir diff --git a/packages/freebsd/ports/devel/capstone/distinfo b/packages/freebsd/ports/devel/capstone/distinfo index 9c59fdf5dc..5844714e40 100644 --- a/packages/freebsd/ports/devel/capstone/distinfo +++ b/packages/freebsd/ports/devel/capstone/distinfo @@ -1,2 +1,2 @@ -SHA256 (capstone-2.0.tar.gz) = 5d871b1e52047d1b2882bbcc6f049205ba6acc8d55d746937d22af5d0b33fa9e -SIZE (capstone-2.0.tar.gz) = 1731759 +SHA256 (capstone-2.1.1.tar.gz) = 8af3c0a0f439d516277f308938935003d072f34a34fcf2e8dcf07dd415b1ca65 +SIZE (capstone-2.1.1.tar.gz) = 1353194 From 9c17124ec1e1bcedb57b9b6bf661bb075a614b49 Mon Sep 17 00:00:00 2001 From: Oliver Pinter Date: Fri, 14 Mar 2014 17:41:14 +0100 Subject: [PATCH 2/4] capstone: updated Makefile for FreeBSD packages Signed-off-by: Oliver Pinter --- .../ports/devel/capstone/files/patch-Makefile | 42 +++++++++---------- .../devel/capstone/files/patch-tests_Makefile | 22 ---------- 2 files changed, 20 insertions(+), 44 deletions(-) delete mode 100644 packages/freebsd/ports/devel/capstone/files/patch-tests_Makefile diff --git a/packages/freebsd/ports/devel/capstone/files/patch-Makefile b/packages/freebsd/ports/devel/capstone/files/patch-Makefile index 7c18ee252e..dcb85bb74c 100644 --- a/packages/freebsd/ports/devel/capstone/files/patch-Makefile +++ b/packages/freebsd/ports/devel/capstone/files/patch-Makefile @@ -1,6 +1,7 @@ ---- Makefile.orig 2014-01-22 11:33:35.000000000 +0100 -+++ Makefile 2014-01-25 19:13:32.000000000 +0100 -@@ -15,7 +15,7 @@ +diff -ru /Makefile /Makefile +--- Makefile 2014-03-14 17:24:44.000000000 +0100 ++++ Makefile 2014-03-14 17:35:33.000000000 +0100 +@@ -16,7 +16,7 @@ STRIP = $(CROSS)strip endif @@ -9,7 +10,7 @@ ifeq ($(USE_SYS_DYN_MEM),yes) CFLAGS += -DUSE_SYS_DYN_MEM -@@ -38,6 +38,14 @@ +@@ -39,9 +39,17 @@ endif endif @@ -23,30 +24,27 @@ + INSTALL_BIN ?= install INSTALL_DATA ?= $(INSTALL_BIN) -m0644 - INSTALL_LIBRARY ?= $(INSTALL_BIN) -m0755 -@@ -88,7 +96,6 @@ +-INSTALL_LIBRARY ?= $(INSTALL_BIN) -m0755 ++INSTALL_LIB ?= $(INSTALL_BIN) -m0755 + LIBNAME = capstone + +@@ -138,8 +146,7 @@ LIBOBJ += MCInst.o + -UNAME_S := $(shell uname -s) +-PKGCFCGDIR = $(LIBDIR)/pkgconfig ++PKGCFCGDIR = $(LIBDATADIR)/pkgconfig + # OSX? ifeq ($(UNAME_S),Darwin) - EXT = dylib -@@ -156,14 +163,14 @@ +@@ -244,7 +251,7 @@ + + install: $(PKGCFGF) $(ARCHIVE) $(LIBRARY) + mkdir -p $(LIBDIR) +- $(INSTALL_LIBRARY) lib$(LIBNAME).$(EXT) $(LIBDIR) ++ $(INSTALL_LIB) lib$(LIBNAME).$(EXT) $(LIBDIR) $(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/packages/freebsd/ports/devel/capstone/files/patch-tests_Makefile b/packages/freebsd/ports/devel/capstone/files/patch-tests_Makefile deleted file mode 100644 index ea971411ff..0000000000 --- a/packages/freebsd/ports/devel/capstone/files/patch-tests_Makefile +++ /dev/null @@ -1,22 +0,0 @@ ---- 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 $@ From 0a533c2f183ec41c858179fb129d9b753f61fa9f Mon Sep 17 00:00:00 2001 From: Oliver Pinter Date: Fri, 14 Mar 2014 17:55:50 +0100 Subject: [PATCH 3/4] capstone: updated tests/Makefile for FreeBSD package Signed-off-by: Oliver Pinter --- .../devel/capstone/files/patch-tests_Makefile | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 packages/freebsd/ports/devel/capstone/files/patch-tests_Makefile diff --git a/packages/freebsd/ports/devel/capstone/files/patch-tests_Makefile b/packages/freebsd/ports/devel/capstone/files/patch-tests_Makefile new file mode 100644 index 0000000000..02a48e66af --- /dev/null +++ b/packages/freebsd/ports/devel/capstone/files/patch-tests_Makefile @@ -0,0 +1,23 @@ +diff -ru work.orig/capstone-2.1.1/tests/Makefile work/capstone-2.1.1/tests/Makefile +--- tests/Makefile 2014-03-14 17:24:44.000000000 +0100 ++++ tests/Makefile 2014-03-14 17:52:47.000000000 +0100 +@@ -13,7 +13,7 @@ + endif + + +-CFLAGS += -fPIC -O3 -Wall -I$(INCDIR) -L$(LIBDIR) ++CFLAGS += -fPIC -Wall -I$(INCDIR) -L$(LIBDIR) + + LIBNAME = capstone + +@@ -66,8 +66,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 $@ From 017f18403829fbefd5d4d7518a9dd36c414e429f Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Mon, 17 Mar 2014 11:30:10 +0800 Subject: [PATCH 4/4] fix soname for Linux - get it right now --- Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 09aabb2213..d546a29abc 100644 --- a/Makefile +++ b/Makefile @@ -176,11 +176,10 @@ CFLAGS := $(CFLAGS:-fPIC=) # On Windows we need the shared library to be executable else # Linux, *BSD -EXT = so -AR_EXT = a API_MAJOR=$(shell echo `grep -e CS_API_MAJOR include/capstone.h | grep -v = | awk '{print $$3}'` | awk '{print $$1}') - -LDFLAGS += -Wl,-soname,lib$(LIBNAME)$(API_MAJOR) +EXT = so.$(API_MAJOR) +AR_EXT = a +LDFLAGS += -Wl,-soname,lib$(LIBNAME).$(EXT) endif endif endif @@ -253,8 +252,7 @@ install: $(PKGCFGF) $(ARCHIVE) $(LIBRARY) uninstall: rm -rf $(INCDIR)/$(LIBNAME) - rm -f $(LIBDIR)/lib$(LIBNAME).$(EXT) - rm -f $(LIBDIR)/lib$(LIBNAME).$(AR_EXT) + rm -f $(LIBDIR)/lib$(LIBNAME).* rm -f $(PKGCFCGDIR)/$(LIBNAME).pc clean: