dev86-0.16.21-r2.ebuild 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit toolchain-funcs
  5. DESCRIPTION="Bruce's C compiler - Simple C compiler to generate 8086 code"
  6. HOMEPAGE="http://v3.sk/~lkundrak/dev86/"
  7. SRC_URI="http://v3.sk/~lkundrak/dev86/Dev86src-${PV}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
  11. IUSE=""
  12. RDEPEND="sys-devel/bin86"
  13. DEPEND="${RDEPEND}
  14. dev-util/gperf"
  15. STRIP_MASK="/usr/*/bcc/lib*.a /usr/*/i386/libc.a"
  16. PATCHES=(
  17. "${FILESDIR}/${PN}-pic.patch"
  18. "${FILESDIR}/${PN}-0.16.19-fortify.patch"
  19. "${FILESDIR}/${P}-non-void-return-clang.patch"
  20. )
  21. src_prepare() {
  22. default
  23. # elksemu doesn't compile under amd64
  24. if use amd64; then
  25. einfo "Not compiling elksemu on amd64"
  26. sed -i \
  27. -e 's,alt-libs elksemu,alt-libs,' \
  28. -e 's,install-lib install-emu,install-lib,' \
  29. makefile.in || die
  30. fi
  31. sed -i -e "s:-O2 -g:${CFLAGS}:" -e '/INEXE=/s:-s::' makefile.in || die
  32. sed -i -e "s:/lib/:/$(get_libdir)/:" bcc/bcc.c || die
  33. sed -i -e '/INSTALL_OPTS=/s:-s::' bin86/Makefile || die
  34. sed -i -e '/install -m 755 -s/s:-s::' dis88/Makefile || die
  35. }
  36. src_compile() {
  37. # Don't mess with CPPFLAGS as they tend to break compilation
  38. # (bug #343655).
  39. unset CPPFLAGS
  40. # First `make` is also a config, so set all the path vars here
  41. emake -j1 \
  42. DIST="${D}" \
  43. CC="$(tc-getCC)" \
  44. LIBDIR="/usr/$(get_libdir)/bcc" \
  45. INCLDIR="/usr/$(get_libdir)/bcc"
  46. export PATH=${S}/bin:${PATH}
  47. cd bin || die
  48. ln -s ncc bcc || die
  49. cd .. || die
  50. cd bootblocks || die
  51. emake DIST="${D}"
  52. }
  53. src_install() {
  54. emake -j1 install-all DIST="${D}"
  55. dobin bootblocks/makeboot
  56. # remove all the stuff supplied by bin86
  57. rm "${D}"/usr/bin/{as,ld,nm,objdump,size}86 || die
  58. rm "${D}"/usr/man/man1/{as,ld}86.1 || die
  59. dodir /usr/share
  60. mv "${D}"/usr/{man,share/man} || die
  61. }