linux - 在 Arch Linux 上安装 sphinx + re2

标签 linux package sphinx archlinux re2

我需要用 regexp_filter 安装 sphinx选项。 我已经用 pacman 安装了 re2 包。 在文档中,我看到我可以使用 --with-re2 选项编译 sphinx 包。但是当我这样做时,我得到了错误。

checking whether to compile with RE2 library support... configure: error: missing re2 sources

我还尝试设置make 选项,例如here .

--with-re2-libs=/usr/lib/libre2.so --with-re2-includes=/usr/include/re2/

但是我有另一个错误

checking whether to compile with RE2 library support... configure: error: missing re2 headers

这是我的 ls/usr/include/re2

的输出
ls /usr/include/re2/
  filtered_re2.h 
  re2.h 
  set.h 
  stringpiece.h 
  variadic_function.h

有人安装过吗?感谢所有帮助!

最佳答案

我已经找到了我的问题的解决方案。

我刚换了

--with-re2-libs=/usr/lib/libre2.so --with-re2-includes=/usr/include/re2/

有了这个

--with-re2-libs=/usr/lib/ --with-re2-includes=/usr/include/re2/

这里是完整的 pkgbuild 文件:

# Maintainer: Isaac Aronson <i at linux dotcom>
# Contributor: Dan Serban
# Contributor: Jim Casteel
# Contributor: dryes <joswiseman@gmail>
# Contributor: Vishnevsky Roman <aka dot x0x01 at gmail dot com>
# Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# Contributor: Aldo Culquicondor <alculquicondor@gmail.com>
# Contributor: Florijan Hamzic <florijanh@gmail.com>
pkgname='sphinx'
pkgver=2.2.10
pkgrel=2
pkgdesc='Free open-source SQL full-text search engine.'
arch=('i686' 'x86_64')
url='http://www.sphinxsearch.com/'
license=('GPL')
depends=('unixodbc' 'expat' 'libmysqlclient' 'postgresql-libs' 're2')
optdepends=('postgresql')
backup=('etc/conf.d/sphinx')
install='sphinx.install'
source=("http://sphinxsearch.com/files/${pkgname}-${pkgver}-release.tar.gz"
    'sphinx.conf.d'
    'sphinx.rc.d' 
    'sphinx.service'
    'sphinx.tmpfiles.conf')

build() {
  sed -i '15199,15199 s/x00/x21/' "${srcdir}/${pkgname}-${pkgver}-release/src/searchd.cpp"

  cd "${srcdir}/${pkgname}-${pkgver}-release"
  ./configure --prefix=/usr --exec-prefix=/usr --localstatedir=/var/lib/sphinx \
    --sysconfdir=/etc/sphinx --with-pgsql --enable-id64 --with-re2 --with-re2-include=/usr/include/re2 --with-re2-libs=/usr/lib/libre2.so

  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}-release"

  make DESTDIR="${pkgdir}" install

  for _f in "${pkgdir}/usr/bin/"*; do
    ln -s "/usr/bin/${_f##*/}" "${pkgdir}/usr/bin/sphinx-${_f##*/}"
  done

  install -Dm755 "${srcdir}/sphinx.rc.d" "${pkgdir}/etc/rc.d/sphinx"
  install -Dm644 "${srcdir}/sphinx.conf.d" "${pkgdir}/etc/conf.d/sphinx"
  install -Dm644 "${srcdir}/sphinx.service" "${pkgdir}/usr/lib/systemd/system/sphinx.service"
  install -d "${pkgdir}/usr/share/sphinx/lib"
  install -Dm644 api/sphinxapi.php "${pkgdir}/usr/share/sphinx/lib/sphinxapi.php"
  install -Dm644 api/sphinxapi.py "${pkgdir}/usr/share/sphinx/lib/sphinxapi.py"
  install -Dm644 "${srcdir}/sphinx.tmpfiles.conf" "${pkgdir}/usr/lib/tmpfiles.d/sphinx.conf"
}
md5sums=('dda52b24d8348fc09e26d8a649a231d2'
         '48e3e1857919d26d5104a48caffb531b'
         'faaa8310af97ff1dbdaf08612e442020'
         'fe06a8aff0520a6f75596ee43d2e5935'
         '22ec4cd0471a1d52702d57d78614b8d8')

关于linux - 在 Arch Linux 上安装 sphinx + re2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36336217/

相关文章:

php - 为什么PHP写文件需要 "execute"权限?

linux - 如何使用 fw1-loggrabber 监控多个设备

java - 在多个项目中使用自定义包

postgresql - 有什么理由不在 Heroku 上使用 PostgreSQL 的内置全文搜索?

php - 在 HTML 中包含 php 脚本

c++ - 在 linux 上安装 nsis 失败 exitcode1

java - 在 Java 中,资源应该放在包/源层次结构中的什么位置?

javascript - 使用 require.js 包管理大型应用程序

full-text-search - sphinx 可以用于 cassandra 吗?

php - 如何在 SPhinxql 查询生成器中设置匹配模式