elektra-0.8.16.ebuild 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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
  5. DESCRIPTION="Framework to store config parameters in hierarchical key-value pairs"
  6. HOMEPAGE="https://freedesktop.org/wiki/Software/Elektra"
  7. SRC_URI="ftp://ftp.markus-raab.org/${PN}/releases/${P}.tar.gz"
  8. LICENSE="BSD"
  9. SLOT="0/${PV}"
  10. KEYWORDS="~amd64 ~x86"
  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=(
  36. "${FILESDIR}/${PN}"-0.8.15-conditional-glob-tests.patch
  37. "${FILESDIR}/${PN}"-0.8.15-gcc-5.4.0.patch
  38. )
  39. src_prepare() {
  40. cmake-utils_src_prepare
  41. einfo remove bundled libs
  42. # TODO: Remove bundled inih from src/plugins/ini (add to portage):
  43. # https://code.google.com/p/inih/
  44. rm -rf src/external || die
  45. # move doc files to correct location
  46. sed -e "s/elektra-api/${PF}/" \
  47. -i cmake/ElektraCache.cmake || die
  48. # avoid useless build time, nothing ends up installed
  49. cmake_comment_add_subdirectory benchmarks
  50. cmake_comment_add_subdirectory examples
  51. }
  52. multilib_src_configure() {
  53. local my_plugins="ALL"
  54. if multilib_is_native_abi ; then
  55. use augeas || my_plugins+=";-augeas"
  56. use java || my_plugins+=";-jni"
  57. else
  58. my_plugins+=";-augeas;-jni"
  59. fi
  60. use dbus || my_plugins+=";-dbus"
  61. use iconv || my_plugins+=";-iconv"
  62. use ini || my_plugins+=";-ini" # bundles inih
  63. use simpleini || my_plugins+=";-simpleini"
  64. use syslog || my_plugins+=";-syslog"
  65. use systemd || my_plugins+=";-journald"
  66. use tcl || my_plugins+=";-tcl"
  67. use uname || my_plugins+=";-uname"
  68. use xml || my_plugins+=";-xmltool"
  69. use yajl || my_plugins+=";-yajl"
  70. # Disabling for good (?):
  71. # counter - Only useful for debugging the plugin framework
  72. # doc - Explaining basic makeup of a function //bug #514402
  73. # noresolver - Does not resolve, but can act as one
  74. # template - Template for new plugin written in C
  75. # wresolver - Resolver for non-POSIX, e.g. w32/w64 systems
  76. my_plugins+=";-counter;-doc;-noresolver;-template;-wresolver"
  77. local my_tools
  78. if multilib_is_native_abi ; then
  79. my_tools="kdb"
  80. use qt5 && my_tools+=";qt-gui"
  81. fi
  82. local mycmakeargs=(
  83. -DBUILD_PDF=OFF
  84. -DBUILD_SHARED=ON
  85. -DBUILD_STATIC=$(usex static-libs)
  86. -DBUILD_TESTING=$(usex test)
  87. -DENABLE_TESTING=$(usex test)
  88. -DPLUGINS=${my_plugins}
  89. -DTOOLS=${my_tools}
  90. -DBUILD_DOCUMENTATION=$(multilib_is_native_abi && usex doc || echo no)
  91. -DTARGET_CMAKE_FOLDER=share/cmake/Modules
  92. )
  93. cmake-utils_src_configure
  94. }
  95. multilib_src_install_all() {
  96. einfo remove test_data
  97. rm -rvf "${ED%/}/usr/share/${PN}" || die "Failed to remove test_data"
  98. einfo remove tool_exec
  99. rm -rvf "${ED%/}/usr/$(get_libdir)/${PN}/tool_exec" || die "Failed to remove tool_exec"
  100. }