elektra-9999.ebuild 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit cmake-multilib eutils java-pkg-opt-2 git-r3
  5. DESCRIPTION="Framework to store config parameters in hierarchical key-value pairs"
  6. HOMEPAGE="https://freedesktop.org/wiki/Software/Elektra"
  7. EGIT_REPO_URI="git://github.com/ElektraInitiative/libelektra.git"
  8. LICENSE="BSD"
  9. SLOT="0/${PV}"
  10. KEYWORDS=""
  11. PLUGIN_IUSE="augeas iconv ini java simpleini syslog systemd tcl +uname xml yajl";
  12. IUSE="dbus doc qt5 static-libs test ${PLUGIN_IUSE}"
  13. RDEPEND="dev-libs/libltdl:0[${MULTILIB_USEDEP}]
  14. >=dev-libs/libxml2-2.9.1-r4[${MULTILIB_USEDEP}]
  15. augeas? ( app-admin/augeas )
  16. dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
  17. iconv? ( >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}] )
  18. java? ( >=virtual/jdk-1.8.0 )
  19. qt5? (
  20. dev-qt/qtdeclarative:5
  21. dev-qt/qtgui:5
  22. dev-qt/qttest:5
  23. dev-qt/qtwidgets:5
  24. )
  25. uname? ( sys-apps/coreutils )
  26. systemd? ( sys-apps/systemd[${MULTILIB_USEDEP}] )
  27. yajl? ( >=dev-libs/yajl-1.0.11-r1[${MULTILIB_USEDEP}] )"
  28. DEPEND="${RDEPEND}
  29. doc? ( app-doc/doxygen )
  30. test? ( >=dev-cpp/gtest-1.7.0 )"
  31. DOCS=( README.md doc/AUTHORS doc/CODING.md doc/NEWS.md doc/todo/TODO )
  32. # tries to write to user's home directory (and doesn't respect HOME)
  33. RESTRICT="test"
  34. MULTILIB_WRAPPED_HEADERS=( /usr/include/elektra/kdbconfig.h )
  35. PATCHES=( "${FILESDIR}/${PN}"-0.8.15-conditional-glob-tests.patch )
  36. src_prepare() {
  37. cmake-utils_src_prepare
  38. einfo remove bundled libs
  39. # TODO: Remove bundled inih from src/plugins/ini (add to portage):
  40. # https://code.google.com/p/inih/
  41. rm -rf src/external || die
  42. # move doc files to correct location
  43. sed -e "s/elektra-api/${PF}/" \
  44. -i cmake/ElektraCache.cmake || die
  45. # avoid useless build time, nothing ends up installed
  46. cmake_comment_add_subdirectory benchmarks
  47. cmake_comment_add_subdirectory examples
  48. }
  49. multilib_src_configure() {
  50. local my_plugins="ALL"
  51. if multilib_is_native_abi ; then
  52. use augeas || my_plugins+=";-augeas"
  53. use java || my_plugins+=";-jni"
  54. else
  55. my_plugins+=";-augeas;-jni"
  56. fi
  57. use dbus || my_plugins+=";-dbus"
  58. use iconv || my_plugins+=";-iconv"
  59. use ini || my_plugins+=";-ini" # bundles inih
  60. use simpleini || my_plugins+=";-simpleini"
  61. use syslog || my_plugins+=";-syslog"
  62. use systemd || my_plugins+=";-journald"
  63. use tcl || my_plugins+=";-tcl"
  64. use uname || my_plugins+=";-uname"
  65. use xml || my_plugins+=";-xmltool"
  66. use yajl || my_plugins+=";-yajl"
  67. # Disabling for good (?):
  68. # counter - Only useful for debugging the plugin framework
  69. # doc - Explaining basic makeup of a function //bug #514402
  70. # noresolver - Does not resolve, but can act as one
  71. # template - Template for new plugin written in C
  72. # wresolver - Resolver for non-POSIX, e.g. w32/w64 systems
  73. my_plugins+=";-counter;-doc;-noresolver;-template;-wresolver"
  74. local my_tools
  75. if multilib_is_native_abi ; then
  76. my_tools="kdb"
  77. use qt5 && my_tools+=";qt-gui"
  78. fi
  79. local mycmakeargs=(
  80. -DBUILD_PDF=OFF
  81. -DBUILD_SHARED=ON
  82. -DBUILD_STATIC=$(usex static-libs)
  83. -DBUILD_TESTING=$(usex test)
  84. -DENABLE_TESTING=$(usex test)
  85. -DPLUGINS=${my_plugins}
  86. -DTOOLS=${my_tools}
  87. -DBUILD_DOCUMENTATION=$(multilib_is_native_abi && usex doc || echo no)
  88. -DTARGET_CMAKE_FOLDER=share/cmake/Modules
  89. )
  90. cmake-utils_src_configure
  91. }
  92. multilib_src_install_all() {
  93. einfo remove test_data
  94. rm -rvf "${ED%/}/usr/share/${PN}" || die "Failed to remove test_data"
  95. einfo remove tool_exec
  96. rm -rvf "${ED%/}/usr/$(get_libdir)/${PN}/tool_exec" || die "Failed to remove tool_exec"
  97. }