尝试从源代码构建 gtk+3.0 失败

尝试从源代码构建 gtk+3.0 失败

我尝试对 Ubuntu 21.10 上的 gtk+3.0 打补丁,但失败了。但更重要的是,即使不打补丁,我也无法构建软件包。

步骤如下:

apt-get source "gtk+3.0"
sudo apt-get build-dep "gtk+3.0"
cd gtk+3.0-3.24.40
dpkg-buildpackage -rfakeroot -b -us -uc

失败原因:

make  check-local
make[6]: Entering directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb/win32/vs15'
make[6]: Leaving directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb/win32/vs15'
make[5]: Leaving directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb/win32/vs15'
Making check in vs16
make[5]: Entering directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb/win32/vs16'
make  check-local
make[6]: Entering directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb/win32/vs16'
make[6]: Leaving directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb/win32/vs16'
make[5]: Leaving directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb/win32/vs16'
make[5]: Entering directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb/win32'
make  check-local
make[6]: Entering directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb/win32'
make[6]: Leaving directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb/win32'
make[5]: Leaving directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb/win32'
make[4]: Leaving directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb/win32'
make[4]: Entering directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb'
make  check-local
make[5]: Entering directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb'
make[5]: Leaving directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb'
make[4]: Leaving directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb'
make[3]: *** [Makefile:749: check-recursive] Error 1
make[3]: Target 'check' not remade because of errors.
make[3]: Leaving directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30/debian/build/deb'
dh_auto_test: error: cd debian/build/deb && make -j4 check VERBOSE=1 -k check -j1 returned exit code 2
make[2]: *** [debian/rules:225: override_dh_auto_test] Error 2
make[2]: Leaving directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30'
make[1]: *** [debian/rules:133: binary] Error 2
make[1]: Leaving directory '/home/gaussian/owninstalls/sway-ubuntu/gtk/gtk+3.0-3.24.30'
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
make: *** [Makefile:204: firefox-friendly-gtk] Error 2

经过 10 多分钟的编译,这只是输出的结尾。有什么想法可能出错了吗?

答案1

正如@N0rbert 在下面指出的那样,目前尝试以普通用户身份构建 GTK+3.0 似乎行不通。根据评论和我的测试,至少有两种方法可以构建它:

  1. 在 Docker 容器中
  2. 在 LXC 容器中(我采用的方法)

相关内容