mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
Add recipe for capstone disassembler.
This commit is contained in:
67
dev-util/capstone/capstone-3.0.4.recipe
Normal file
67
dev-util/capstone/capstone-3.0.4.recipe
Normal file
@@ -0,0 +1,67 @@
|
||||
SUMMARY="Lightweight multi-platform, multi-architecture disassembly framework"
|
||||
DESCRIPTION="* Multi-architectures: Arm, Arm64 (Armv8), Mips, PowerPC, Sparc, \
|
||||
SystemZ, XCore & X86 (include X86_64) (details).
|
||||
* Clean/simple/lightweight/intuitive architecture-neutral API.
|
||||
* Provide details on disassembled instruction (called “decomposer” by some others).
|
||||
* Provide some semantics of the disassembled instruction, such as list of \
|
||||
implicit registers read & written.
|
||||
* Implemented in pure C language, with bindings for Perl, Python, Ruby, C#, \
|
||||
NodeJS, Java, GO, C++, OCaml, Lua, Rust, Delphi, Free Pascall & Vala available.
|
||||
* Native support for Windows & *nix (with Mac OSX, iOS, Android, Linux, *BSD & \
|
||||
Solaris confirmed).
|
||||
* Thread-safe by design.
|
||||
* Special support for embedding into firmware or OS kernel.
|
||||
* High performance & suitable for malware analysis (capable of handling \
|
||||
various X86 malware tricks)."
|
||||
HOMEPAGE="http://www.capstone-engine.org"
|
||||
LICENSE="BSD (3-clause)"
|
||||
COPYRIGHT="2013-2015, COSEINC"
|
||||
REVISION="1"
|
||||
|
||||
ARCHITECTURES="?x86"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
SOURCE_URI="https://github.com/aquynh/capstone/archive/$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="5d6dadf5864c56f8de66c66088fa68e849d0bff6577865a4f81b6f23112b14f2"
|
||||
PATCHES="capstone-$portVersion.patchset"
|
||||
|
||||
PROVIDES="
|
||||
capstone$secondaryArchSuffix = $portVersion
|
||||
lib:libcapstone$secondaryArchSuffix = 3
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
devel:libcapstone$secondaryArchSuffix = 3
|
||||
"
|
||||
|
||||
REQUIRES_devel="
|
||||
capstone$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
"
|
||||
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:awk
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:make
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
./make.sh default LIBDIRARCH=$relativeLibDir
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
export PREFIX=$prefix
|
||||
./make.sh install LIBDIRARCH=$relativeLibDir
|
||||
prepareInstalledDevelLib libcapstone
|
||||
fixPkgconfig
|
||||
packageEntries devel $developDir
|
||||
}
|
||||
38
dev-util/capstone/patches/capstone_x86-3.0.4.patchset
Normal file
38
dev-util/capstone/patches/capstone_x86-3.0.4.patchset
Normal file
@@ -0,0 +1,38 @@
|
||||
From c5005870684d589868ab5e5710320e1286bb5572 Mon Sep 17 00:00:00 2001
|
||||
From: Adrien Destugues <pulkomandy@gmail.com>
|
||||
Date: Sun, 9 Aug 2015 22:31:25 +0200
|
||||
Subject: Hack in Haiku support.
|
||||
|
||||
* Could not get LIBDIRARCH to work, so override it
|
||||
* Add a prefix variable to the pkg-config file so it can be fixed by
|
||||
* haikuporter
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 52ae2a9..c787759 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -59,11 +59,11 @@ else
|
||||
BLDIR = $(abspath $(BUILDDIR))
|
||||
OBJDIR = $(BLDIR)/obj
|
||||
endif
|
||||
-INCDIR = $(DESTDIR)$(PREFIX)/include
|
||||
+INCDIR = $(DESTDIR)$(PREFIX)/develop/headers
|
||||
|
||||
UNAME_S := $(shell uname -s)
|
||||
|
||||
-LIBDIRARCH ?= lib
|
||||
+LIBDIRARCH ?= lib/x86
|
||||
# Uncomment the below line to installs x86_64 libs to lib64/ directory.
|
||||
# Or better, pass 'LIBDIRARCH=lib64' to 'make install/uninstall' via 'make.sh'.
|
||||
#LIBDIRARCH ?= lib64
|
||||
@@ -457,6 +457,7 @@ define generate-pkgcfg
|
||||
echo 'Name: capstone' > $(PKGCFGF)
|
||||
echo 'Description: Capstone disassembly engine' >> $(PKGCFGF)
|
||||
echo 'Version: $(PKG_VERSION)' >> $(PKGCFGF)
|
||||
+ echo 'prefix=$(PREFIX)' >> $(PKGCFGF)
|
||||
echo 'libdir=$(LIBDIR)' >> $(PKGCFGF)
|
||||
echo 'includedir=$(INCDIR)/capstone' >> $(PKGCFGF)
|
||||
echo 'archive=$${libdir}/libcapstone.a' >> $(PKGCFGF)
|
||||
--
|
||||
2.2.2
|
||||
|
||||
Reference in New Issue
Block a user