template.py 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. _trip = "arm-none-eabi"
  2. pkgname = f"gcc-{_trip}"
  3. pkgver = "12.2.0"
  4. pkgrel = 0
  5. build_style = "gnu_configure"
  6. configure_args = [
  7. f"--target={_trip}",
  8. f"--with-sysroot=/usr/{_trip}",
  9. "--prefix=/usr",
  10. "--sbindir=/usr/bin",
  11. "--libdir=/usr/lib",
  12. "--mandir=/usr/share/man",
  13. "--infodir=/usr/share/info",
  14. "--disable-nls",
  15. "--disable-decimal-float",
  16. "--disable-libffi",
  17. "--disable-libgomp",
  18. "--disable-libmudflap",
  19. "--disable-libquadmath",
  20. "--disable-libssp",
  21. "--disable-libstdcxx-pch",
  22. "--disable-libstdc__-v3",
  23. "--disable-shared",
  24. "--disable-threads",
  25. "--disable-gcov",
  26. "--disable-tls",
  27. "--disable-werror",
  28. "--disable-tm-clone-registry",
  29. "--enable-__cxa_atexit",
  30. "--enable-c99",
  31. "--enable-gnu-indirect-function",
  32. "--enable-interwork",
  33. "--enable-languages=c,c++",
  34. "--enable-long-long",
  35. "--enable-multilib",
  36. "--enable-plugins",
  37. "--with-gmp",
  38. "--with-gnu-as",
  39. "--with-gnu-ld",
  40. "--with-libelf",
  41. "--with-mpc",
  42. "--with-mpfr",
  43. "--with-multilib-list=rmprofile",
  44. "--with-native-system-header-dir=/include",
  45. "--with-newlib",
  46. "--with-system-zlib",
  47. f"--with-python-dir=share/gcc-{_trip}",
  48. f"--with-headers=/usr/{_trip}/include",
  49. ]
  50. make_cmd = "gmake"
  51. hostmakedepends = [
  52. "gmake", f"binutils-{_trip}", "bison", "flex", "perl", "texinfo"
  53. ]
  54. makedepends = ["zlib-devel", "gmp-devel", "mpfr-devel", "mpc-devel"]
  55. depends = [f"binutils-{_trip}"]
  56. pkgdesc = "GNU C compiler for ARM bare metal targets"
  57. maintainer = "q66 <q66@chimera-linux.org>"
  58. license = "GPL-3.0-or-later"
  59. url = "https://gcc.gnu.org"
  60. source = f"$(GNU_SITE)/gcc/gcc-{pkgver}/gcc-{pkgver}.tar.xz"
  61. sha256 = "e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff"
  62. env = {
  63. "CFLAGS_FOR_TARGET": "-g -Os -ffunction-sections -fdata-sections",
  64. "CXXFLAGS_FOR_TARGET": "-g -Os -ffunction-sections -fdata-sections",
  65. }
  66. nostrip_files = ["libgcc.a"]
  67. hardening = ["!pie"]
  68. # no tests to run
  69. options = ["!check", "!lto", "!cross", "!scanshlibs"]
  70. exec_wrappers = [
  71. ("/usr/bin/llvm-objdump", "objdump"),
  72. ("/usr/bin/llvm-readelf", "readelf"),
  73. ]
  74. def post_install(self):
  75. self.rm(self.destdir / "usr/share/info", recursive = True)
  76. self.rm(self.destdir / "usr/share/man/man7", recursive = True)
  77. for f in (self.destdir / "usr/lib").glob("libcc1.*"):
  78. f.unlink()
  79. # hardlinks
  80. self.rm(self.destdir / f"usr/bin/{_trip}-gcc")
  81. self.rm(self.destdir / f"usr/bin/{_trip}-c++")
  82. self.install_link(f"{_trip}-gcc-{pkgver}", f"usr/bin/{_trip}-gcc")
  83. self.install_link(f"{_trip}-g++", f"usr/bin/{_trip}-c++")