Wrong build environment with makepkg
I am the maintainer of the
weex
package. I've encountered a strange issue. If I make the package with
the configure step breaks with
checking for regex.h... no
checking for gnuregex.h... (cached) no
checking for regex.h... (cached) no
configure: error: GNU regex library is not installed.
If I run the configure-step manually (as a normal user), the configure script can find the regex.h file (because it is here: /usr/include/regex.h)
So, why can't find makepkg the includes here? I've tried to put the header file in the source folder (see PKGBUILD), but this does not work either :(
Last edited by aaronmueller (2014-07-13 09:43:56)
Re: Wrong build environment with makepkg
config.log from the failed configure will tell you.
Thanks!
makepkg:
...
configure:3547: checking for gnuregex.h
configure:3557: /lib/cpp -D_FORTIFY_SOURCE=2 conftest.c >/dev/null 2>conftest.out
./configure: line 3556: /lib/cpp: No such file or directory
configure: failed program was:
#line 3552 "configure"
#include "confdefs.h"
#include <gnuregex.h>
configure:3547: checking for regex.h
configure:3557: /lib/cpp -D_FORTIFY_SOURCE=2 conftest.c >/dev/null 2>conftest.out
./configure: line 3556: /lib/cpp: No such file or directory
configure: failed program was:
#line 3552 "configure"
#include "confdefs.h"
#include <regex.h>
configure:3585: checking for gnuregex.h
configure:3620: checking for regex.h
manual ./configure in the source folder:
...
configure:3547: checking for sys/time.h
configure:3557: gcc -E conftest.c >/dev/null 2>conftest.out
configure:3547: checking for unistd.h
configure:3547: checking for gnuregex.h
configure:3557: gcc -E conftest.c >/dev/null 2>conftest.out
configure:3553:22: fatal error: gnuregex.h: No such file or directory
#include <$ac_hdr>
compilation terminated.
configure: failed program was:
#line 3552 "configure"
#include "confdefs.h"
#include <gnuregex.h>
configure:3547: checking for regex.h
configure:3557: gcc -E conftest.c >/dev/null 2>conftest.out
configure:3585: checking for gnuregex.h
configure:3620: checking for regex.h
...
Seems the /lib/cpp macro does not work? But why?
Last edited by aaronmueller (2014-07-13 14:35:27)
Re: Wrong build environment with makepkg
Not enough context. Please post the whole log from the failed configure.
I'll note that /lib/cpp is an old symlink that no longer exists in Arch.
Last edited by falconindy (2014-07-13 14:59:46)
Re: Wrong build environment with makepkg
Problem seems to be that default Arch CPPFLAGS includes -D_FORTIFY_SOURCE=2 which trips up the check. The build system for weex is absolutely ancient (which is why it references /lib/cpp), but autoreconf will fail because, again, the build system is ancient and doesn't conform to modern autotools setups.
You can work around this in build by unsetting CPPFLAGS and moving -D_FORTIFY_SOURCE=2 to CFLAGS. Here's a better PKGBUILD that fixes a lot of other issues:
pkgname=weex
pkgver=2.6.1.5
pkgrel=5
pkgdesc="A non-interactive FTP client for updating web pages"
arch=(i686 x86_64)
license=("GPL")
source=("http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz"
"http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=lib/regex.h"
"weex-2.6.1.5-formatstring.patch"
"weex-2.6.1.5-va_list.patch")
md5sums=("c10192608ab9f715c4c1ea63cf6ad2da"
"63dc5065aa90e787153804229e7da1c2"
"a12d955c5a4d6b059395a0da22942114"
"522552e03b82ab5669fd21c558290691")
url="http://weex.sourceforge.net/"
prepare() {
cd "$pkgname-$pkgver"
patch -Np0 -i ../weex-$pkgver-formatstring.patch
[[ $CARCH == x86_64 ]] && patch -Np0 -i ../weex-$pkgver-va_list.patch
build() {
cd "$pkgname-$pkgver"
# work around problems in ancient autotools installation
unset CPPFLAGS
CFLAGS+=' -D_FORTIFY_SOURCE=2'
./configure --prefix=/usr
package() {
cd "$pkgname-$pkgver"
make DESTDIR="$pkgdir" install