xfsprogs-4.10.0.ebuild 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils toolchain-funcs multilib
  5. DESCRIPTION="xfs filesystem utilities"
  6. HOMEPAGE="http://oss.sgi.com/projects/xfs/"
  7. SRC_URI="ftp://ftp.kernel.org/pub/linux/utils/fs/xfs/${PN}/${P}.tar.xz"
  8. LICENSE="LGPL-2.1"
  9. SLOT="0"
  10. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
  11. IUSE="libedit nls readline static static-libs"
  12. REQUIRED_USE="static? ( static-libs )"
  13. LIB_DEPEND=">=sys-apps/util-linux-2.17.2[static-libs(+)]
  14. readline? ( sys-libs/readline:0=[static-libs(+)] )
  15. !readline? ( libedit? ( dev-libs/libedit[static-libs(+)] ) )"
  16. RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
  17. !<sys-fs/xfsdump-3"
  18. DEPEND="${RDEPEND}
  19. static? (
  20. ${LIB_DEPEND}
  21. readline? ( sys-libs/ncurses:0=[static-libs] )
  22. )
  23. nls? ( sys-devel/gettext )"
  24. PATCHES=(
  25. "${FILESDIR}"/${PN}-4.7.0-sharedlibs.patch
  26. "${FILESDIR}"/${PN}-4.7.0-libxcmd-link.patch
  27. "${FILESDIR}"/${PN}-4.9.0-underlinking.patch
  28. )
  29. pkg_setup() {
  30. if use readline && use libedit ; then
  31. ewarn "You have USE='readline libedit' but these are exclusive."
  32. ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
  33. fi
  34. }
  35. src_prepare() {
  36. epatch "${PATCHES[@]}"
  37. # LLDFLAGS is used for programs, so apply -all-static when USE=static is enabled.
  38. # Clear out -static from all flags since we want to link against dynamic xfs libs.
  39. sed -i \
  40. -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
  41. -e "1iLLDFLAGS += $(usex static '-all-static' '')" \
  42. include/builddefs.in || die
  43. find -name Makefile -exec \
  44. sed -i -r -e '/^LLDFLAGS [+]?= -static(-libtool-libs)?$/d' {} +
  45. # TODO: Write a patch for configure.ac to use pkg-config for the uuid-part.
  46. if use static && use readline ; then
  47. sed -i \
  48. -e 's|-lreadline|& -lncurses|' \
  49. -e 's|-lblkid|& -luuid|' \
  50. configure || die
  51. fi
  52. }
  53. src_configure() {
  54. export DEBUG=-DNDEBUG
  55. export OPTIMIZER=${CFLAGS}
  56. unset PLATFORM # if set in user env, this breaks configure
  57. local myconf
  58. if use static || use static-libs ; then
  59. myconf+=" --enable-static"
  60. else
  61. myconf+=" --disable-static"
  62. fi
  63. econf \
  64. $(use_enable nls gettext) \
  65. $(use_enable readline) \
  66. $(usex readline --disable-editline $(use_enable libedit editline)) \
  67. ${myconf}
  68. MAKEOPTS+=" V=1"
  69. }
  70. src_install() {
  71. emake DIST_ROOT="${ED}" install
  72. # parallel install fails on this target for >=xfsprogs-3.2.0
  73. emake -j1 DIST_ROOT="${ED}" install-dev
  74. # handle is for xfsdump, the rest for xfsprogs
  75. gen_usr_ldscript -a handle xcmd xfs xlog
  76. # removing unnecessary .la files if not needed
  77. use static-libs || find "${ED}" -name '*.la' -delete
  78. }