xfsprogs-4.5.0.ebuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Copyright 1999-2016 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://oss.sgi.com/projects/xfs/cmd_tars/${P}.tar.gz
  8. ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/${P}.tar.gz"
  9. LICENSE="LGPL-2.1"
  10. SLOT="0"
  11. KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
  12. IUSE="libedit nls readline static static-libs"
  13. REQUIRED_USE="static? ( static-libs )"
  14. LIB_DEPEND=">=sys-apps/util-linux-2.17.2[static-libs(+)]
  15. readline? ( sys-libs/readline:0=[static-libs(+)] )
  16. !readline? ( libedit? ( dev-libs/libedit[static-libs(+)] ) )"
  17. RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
  18. !<sys-fs/xfsdump-3"
  19. DEPEND="${RDEPEND}
  20. static? (
  21. ${LIB_DEPEND}
  22. readline? ( sys-libs/ncurses:0=[static-libs] )
  23. )
  24. nls? ( sys-devel/gettext )"
  25. PATCHES=(
  26. "${FILESDIR}"/${PN}-4.3.0-sharedlibs.patch
  27. "${FILESDIR}"/${PN}-4.5.0-linguas.patch
  28. "${FILESDIR}"/${PN}-4.3.0-cross-compile.patch
  29. )
  30. pkg_setup() {
  31. if use readline && use libedit ; then
  32. ewarn "You have USE='readline libedit' but these are exclusive."
  33. ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
  34. fi
  35. }
  36. src_prepare() {
  37. epatch "${PATCHES[@]}"
  38. # LLDFLAGS is used for programs, so apply -all-static when USE=static is enabled.
  39. # Clear out -static from all flags since we want to link against dynamic xfs libs.
  40. sed -i \
  41. -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
  42. -e "1iLLDFLAGS += $(usex static '-all-static' '')" \
  43. include/builddefs.in || die
  44. find -name Makefile -exec \
  45. sed -i -r -e '/^LLDFLAGS [+]?= -static(-libtool-libs)?$/d' {} +
  46. # libdisk has broken blkid conditional checking
  47. sed -i \
  48. -e '/LIB_SUBDIRS/s:libdisk::' \
  49. Makefile || die
  50. # TODO: write a patch for configure.in to use pkg-config for the uuid-part
  51. if use static && use readline ; then
  52. sed -i \
  53. -e 's|-lreadline|\0 -lncurses|' \
  54. -e 's|-lblkid|\0 -luuid|' \
  55. configure || die
  56. fi
  57. }
  58. src_configure() {
  59. export DEBUG=-DNDEBUG
  60. export OPTIMIZER=${CFLAGS}
  61. unset PLATFORM # if set in user env, this breaks configure
  62. local myconf
  63. if use static || use static-libs ; then
  64. myconf+=" --enable-static"
  65. else
  66. myconf+=" --disable-static"
  67. fi
  68. econf \
  69. --bindir=/usr/bin \
  70. --libexecdir=/usr/$(get_libdir) \
  71. $(use_enable nls gettext) \
  72. $(use_enable readline) \
  73. $(usex readline --disable-editline $(use_enable libedit editline)) \
  74. ${myconf}
  75. MAKEOPTS+=" V=1"
  76. }
  77. src_install() {
  78. emake DIST_ROOT="${ED}" install
  79. # parallel install fails on this target for >=xfsprogs-3.2.0
  80. emake -j1 DIST_ROOT="${ED}" install-dev
  81. # handle is for xfsdump, the rest for xfsprogs
  82. gen_usr_ldscript -a xfs xlog
  83. # removing unnecessary .la files if not needed
  84. use static-libs || find "${ED}" -name '*.la' -delete
  85. }