0
0
Fork 0
haikuports/dev-util/capstone/capstone-4.0.2.recipe

100 lines
2.7 KiB
Bash
Raw Permalink Normal View History

2015-08-09 20:32:46 +00:00
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"
2020-05-14 07:15:47 +00:00
COPYRIGHT="2013-2020 COSEINC"
2018-08-03 06:43:22 +00:00
LICENSE="BSD (3-clause)"
2020-05-14 07:15:47 +00:00
REVISION="1"
2015-08-09 20:32:46 +00:00
SOURCE_URI="https://github.com/aquynh/capstone/archive/$portVersion.tar.gz"
2020-05-14 07:15:47 +00:00
CHECKSUM_SHA256="7c81d798022f81e7507f1a60d6817f63aa76e489aa4e7055255f21a22f5e526a"
srcGitRev="27c8950fe865a2326b919444aeb3cf18963d96ba"
SOURCE_URI_2="https://github.com/groundx/capstonefuzz/archive/$srcGitRev.tar.gz"
2020-05-14 07:15:47 +00:00
CHECKSUM_SHA256_2="17e96a70754c8467ebe12c6fe8033b53dfc03a2d52d336be876eb7cf256d36e2"
SOURCE_FILENAME="capstone-$portVersion.tar.gz"
2015-08-09 20:32:46 +00:00
PATCHES="capstone-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2 ?x86"
2018-01-11 22:54:29 +00:00
SECONDARY_ARCHITECTURES="x86"
2015-08-09 20:32:46 +00:00
PROVIDES="
capstone$secondaryArchSuffix = $portVersion
2020-05-14 07:15:47 +00:00
cmd:cstool = $portVersion
2020-03-14 22:29:41 +00:00
lib:libcapstone$secondaryArchSuffix = 0.4 compat >= 0.4
2018-01-11 22:54:29 +00:00
"
REQUIRES="
haiku$secondaryArchSuffix
"
2015-08-09 20:32:46 +00:00
PROVIDES_devel="
2018-01-11 22:54:29 +00:00
capstone${secondaryArchSuffix}_devel = $portVersion
2020-03-14 22:29:41 +00:00
devel:libcapstone$secondaryArchSuffix = 0.4 compat >= 0.4
2018-01-11 22:54:29 +00:00
"
2015-08-09 20:32:46 +00:00
REQUIRES_devel="
capstone$secondaryArchSuffix == $portVersion base
2018-01-11 22:54:29 +00:00
"
2015-08-09 20:32:46 +00:00
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
2018-01-11 22:54:29 +00:00
"
2015-08-09 20:32:46 +00:00
BUILD_PREREQUIRES="
cmd:awk
cmd:sed
cmd:find
cmd:cmake
2015-08-09 20:32:46 +00:00
cmd:gcc$secondaryArchSuffix
cmd:make
2018-01-11 22:54:29 +00:00
"
2015-08-09 20:32:46 +00:00
TEST_REQUIRES="
cmd:unzip
"
2015-08-09 20:32:46 +00:00
BUILD()
{
rm -rf build
mkdir build; cd build
2020-05-14 07:15:47 +00:00
cmake .. $cmakeDirArgs -DCMAKE_BUILD_TYPE=Release
make $jobArgs
2015-08-09 20:32:46 +00:00
}
INSTALL()
{
cd build
make install
2015-08-09 20:32:46 +00:00
prepareInstalledDevelLib libcapstone
fixPkgconfig
2020-05-14 07:15:47 +00:00
# Fix broken include path
sed -i -e "s|includedir=.*|includedir=\"$includeDir/capstone\"/|" \
$developLibDir/pkgconfig/capstone.pc
2015-08-09 20:32:46 +00:00
packageEntries devel $developDir
}
TEST()
{
cd build
export filename="corpus-libFuzzer-capstone_fuzz_disasmnext-latest"
if [ -d "./suite/fuzz/$filename" ]; then
true
else
unzip -o -q $sourceDir2/capstonefuzz-$srcGitRev/corpus/$filename.zip -d suite/fuzz
fi
make check
2020-03-14 22:29:41 +00:00
}