Skip to content

Commit

Permalink
capstone: Fix headers placement and pkg-config
Browse files Browse the repository at this point in the history
  • Loading branch information
kallisti5 committed Mar 16, 2020
1 parent 4978f92 commit a970c01
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions dev-util/capstone/capstone-4.0.1.recipe
Expand Up @@ -16,7 +16,7 @@ various X86 malware tricks)."
HOMEPAGE="http://www.capstone-engine.org"
COPYRIGHT="2013-2019, COSEINC"
LICENSE="BSD (3-clause)"
REVISION="3"
REVISION="4"
SOURCE_URI="https://github.com/aquynh/capstone/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="79bbea8dbe466bd7d051e037db5961fdb34f67c9fac5c3471dd105cfb1e05dc7"
srcGitRev="b01a30bf595c23081d0acfbcbe36fc8c6d829a71"
Expand Down Expand Up @@ -50,6 +50,7 @@ BUILD_REQUIRES="
"
BUILD_PREREQUIRES="
cmd:awk
cmd:sed
cmd:find
cmd:cmake
cmd:gcc$secondaryArchSuffix
Expand All @@ -62,24 +63,30 @@ TEST_REQUIRES="

BUILD()
{
export INCDIR=$includeDir
export LIBDIRARCH=$relativeLibDir
export MAKE_JOBS=$jobArgs
rm -rf build
mkdir build; cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$prefix
make
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$prefix
make $jobArgs
}

INSTALL()
{
export INCDIR=$includeDir
export PREFIX=$prefix
export LIBDIRARCH=$relativeLibDir
cd build
make install

# Fix headers
mkdir -p $includeDir
mv $prefix/include/capstone $includeDir/

prepareInstalledDevelLib libcapstone
fixPkgconfig

# Fix broken include path from capstone 4.0.1
sed -i 's/includedir=\${prefix}\/develop\/headers$/includedir=\${prefix}\/develop\/headers\/capstone/' \
$developDir/lib/pkgconfig/capstone.pc

packageEntries devel $developDir
}

Expand Down

2 comments on commit a970c01

@waddlesplash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capstone uses GNUInstallDirs: https://github.com/qemu/capstone/blob/5d3ceeb88c2c81d7549a928df02d23df37c73151/CMakeLists.txt#L597

So this is not needed; just use $cmakeDirArgs in the cmake invocation and drop the PREFIX specification.

@kallisti5
Copy link
Member Author

@kallisti5 kallisti5 commented on a970c01 Mar 16, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.