app-crypt/rhash: fix configure for Cygwin
[gentoo.git] / app-crypt / rhash / rhash-1.3.6-r1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit toolchain-funcs multilib-minimal
7
8 DESCRIPTION="Console utility and library for computing and verifying file hash sums"
9 HOMEPAGE="http://rhash.anz.ru/"
10 SRC_URI="mirror://sourceforge/${PN}/${P}-src.tar.gz"
11
12 LICENSE="MIT"
13 SLOT="0"
14 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
15 IUSE="debug nls libressl ssl static-libs"
16
17 RDEPEND="
18         ssl? (
19                 !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
20                 libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
21 )"
22
23 DEPEND="${RDEPEND}
24         nls? ( sys-devel/gettext )"
25
26 S="${WORKDIR}/RHash-${PV}"
27
28 PATCHES=(
29         "${FILESDIR}"/unquote-cc.patch
30         "${FILESDIR}"/${P}-no_echon.patch
31         "${FILESDIR}"/{freebsd,darwin}-triplet.patch
32 )
33
34 src_prepare() {
35         default
36         multilib_copy_sources
37 }
38
39 multilib_src_configure() {
40         set -- \
41                 ./configure \
42                 --target="${CHOST}" \
43                 --cc="$(tc-getCC)" \
44                 --ar="$(tc-getAR)" \
45                 --extra-cflags="${CFLAGS}" \
46                 --extra-ldflags="${LDFLAGS}" \
47                 --prefix="${EPREFIX}"/usr \
48                 --libdir="${EPREFIX}"/usr/$(get_libdir) \
49                 --sysconfdir="${EPREFIX}"/etc \
50                 --disable-openssl-runtime \
51                 --disable-static \
52                 --enable-lib-shared \
53                 $(use_enable debug) \
54                 $(use_enable nls gettext) \
55                 $(use_enable ssl openssl) \
56                 $(use_enable static-libs lib-static)
57
58         echo "${@}"
59         "${@}" || die "configure failed"
60 }
61
62 # We would add compile-gmo to the build targets but install-gmo always
63 # recompiles unconditionally. :(
64
65 multilib_src_install() {
66         # -j1 needed due to race condition.
67         emake DESTDIR="${D}" -j1 \
68                   install{,-pkg-config} \
69                   $(use nls && echo install-gmo) \
70                   $(use kernel_Winnt || echo install-lib-so-link)
71
72         emake DESTDIR="${D}" -j1 \
73                   -C lib${PN} install-headers
74 }
75
76 multilib_src_test() {
77         emake test
78 }