将 GNAT 固定为 Ubuntu 5.10 版本

将 GNAT 固定为 Ubuntu 5.10 版本

我正在运行 Ubuntu 11.10。我正在安装 GNAT,但我想要 GNAT 3.40(Ubuntu 5.10 附带),而不是最新版本。是否可以在 Ubuntu 11.10 机器上获取 GNAT 3.40?

我想到了这个解决方案:

/etc/apt/preferences.d/gnat

Package: gnat
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: gcc
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: libc6
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: libc6-dev
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: libgcc1
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: libgnat
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: libgnatprj4.1
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: libgnatvsn4.1
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

或者这是不可能的?也许这些版本太旧,与 Ubuntu 11.10 不兼容?或者变化太大?

答案1

请说明您的 arch。我会尝试在您当前的 Ubuntu 上重建 gnat 源包。基于快速的 Google,并查看例如https://launchpad.net/ubuntu/+source/gcc-3.4/3.4.3-9ubuntu4.1看起来好像可以,但是你不试一下就不会知道。该页面上的 dsc 文件包含:

Source: gcc-3.4
Version: 3.4.3-9ubuntu4.1
Binary: gnat-3.4-doc, lib64gcc1, lib64gcj5, libstdc++6-dbg, libgcj5-awt, lib32stdc++6-0, libgcc1, gcc-3.4-doc, libg2c0, g++-3.4, libstdc++6-0-dev, fastjar, lib32gcc1, libffi3-dev, libobjc1, libstdc++6-doc, g77-3.4-doc, libstdc++6, libg2c0-dev, libstdc++6-pic, libstdc++6-dev, cpp-3.4-doc, libgcj5-dev, gcc-3.4, libgcc2, fixincludes, lib64g2c0, gnat-3.4, gcj-3.4, lib64ffi3, g77-3.4, libgcj5, libffi3, gcc-3.4-hppa64, gpc-2.1-3.4-doc, libstdc++6-0-pic, lib64objc1, libgnat-3.4, lib32stdc++6, lib64gcj5-awt, lib64stdc++6, libgcj-common, gcc-3.4-nof, libstdc++6-0, gij-3.4, gobjc-3.4, treelang-3.4, gpc-2.1-3.4, cpp-3.4, libgcj5-common, gcc-3.4-base, libstdc++6-0-dbg, lib64gnat-3.4, gcc-3.4-soft-float, protoize
Maintainer: Debian GCC maintainers <[email protected]>
Architecture: any
Standards-Version: 3.6.1
Build-Depends: libc6.1-dev (>= 2.3.2.ds1-16) [alpha ia64] | libc0.3-dev (>= 2.3.2.ds1-16) | libc0.1-dev (>= 2.3.2.ds1-16) | libc12-dev (>= 2.3.2.ds1-16) | libc6-dev (>= 2.3.2.ds1-16), libc6-dev-sparc64 [sparc], libc6-dev-s390x [s390], amd64-libs-dev [i386], ia32-libs-dev [amd64], libunwind7-dev (>= 0.98.3-3ubuntu1) [ia64], libatomic-ops-dev [ia64], m4, autoconf2.13, autoconf, automake1.4, automake1.7, libtool, autotools-dev, gawk, dejagnu (>= 1.4.3) [!hurd-i386 !kfreebsd-gnu !knetbsd-gnu], expect (>= 5.38.0) [!hurd-i386 !kfreebsd-gnu !knetbsd-gnu], bzip2, binutils (>= 2.15-5) | binutils-multiarch (>= 2.15-5), binutils-hppa64 [hppa], debhelper (>= 4.1), gperf (>= 2.7-3), bison (>= 1:1.875a-1) | bison (<< 1:1.50), flex, gettext, texinfo (>= 4.3), zlib1g-dev, libgc-dev [!avr !kfreebsd-gnu !knetbsd-gnu], xlibs-dev, gnat-3.3 [!arm !m68k !m32r !hurd-i386 !kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu] | gnat-3.4 [!arm !m68k !m32r !hurd-i386 !kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu] | gnat [i386 powerpc sparc], libncurses5-dev [!netbsd-elf-gnu], libgmp3-dev, tetex-bin [!netbsd-elf-gnu], locales [!kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu !hurd-i386], procps [!hurd-i386 !kfreebsd-gnu !knetbsd-gnu], help2man [!netbsd-elf-gnu], sharutils, libgtk2.0-dev (>= 2.4.4-2) [!mips !mipsel !m32r !hurd-i386 !kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu], libart-2.0-dev [!mips !mipsel !m32r !hurd-i386 !kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu], g++-3.3 [!amd64], g77-3.3 [!amd64], gobjc-3.3 [!amd64], realpath (>= 1.9.12)
Build-Depends-Indep: doxygen (>= 1.3.9.1), graphviz (>= 2.0)

您需要先安装所有构建依赖项,然后debuild binary或类似。这看起来令人生畏,但请注意,大多数依赖项都是>=,这意味着较新的版本应该可以工作。还要注意,这|意味着或。

如果无法安装所有构建依赖项,您可以尝试删除无法从 获得的依赖项debian/control,然后继续构建。 gcc 构建过程设计得相当稳健,如果失败,它会告诉您缺少什么。 对于g++-3.3g77-3.3gobjc-3.3请尝试使用当前版本并希望获得最佳效果。 也可以精简构建过程,以便仅构建 gnat 所需的内容,但这要复杂得多,所以我不建议您这样做。

相关内容