gnatcoll-2016.ebuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit multilib multiprocessing autotools
  5. MYP=${PN}-gpl-${PV}
  6. DESCRIPTION="GNAT Component Collection"
  7. HOMEPAGE="http://libre.adacore.com"
  8. SRC_URI="http://mirrors.cdn.adacore.com/art/5739942ac7a447658d00e1e7 -> ${MYP}-src.tar.gz"
  9. LICENSE="GPL-3"
  10. SLOT="0"
  11. KEYWORDS="~amd64"
  12. IUSE="gmp iconv postgresql projects pygobject python readline +shared sqlite static syslog"
  13. RDEPEND="dev-lang/gnat-gpl
  14. gmp? ( dev-libs/gmp:* )
  15. postgresql? ( dev-db/postgresql:* )
  16. pygobject? (
  17. || (
  18. dev-python/pygobject:2
  19. dev-python/pygobject:3
  20. )
  21. )
  22. python? ( dev-lang/python:2.7 )
  23. sqlite? ( dev-db/sqlite )
  24. projects? (
  25. dev-ada/gprbuild[static?]
  26. dev-ada/gprbuild[shared?]
  27. )"
  28. DEPEND="${RDEPEND}
  29. dev-ada/gprbuild"
  30. S="${WORKDIR}"/${MYP}-src
  31. PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )
  32. pkg_setup() {
  33. GCC=${ADA:-$(tc-getCC)}
  34. GNATMAKE="${GCC/gcc/gnatmake}"
  35. GNATCHOP="${GCC/gcc/gnatchop}"
  36. if [[ -z "$(type ${GNATMAKE} 2>/dev/null)" ]] ; then
  37. eerror "You need a gcc compiler that provides the Ada Compiler:"
  38. eerror "1) use gcc-config to select the right compiler or"
  39. eerror "2) set ADA=gcc-4.9.4 in make.conf"
  40. die "ada compiler not available"
  41. fi
  42. }
  43. src_prepare() {
  44. default
  45. eautoreconf
  46. }
  47. src_configure() {
  48. local myConf=""
  49. if use sqlite; then
  50. myConf="$myConf --with-sqlite=$(get_libdir)"
  51. else
  52. myConf="$myConf --without-sqlite"
  53. fi
  54. econf \
  55. GNATCHOP="${GNATCHOP}" \
  56. GNATMAKE="${GNATMAKE}" \
  57. $(use_with gmp) \
  58. $(use_with iconv) \
  59. $(use_with postgresql) \
  60. $(use_enable projects) \
  61. $(use_enable pygobject) \
  62. $(use_with python) \
  63. $(use_enable readline gpl) \
  64. $(use_enable readline) \
  65. $(use_enable syslog) \
  66. --with-python-exec=python2 \
  67. --enable-shared-python \
  68. --without-gtk \
  69. --disable-pygtk \
  70. $myConf
  71. }
  72. src_compile() {
  73. if use shared; then
  74. emake PROCESSORS=$(makeopts_jobs) build_library_type/relocatable
  75. fi
  76. if use static; then
  77. emake PROCESSORS=$(makeopts_jobs) build_library_type/static
  78. fi
  79. }
  80. src_install() {
  81. if use shared; then
  82. emake DESTDIR="${D}" install_library_type/relocatable
  83. fi
  84. if use static; then
  85. emake DESTDIR="${D}" install_library_type/static
  86. fi
  87. emake DESTDIR="${D}" install_gps_plugin
  88. einstalldocs
  89. dodoc -r features-* known-problems-* examples
  90. mv "${D}"/usr/share/doc/${PN}/GNATColl.pdf "${D}"/usr/share/doc/${PF}/
  91. mv "${D}"/usr/share/doc/${PN}/html/html "${D}"/usr/share/doc/${PF}/
  92. }
  93. src_test() {
  94. true
  95. }