Add silver searcher (aka 'ag') recipe.

Still needs a proper Makefile patch to fix -lpthread
This commit is contained in:
Chris Roberts
2013-10-25 16:51:42 -06:00
parent 0ed4a57ae5
commit bda2ec7cd3

View File

@@ -0,0 +1,80 @@
SUMMARY="A code-searching tool similar to ack, but faster."
DESCRIPTION="A code-searching tool similar to ack, but faster."
HOMEPAGE="https://github.com/ggreer/the_silver_searcher/"
SRC_URI="git+https://github.com/ggreer/the_silver_searcher.git#0.17"
CHECKSUM_MD5=""
COPYRIGHT="2013 Geoff Greer"
LICENSE="Apache v2"
REVISION="1"
ARCHITECTURES="x86"
if [ $effectiveTargetArchitecture != x86_gcc2 ];then
ARCHITECTURES="$ARCHITECTURES x86_gcc2"
else
ARCHITECTURES="$ARCHITECTURES !x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"
SOURCE_DIR=""
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
the_silver_searcher$secondaryArchSuffix = $portVersion
cmd:ag$commandSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
lib:liblzma${secondaryArchSuffix}
lib:libpcre${secondaryArchSuffix}
lib:libz${secondaryArchSuffix}
"
BUILD_REQUIRES="
devel:liblzma${secondaryArchSuffix}
devel:libpcre${secondaryArchSuffix}
devel:libz${secondaryArchSuffix}
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
cmd:aclocal
cmd:autoconf
cmd:autoheader
cmd:automake
cmd:make
cmd:gcc${secondaryArchSuffix}
cmd:pkg_config
"
PATCH()
{
sed -i 's,-lpthread,,' Makefile.am
}
BUILD()
{
aclocal
autoconf
autoheader
automake --add-missing
#Need to override the pkgconfig variables
LZMA_CFLAGS="-I$includeDir" \
LZMA_LIBS="-L$libDir -llzma" \
PCRE_CFLAGS="-I$includeDir" \
PCRE_LIBS="-L$libDir -lpcre" \
runConfigure --omit-dirs binDir ./configure \
--bindir=$commandBinDir
make
}
INSTALL()
{
make install
}