PKGBUILD 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. # Maintainer: André Silva <emulatorman@hyperbola.info>
  2. # Maintainer: Márcio Silva <coadde@hyperbola.info>
  3. # Maintainer: Luke R. <g4jc@hyperbola.info>
  4. # Based on gcc package
  5. _ctarget=i686-unknown-hyperbolabsd
  6. pkgname=$_ctarget-gcc
  7. pkgver=8.5.0
  8. _islver=0.24
  9. pkgrel=2
  10. pkgdesc="The GNU Compiler Collection - cross compiler for HyperbolaBSD i686 target"
  11. arch=('i686' 'x86_64')
  12. license=('GPL-3' 'LGPL-3' 'custom:GCC-Exception-3.1' 'FDL-1.3')
  13. url="https://gcc.gnu.org"
  14. groups=('cross-devel')
  15. depends=('libmpc')
  16. makedepends=('doxygen' 'libxcrypt')
  17. checkdepends=('dejagnu' 'net-tools')
  18. options=('!emptydirs' 'staticlibs')
  19. source=(https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz{,.sig}
  20. https://libisl.sourceforge.io/isl-${_islver}.tar.xz
  21. gcc-hyperbolabsd.patch
  22. COPYING.DOC)
  23. validpgpkeys=('D3A93CAD751C2AF4F8C7AD516C35B99309B5FA62') # Jakub Jelinek <jakub@redhat.com>
  24. sha512sums=('92f599680e6b7fbce88bcdda810f468777d541e5fddfbb287f7977d51093de2a5178bd0e6a08dfe37090ea10a0508a43ccd00220041abbbec33f1179bfc174d8'
  25. 'SKIP'
  26. 'ff6bdcff839e1cd473f2a0c1e4dd4a3612ec6fee4544ccbc62b530a7248db2cf93b4b99bf493a86ddf2aba00e768927265d5d411f92061ea85fd7929073428e8'
  27. '50bb6eba6ed0a7602cc52f96b7b9cc2d435393eba30a2103f2e1f68f170f2ecc8acae6dc42c7c0f6a3af70264f6a4a10783793c1826a7b292cd610d4f18acaab'
  28. 'bea1788b2bdc84f470e459114b871cf4ee991718964a63e18adde65116806d7676484cb30857cf74dece5eef5f96a015ee4a21900e019623e5d3484868b28b7f')
  29. _libdir="usr/lib/gcc/$_ctarget/$pkgver"
  30. prepare() {
  31. cd ${srcdir}/gcc-$pkgver
  32. # link isl for in-tree build
  33. ln -s ../isl-${_islver} isl
  34. # Do not run fixincludes
  35. sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
  36. # Hyperbola GNU/Linux-libre installs 64-bit libraries in /lib
  37. if [ $(uname -s) = Linux ]; then
  38. [ $CARCH = "x86_64" ] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
  39. fi
  40. # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
  41. sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
  42. # HyperbolaBSD patch
  43. patch -p1 -i ${srcdir}/gcc-hyperbolabsd.patch
  44. mkdir ${srcdir}/gcc-build
  45. }
  46. build() {
  47. cd ${srcdir}/gcc-build
  48. # using -pipe causes spurious test-suite failures
  49. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
  50. CFLAGS=${CFLAGS/-pipe/}
  51. CXXFLAGS=${CXXFLAGS/-pipe/}
  52. ${srcdir}/gcc-$pkgver/configure --prefix=/usr \
  53. --libdir=/usr/lib \
  54. --libexecdir=/usr/libexec \
  55. --mandir=/usr/share/man \
  56. --infodir=/usr/share/info \
  57. --with-bugurl=https://issues.hyperbola.info/ \
  58. --enable-languages=c,c++,lto \
  59. --enable-shared \
  60. --enable-threads=posix \
  61. --enable-libmpx \
  62. --with-system-zlib \
  63. --with-isl \
  64. --enable-__cxa_atexit \
  65. --disable-libunwind-exceptions \
  66. --enable-clocale=gnu \
  67. --disable-libstdcxx-pch \
  68. --disable-libssp \
  69. --enable-gnu-unique-object \
  70. --enable-linker-build-id \
  71. --enable-lto \
  72. --enable-plugin \
  73. --enable-install-libiberty \
  74. --with-linker-hash-style=gnu \
  75. --enable-gnu-indirect-function \
  76. --disable-multilib \
  77. --disable-werror \
  78. --enable-checking=release \
  79. --disable-nls \
  80. --target=$_ctarget
  81. make all-gcc
  82. }
  83. check() {
  84. cd ${srcdir}/gcc-build
  85. # increase stack size to prevent test failures
  86. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31827
  87. ulimit -s 32768
  88. # do not abort on error as some are "expected"
  89. make -k check || true
  90. ${srcdir}/gcc-$pkgver/contrib/test_summary
  91. }
  92. package() {
  93. cd ${srcdir}/gcc-build
  94. make -C gcc DESTDIR=${pkgdir} install-driver install-cpp install-gcc-ar \
  95. c++.install-common install-headers install-plugin install-lto-wrapper
  96. install -m755 gcc/gcov $pkgdir/usr/bin/$_ctarget-gcov
  97. install -m755 -t $pkgdir/${_libdir}/ gcc/{cc1,cc1plus,collect2,lto1}
  98. make DESTDIR=${pkgdir} install-fixincludes
  99. make -C gcc DESTDIR=${pkgdir} install-mkheaders
  100. make -C lto-plugin DESTDIR=${pkgdir} install
  101. make -C gcc DESTDIR=${pkgdir} install-man
  102. make -C libcpp DESTDIR=${pkgdir} install
  103. make -C gcc DESTDIR=${pkgdir} install-po
  104. # many packages expect this symlink
  105. ln -s $_ctarget-gcc ${pkgdir}/usr/bin/$_ctarget-cc
  106. # POSIX conformance launcher scripts for c89 and c99
  107. cat > $pkgdir/usr/bin/$_ctarget-c89 <<"EOF"
  108. #!/bin/sh
  109. fl="-std=c89"
  110. for opt; do
  111. case "$opt" in
  112. -ansi|-std=c89|-std=iso9899:1990) fl="";;
  113. -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2
  114. exit 1;;
  115. esac
  116. done
  117. exec gcc $fl ${1+"$@"}
  118. EOF
  119. sed -i "s|exec gcc|exec $_ctarget-gcc|" $pkgdir/usr/bin/$_ctarget-c89
  120. cat > $pkgdir/usr/bin/$_ctarget-c99 <<"EOF"
  121. #!/bin/sh
  122. fl="-std=c99"
  123. for opt; do
  124. case "$opt" in
  125. -std=c99|-std=iso9899:1999) fl="";;
  126. -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2
  127. exit 1;;
  128. esac
  129. done
  130. exec gcc $fl ${1+"$@"}
  131. EOF
  132. sed -i "s|exec gcc|exec $_ctarget-gcc|" $pkgdir/usr/bin/$_ctarget-c99
  133. chmod 755 $pkgdir/usr/bin/$_ctarget-c{8,9}9
  134. # Remove man documents that conflict with host version
  135. rm -rf ${pkgdir}/usr/share/man/man7
  136. # Remove unused dirs
  137. rmdir ${pkgdir}/usr/{include,share/info}
  138. # Add licenses
  139. install -m755 -d ${pkgdir}/usr/share/licenses/$_ctarget-gcc
  140. install -m644 ${srcdir}/gcc-$pkgver/COPYING{3{,.LIB},.RUNTIME} ${srcdir}/COPYING.DOC \
  141. ${pkgdir}/usr/share/licenses/$_ctarget-gcc
  142. }