libodbc++-0.2.5-r2.ebuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils flag-o-matic
  5. DESCRIPTION="Provides a subset of the well-known JDBC 2.0(tm) and runs on top of ODBC"
  6. SRC_URI="mirror://sourceforge/libodbcxx/${P}.tar.bz2"
  7. HOMEPAGE="http://libodbcxx.sourceforge.net/"
  8. LICENSE="LGPL-2.1"
  9. SLOT=0
  10. KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~x86"
  11. IUSE="static-libs"
  12. DEPEND="dev-db/unixODBC
  13. sys-libs/ncurses"
  14. RDEPEND="${DEPEND}"
  15. SB="${S}-build"
  16. SB_MT="${S}-build-mt"
  17. # QT3 is no longer supported in Gentoo.
  18. #SB_QT="${S}-build_qt"
  19. #SB_QT_MT="${S}-build_qt-mt"
  20. src_prepare() {
  21. #epatch "${FILESDIR}"/${PN}-0.2.3-std-streamsize.patch
  22. epatch "${FILESDIR}"/${PN}-0.2.3-doxygen.patch
  23. epatch "${FILESDIR}"/${PN}-0.2.3-gcc41.patch
  24. #epatch "${FILESDIR}"/${PN}-0.2.3-gcc43.patch
  25. #epatch "${FILESDIR}"/${PN}-0.2.3-typecast.patch
  26. epatch "${FILESDIR}"/${PN}-0.2.3-gcc44.patch
  27. # Fix configure to use ncurses instead of termcap (bug #103105)
  28. sed -i -e 's~termcap~ncurses~g' configure
  29. # Fix undeclared ODBCXX_STRING_PERCENT symbol, bug #532356
  30. sed -i -e 's/ODBCXX_STRING_PERCENT/"%"/' src/dtconv.h || die
  31. epatch_user
  32. }
  33. src_configure() {
  34. local commonconf buildlist
  35. commonconf="--with-odbc=/usr --without-tests"
  36. commonconf="${commonconf} $(use_enable static-libs static) --enable-shared"
  37. # " --enable-threads"
  38. export ECONF_SOURCE="${S}"
  39. append-flags -DODBCXX_DISABLE_READLINE_HACK
  40. buildlist="${SB} ${SB_MT}"
  41. #use qt3 && buildlist="${buildlist} $SB_QT $SB_QT_MT"
  42. for sd in ${buildlist}; do
  43. einfo "Doing configure pass for $sd"
  44. mkdir -p "${sd}"
  45. cd "${sd}"
  46. commonconf2=''
  47. LIBS=''
  48. [ "${sd}" == "${SB_MT}" -o "${sd}" == "${SB_QT_MT}" ] && commonconf2="${commonconf2} --enable-threads"
  49. [ "${sd}" == "${SB_QT}" -o "${sd}" == "${SB_QT_MT}" ] && commonconf2="${commonconf2} --with-qt"
  50. # isql++ tool fails to compile:
  51. #libodbc++-0.2.5/isql++/isql++.cpp: In constructor 'Isql::Isql(odbc::Connection*)':
  52. #libodbc++-0.2.5/isql++/isql++.cpp:275: error: invalid cast to function type 'char** ()()'
  53. #[ "${sd}" == "${SB}" ] && commonconf2="${commonconf2} --with-isqlxx"
  54. # Upstream configure is broken as well, passing --without or
  55. # --with-isqlxx=no will turn it ON instead of forcing it off.
  56. #commonconf2="${commonconf2} _-without-isqlxx"
  57. [ "${sd}" == "${SB_QT}" ] && commonconf2="${commonconf2} --with-qtsqlxx"
  58. export LIBS
  59. # using without-qt breaks the build
  60. #--without-qt \
  61. econf \
  62. ${commonconf} \
  63. ${commonconf2} \
  64. || die "econf failed"
  65. done
  66. }
  67. src_compile() {
  68. local buildlist failures
  69. buildlist="${SB} ${SB_MT}"
  70. #use qt3 && buildlist="${buildlist} $SB_QT $SB_QT_MT"
  71. for sd in ${buildlist}; do
  72. einfo "Doing compile pass for $sd"
  73. cd "${sd}"
  74. emake LIBS='' || failures="${failures} ${sd//${S}-}"
  75. done
  76. [ -n "${failures}" ] && die "Failures: ${failures}"
  77. }
  78. src_install () {
  79. dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
  80. buildlist="${SB} ${SB_MT}"
  81. #use qt3 && buildlist="${buildlist} $SB_QT $SB_QT_MT"
  82. for sd in ${buildlist}; do
  83. einfo "Doing install pass for $sd"
  84. cd ${sd}
  85. emake DESTDIR="${D}" install
  86. done
  87. if [[ "${P}" != "${PF}" ]]; then
  88. mv "${D}"/usr/share/doc/${P}/* "${D}"/usr/share/doc/${PF}/
  89. rmdir "${D}"/usr/share/doc/${P}
  90. fi
  91. }