从 Buster 构建 Debian 软件包在 Bookworm 上失败

从 Buster 构建 Debian 软件包在 Bookworm 上失败

我需要linphone在 Debian 12 上使用旧版本。

bookworm中的版本是4.4.10-3,我实际上需要3.12.0,它可以在Buster中找到。

在我的书虫构建机器上,我更改了源代码,并linphone-3.12.0从巴斯特下载了源代码。然后我将源切换回 bookworm,并安装了所有必要的依赖项。

更新更多详细信息

我取得了一些进展,现在我在编译过程中取得了更大的进展。然而,它最终失败了:

make[3]: Leaving directory '/mnt/src/deb/LINPHONE/linphone-3.12.0/obj-x86_64-linux-gnu'
[ 66%] Built target linphone-static
make[2]: Leaving directory '/mnt/src/deb/LINPHONE/linphone-3.12.0/obj-x86_64-linux-gnu'
make[1]: *** [Makefile:159: all] Error 2
make[1]: Leaving directory '/mnt/src/deb/LINPHONE/linphone-3.12.0/obj-x86_64-linux-gnu'
dh_auto_build: error: cd obj-x86_64-linux-gnu && make -j4 "INSTALL=install --strip-program=true" VERBOSE=1 returned exit code 2
make: *** [debian/rules:15: binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2

完整的构建输出这里和 debian/规则这里

答案1

构建失败的原因是

Traceback (most recent call last):
  File "/mnt/src/deb/LINPHONE/linphone-3.12.0/wrappers/cpp/genwrapper.py", line 764, in <module>
    main()
  File "/mnt/src/deb/LINPHONE/linphone-3.12.0/wrappers/cpp/genwrapper.py", line 760, in main
    genwrapper.render_all()
  File "/mnt/src/deb/LINPHONE/linphone-3.12.0/wrappers/cpp/genwrapper.py", line 700, in render_all
    self.render(header, self.includedir + '/enums.hh')
  File "/mnt/src/deb/LINPHONE/linphone-3.12.0/wrappers/cpp/genwrapper.py", line 716, in render
    with open(tmppath, mode='rU') as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid mode: 'rU'

Python 3 不再有“U”模式open()。要解决此问题,请添加debian/patches/genwrapper.patch包含

Index: linphone-3.12.0/wrappers/cpp/genwrapper.py
===================================================================
--- linphone-3.12.0.orig/wrappers/cpp/genwrapper.py
+++ linphone-3.12.0/wrappers/cpp/genwrapper.py
@@ -713,7 +713,7 @@ class GenWrapper(object):
                content = ''
                with open(tmppath, mode='w') as f:
                        f.write(self.renderer.render(item))
-               with open(tmppath, mode='rU') as f:
+               with open(tmppath, mode='r') as f:
                        content = f.read()
                with open(path, mode='w') as f:
                        f.write(content)

并将其添加到debian/patches/series

$ echo genwrapper.patch >> debian/patches/series

相关内容