You are not logged in.

#1 2024-04-20 18:37:39

D3vil0p3r
Member
Registered: 2022-11-05
Posts: 187

[SOLVED] Building Error - undefined reference to `pcre_*' on PKGBUILD

I'm trying to package bulk_extractor: https://github.com/simsong/bulk_extractor but when I test the PKGBUILD process, it fails during the building whereas if I clone manually the repository and I run the same commands I have in PKGBUILD on the terminal, the build works.

Why?

The PKGBUILD is:

pkgname=bulk-extractor
pkgver=2333.6a7da28
pkgrel=1
pkgdesc='Bulk Email and URL extraction tool.'
arch=('x86_64')
url='https://github.com/simsong/bulk_extractor'
license=('GPL')
depends=('tre' 'flex' 'java-environment' 'openssl' 'exiv2' 'afflib' 'libewf' 'libxml2' 'zlib'
         'ncurses5-compat-libs' 'pcre2' 're2')
makedepends=('git' 'autoconf' 'automake')
source=("git+https://github.com/simsong/${pkgname//-/_}.git")
sha512sums=('SKIP')

pkgver() {
  cd "${pkgname//-/_}"

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd ${pkgname//-/_}

  git submodule update --recursive --remote

  sh bootstrap.sh
}

build() {
  cd ${pkgname//-/_}

  ./configure --prefix=/usr --sysconfdir=/etc

  make
}

package() {
  cd ${pkgname//-/_}

  install -dm 755 "$pkgdir/usr/share/$pkgname"

  make DESTDIR="$pkgdir" install
}

The error I am getting:

/usr/bin/ld: /tmp/ccOMYM23.ltrans4.ltrans.o: in function `regex_vector::~regex_vector()':
/usr/src/debug/bulk-extractor/bulk_extractor/src/be20_api/regex_vector.cpp:91:(.text+0x9bb): undefined reference to `pcre_free'
/usr/bin/ld: /tmp/ccOMYM23.ltrans4.ltrans.o:/usr/src/debug/bulk-extractor/bulk_extractor/src/be20_api/regex_vector.cpp:93:(.text+0x9d0): undefined reference to `pcre_free_study'
/usr/bin/ld: /tmp/ccOMYM23.ltrans4.ltrans.o:/usr/src/debug/bulk-extractor/bulk_extractor/src/be20_api/regex_vector.cpp:94:(.text+0x9da): undefined reference to `pcre_jit_stack_free'
/usr/bin/ld: /tmp/ccOMYM23.ltrans4.ltrans.o: in function `regex_vector::search_all(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, unsigned long*, unsigned long*) const':
/usr/src/debug/bulk-extractor/bulk_extractor/src/be20_api/regex_vector.cpp:142:(.text+0x1924): undefined reference to `pcre_exec'
/usr/bin/ld: /tmp/ccOMYM23.ltrans4.ltrans.o: in function `regex_vector::push_back(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/src/debug/bulk-extractor/bulk_extractor/src/be20_api/regex_vector.cpp:63:(.text+0x84f6): undefined reference to `pcre_compile'
/usr/bin/ld: /usr/src/debug/bulk-extractor/bulk_extractor/src/be20_api/regex_vector.cpp:72:(.text+0x8513): undefined reference to `pcre_study'
/usr/bin/ld: /usr/src/debug/bulk-extractor/bulk_extractor/src/be20_api/regex_vector.cpp:73:(.text+0x8526): undefined reference to `pcre_jit_stack_alloc'
/usr/bin/ld: /usr/src/debug/bulk-extractor/bulk_extractor/src/be20_api/regex_vector.cpp:74:(.text+0x8537): undefined reference to `pcre_assign_jit_stack'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:1367: bulk_extractor] Error 1
make[2]: Leaving directory '/tmp/makepkg/bulk-extractor/src/bulk_extractor/src'
make[1]: *** [Makefile:527: all-recursive] Error 1
make[1]: Leaving directory '/tmp/makepkg/bulk-extractor/src/bulk_extractor'
make: *** [Makefile:467: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Last edited by D3vil0p3r (2024-04-21 09:18:10)

Offline

#2 2024-04-20 18:52:55

loqs
Member
Registered: 2014-03-06
Posts: 17,603

Re: [SOLVED] Building Error - undefined reference to `pcre_*' on PKGBUILD

You do not have pcre installed in the clean chroot as it is not listed in the PKGBUILD.  Please consider helping the project transition to pcre2.

Offline

#3 2024-04-20 18:59:28

D3vil0p3r
Member
Registered: 2022-11-05
Posts: 187

Re: [SOLVED] Building Error - undefined reference to `pcre_*' on PKGBUILD

I added "pcre2" as dependency but I continue to get the same error.

Offline

#4 2024-04-20 19:40:26

loqs
Member
Registered: 2014-03-06
Posts: 17,603

Re: [SOLVED] Building Error - undefined reference to `pcre_*' on PKGBUILD

You need to add pcre not pcre2 unless you or the project convert to pcre2.

Offline

Board footer

Powered by FluxBB