logo

overlay

My (experimental) gentoo overlay

libarchive-3.3.3.ebuild (3495B)


      1 # Copyright 1999-2018 Gentoo Foundation
      2 # Distributed under the terms of the GNU General Public License v2
      3 
      4 EAPI=7
      5 inherit libtool multilib-minimal toolchain-funcs
      6 
      7 DESCRIPTION="BSD tar command"
      8 HOMEPAGE="http://www.libarchive.org/"
      9 SRC_URI="http://www.libarchive.org/downloads/${P}.tar.gz"
     10 
     11 LICENSE="BSD BSD-2 BSD-4 public-domain"
     12 SLOT="0/13"
     13 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
     14 IUSE="acl +bzip2 +e2fsprogs expat +iconv kernel_linux libressl lz4 +lzma lzo nettle static-libs +threads xattr +zlib"
     15 
     16 RDEPEND="
     17 	acl? ( virtual/acl[${MULTILIB_USEDEP}] )
     18 	bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] )
     19 	expat? ( dev-libs/expat[${MULTILIB_USEDEP}] )
     20 	!expat? ( dev-libs/libxml2[${MULTILIB_USEDEP}] )
     21 	iconv? ( virtual/libiconv[${MULTILIB_USEDEP}] )
     22 	kernel_linux? (
     23 		xattr? ( sys-apps/attr[${MULTILIB_USEDEP}] )
     24 	)
     25 	!libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
     26 	libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
     27 	lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
     28 	lzma? ( app-arch/xz-utils[threads=,${MULTILIB_USEDEP}] )
     29 	lzo? ( >=dev-libs/lzo-2[${MULTILIB_USEDEP}] )
     30 	nettle? ( dev-libs/nettle:0=[${MULTILIB_USEDEP}] )
     31 	zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
     32 DEPEND="${RDEPEND}
     33 	kernel_linux? (
     34 		virtual/os-headers
     35 		e2fsprogs? ( sys-fs/e2fsprogs )
     36 	)"
     37 
     38 PATCHES=(
     39 	"${FILESDIR}"/${PN}-3.3.3-libressl.patch
     40 )
     41 
     42 # Various test problems, starting with the fact that sandbox
     43 # explodes on long paths. https://bugs.gentoo.org/598806
     44 RESTRICT="test"
     45 
     46 src_prepare() {
     47 	default
     48 	elibtoolize  # is required for Solaris sol2_ld linker fix
     49 }
     50 
     51 multilib_src_configure() {
     52 	export ac_cv_header_ext2fs_ext2_fs_h=$(usex e2fsprogs) #354923
     53 
     54 	local myconf=()
     55 	myconf=(
     56 		$(use_enable acl)
     57 		$(use_enable static-libs static)
     58 		$(use_enable xattr)
     59 		$(use_with bzip2 bz2lib)
     60 		$(use_with expat)
     61 		$(use_with !expat xml2)
     62 		$(use_with iconv)
     63 		$(use_with lz4)
     64 		$(use_with lzma)
     65 		$(use_with lzo lzo2)
     66 		$(use_with nettle)
     67 		$(use_with zlib)
     68 	)
     69 	if multilib_is_native_abi ; then
     70 		myconf+=(
     71 			--enable-bsdcat=$(tc-is-static-only && echo static || echo shared)
     72 			--enable-bsdcpio=$(tc-is-static-only && echo static || echo shared)
     73 			--enable-bsdtar=$(tc-is-static-only && echo static || echo shared)
     74 		)
     75 	else
     76 		myconf+=(
     77 			--disable-bsdcat
     78 			--disable-bsdcpio
     79 			--disable-bsdtar
     80 		)
     81 	fi
     82 
     83 	ECONF_SOURCE="${S}" econf "${myconf[@]}"
     84 }
     85 
     86 multilib_src_compile() {
     87 	if multilib_is_native_abi ; then
     88 		emake
     89 	else
     90 		emake libarchive.la
     91 	fi
     92 }
     93 
     94 multilib_src_test() {
     95 	# Replace the default src_test so that it builds tests in parallel
     96 	multilib_is_native_abi && emake check
     97 }
     98 
     99 multilib_src_install() {
    100 	if multilib_is_native_abi ; then
    101 		emake DESTDIR="${D}" install
    102 
    103 		# Create symlinks for FreeBSD
    104 		if ! use prefix && [[ ${CHOST} == *-freebsd* ]]; then
    105 			# Exclude cat for the time being #589876
    106 			for bin in cpio tar; do
    107 				dosym bsd${bin} /usr/bin/${bin}
    108 				echo '.so bsd${bin}.1' > "${T}"/${bin}.1
    109 				doman "${T}"/${bin}.1
    110 			done
    111 		fi
    112 	else
    113 		local install_targets=(
    114 			install-includeHEADERS
    115 			install-libLTLIBRARIES
    116 			install-pkgconfigDATA
    117 		)
    118 		emake DESTDIR="${D}" "${install_targets[@]}"
    119 	fi
    120 
    121 	# Libs.private: should be used from libarchive.pc instead
    122 	find "${ED}" -name "*.la" -delete || die
    123 }
    124 
    125 multilib_src_install_all() {
    126 	cd "${S}" || die
    127 	einstalldocs
    128 }