##

##

我正在尝试根据以下说明从源代码编译 gpgme-1.18https://linuxfromscratch.org/blfs/view/systemd/postlfs/gpgme.html

编译失败,出现以下错误:

Making all in python
make[2]: Entering directory '/home/brad_b82/gpgme-1.18.0/lang/python'
Making all in .
make[3]: Entering directory '/home/brad_b82/gpgme-1.18.0/lang/python'
set -e ; for PYTHON in /usr/bin/python3.10; do \
  CPP="gcc -E" \
  CFLAGS="-g -O2 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wno-format-y2k -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-zero-length -Wno-format-truncation -Wno-sizeof-pointer-div" \
  srcdir="." \
  top_builddir="../.." \
    $PYTHON setup.py build --verbose --build-base="$(basename "${PYTHON}")-gpg" ; \
done
running build
Using gpgme.h from ../../src/gpgme.h
Please use --libdir=LIBDIR option or set PKG_CONFIG_LIBDIR
Or set PKG_CONFIG_PATH
Could not find gpg-error-config.  Please install the libgpg-error development package.
make[3]: *** [Makefile:758: all-local] Error 1
make[3]: Leaving directory '/home/brad_b82/gpgme-1.18.0/lang/python'
make[2]: *** [Makefile:475: all-recursive] Error 1
make[2]: Leaving directory '/home/brad_b82/gpgme-1.18.0/lang/python'
make[1]: *** [Makefile:460: all-recursive] Error 1
make[1]: Leaving directory '/home/brad_b82/gpgme-1.18.0/lang'
make: *** [Makefile:538: all-recursive] Error 1

电脑会撒谎!早些时候,在配置过程中,脚本能够看到 gpg-error-config。

checking for gpg-error-config... /usr/bin/gpg-error-config
checking for gpgrt-config... /usr/bin/gpgrt-config
configure: Use gpgrt-config with /usr/lib as gpg-error-config
checking for GPG Error - version >= 1.36... yes (1.46)
configure: Use gpgrt-config as libassuan-config

我可以验证它的路径位置:

brad_b82 [ ~ ]$ which gpg-error-config
/usr/bin/gpg-error-config
brad_b82 [ ~ ]$ 

gpg-error-config 是一个符号链接:

brad_b82 [ ~ ]$ file /usr/bin/gpg-error-config 
/usr/bin/gpg-error-config: symbolic link to gpgrt-config
brad_b82 [ ~ ]$ 

当我运行 gpg-error-config 时,我得到以下信息:

brad_b82 [ ~ ]$ gpg-error-config
Please use --libdir=LIBDIR option or set PKG_CONFIG_LIBDIR
Or set PKG_CONFIG_PATH
brad_b82 [ ~ ]$

我不知道在哪里可以解决我的问题。任何帮助是极大的赞赏!

##

编辑#1,关于布伦森

我确实验证了 libgpg-error 的位置。所以
我还将相同的库复制到 /usr/share/libgpg-error/ ,文档告诉我这是默认位置。

Making all in python
make[2]: Entering directory '/home/brad_b82/gpgme-1.18.0/build1/build2/lang/python'
Making all in .
make[3]: Entering directory '/home/brad_b82/gpgme-1.18.0/build1/build2/lang/python'
ln -sf "../../../../src/data.h" .
ln -sf "../../conf/config.h" .
ln -sf "../../../../lang/python/src" gpg
touch copystamp
set -e ; for PYTHON in /usr/bin/python3.10; do \
  CPP="gcc -E" \
  CFLAGS="-g -O2 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wno-format-y2k -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-zero-length -Wno-format-truncation -Wno-sizeof-pointer-div" \
  srcdir="../../../../lang/python" \
  top_builddir="../.." \
    $PYTHON setup.py build --verbose --build-base="$(basename "${PYTHON}")-gpg" ; \
done
running build
Using gpgme.h from ../../src/gpgme.h
Please use --libdir=LIBDIR option or set PKG_CONFIG_LIBDIR
Or set PKG_CONFIG_PATH
Could not find gpg-error-config.  Please install the libgpg-error development package.
make[3]: *** [Makefile:758: all-local] Error 1
make[3]: Leaving directory '/home/brad_b82/gpgme-1.18.0/build1/build2/lang/python'
make[2]: *** [Makefile:475: all-recursive] Error 1
make[2]: Leaving directory '/home/brad_b82/gpgme-1.18.0/build1/build2/lang/python'
make[1]: *** [Makefile:460: all-recursive] Error 1
make[1]: Leaving directory '/home/brad_b82/gpgme-1.18.0/build1/build2/lang'
make: *** [Makefile:538: all-recursive] Error 1
brad_b82 [ ~/gpgme-1.18.0/build1/build2 ]$ ls /usr/lib/ | grep gpg
libgpg-error.so
libgpg-error.so.0
libgpg-error.so.0.33.1
brad_b82 [ ~/gpgme-1.18.0/build1/build2 ]$ ls /usr/share/libgpg-error/
errorref.txt  libgpg-error.so  libgpg-error.so.0  libgpg-error.so.0.33.1
brad_b82 [ ~/gpgme-1.18.0/build1/build2 ]$ 

我想指出的新事物。 gpgme 绑定的“cl”和“cpp”部分似乎编译得很好。直到它尝试编译 python 绑定时,它才被阻塞。

我还尝试读取 python 部分的每一行输出,并且我注意到一些奇怪的事情......使用 ../../src/gpgme.h 中的 gpgme.h

不会有这样的路径,因为我所在的目录是 ~/gpgme-1.18.0 ,扩展后只是 /home/brad_b82/gpgme-1.18.0

由于我没有足够的知识来解决这个问题,我决定简单地尝试:

cd ~
rm -Rf gpgme-1.18.0
tar -xvf gpgme-1.18.0.tar.bz2
cd gpgme-1.18.0
mkdir build1
cd build1
mkdir build2
cd build2
../../configure --prefix=/usr --libdir=/usr/lib --disable-gpg-test

我的思考过程是,现在 ../../src/gpgme.h 实际上存在。但仍然失败。是的,我确实包含了 --libdir=/usr/lib 只是为了尝试覆盖基础,即使完全相同的路径出现在配置脚本中而没有添加它。

答案1

我需要回答这个问题并关闭它......

linuxfromscratch 开发者最近发布了一个 gpgme 补丁来解决这些问题。

我不是程序员,但当我看到脚本尝试从不存在的目录中提取时,我确实至少走在正确的轨道上。

问题解决,案件结案。

相关内容