diff options
Diffstat (limited to 'app-crypt/rhash')
-rw-r--r-- | app-crypt/rhash/Manifest | 4 | ||||
-rw-r--r-- | app-crypt/rhash/files/darwin-triplet.patch | 23 | ||||
-rw-r--r-- | app-crypt/rhash/files/freebsd-triplet.patch | 23 | ||||
-rw-r--r-- | app-crypt/rhash/files/rhash-1.3.6-no_echon.patch | 54 | ||||
-rw-r--r-- | app-crypt/rhash/files/rhash-1.4.2-clang.patch | 80 | ||||
-rw-r--r-- | app-crypt/rhash/files/rhash-1.4.4-prefix.patch | 22 | ||||
-rw-r--r-- | app-crypt/rhash/files/unquote-cc.patch | 26 | ||||
-rw-r--r-- | app-crypt/rhash/rhash-1.3.6-r1.ebuild | 77 | ||||
-rw-r--r-- | app-crypt/rhash/rhash-1.4.3.ebuild (renamed from app-crypt/rhash/rhash-1.4.2.ebuild) | 37 | ||||
-rw-r--r-- | app-crypt/rhash/rhash-1.4.4-r1.ebuild | 96 | ||||
-rw-r--r-- | app-crypt/rhash/rhash-1.4.4.ebuild | 101 |
11 files changed, 241 insertions, 302 deletions
diff --git a/app-crypt/rhash/Manifest b/app-crypt/rhash/Manifest index 29794e046d24..15fbc4e5e11a 100644 --- a/app-crypt/rhash/Manifest +++ b/app-crypt/rhash/Manifest @@ -1,2 +1,2 @@ -DIST rhash-1.3.6-src.tar.gz 328097 BLAKE2B c74993d183f0f2e479f0bd5831a9f653b9bd17bbed4d1ba896f6e33db98b7141175cd3c688dc41dfd8ec4b98acb51255ae5b795435cbc9dfb5ab77573cb25543 SHA512 54f7f238ed1fdc01c29cc1338fa86be90b69beff0df8f20d24ce9cb3c48c7f4668b84a3fe0d4d8b04b54bc8145485d493435edf3219de3a637af0f9c007c85c6 -DIST rhash-1.4.2-src.tar.gz 416853 BLAKE2B 06322825116cb00aa4987b01610d967eb57c94aa29b43348ec2c31f053fd471a900fcee776714263213e9a79eaf389b2e79d7b34a5afd3e98d68198193b5cbe7 SHA512 41df57e8b3f32c93d8e6f2ac668b32aaa23eb2eaf90a83f109e61e511404a5036ea88bcf2854e19c1ade0f61960e0d9edf01f3d82e1c645fed36579e9d7a6a25 +DIST rhash-1.4.3-src.tar.gz 429290 BLAKE2B d225aeae0b3a8fb2e093a9aef50cd07a790c7e9734e91114deef2ca8492c85261b8ed5dea45958e35e049ea888885175608962ea72297bdef48b00c52f51eaca SHA512 d87ffcde28d8f25cf775c279fed457e52d24523ed9b695629dae694b3c22372247d18f6032f8ce13a0b70fa2953be408982e46659daaa7c4ab227ae89eaed9c7 +DIST rhash-1.4.4-src.tar.gz 435691 BLAKE2B f3d42f333ad9a82fe4a8ef5af5d8008abf526c05c06a00c7033881d5a27ba663c3cc5cefb73ea8157ac24cb10a50a4e500706d489e61a03dbaee74a4735d1722 SHA512 00a7e5e058b53ce20ae79509815452ed9cb699d1322b678220b72c61dea3ea2f8fa131acfade8bb6d9f6af913f0c3c472330841181b22314b8755166310c946f diff --git a/app-crypt/rhash/files/darwin-triplet.patch b/app-crypt/rhash/files/darwin-triplet.patch deleted file mode 100644 index 49b7e121d818..000000000000 --- a/app-crypt/rhash/files/darwin-triplet.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 35a830d1968465e4ecb079273f032b754bac6c66 Mon Sep 17 00:00:00 2001 -From: James Le Cuirot <chewi@gentoo.org> -Date: Sun, 25 Mar 2018 17:40:49 +0100 -Subject: [PATCH] configure: Add target OS clause for Darwin - -These triplets can also have a version number suffix, for example, -x86_64-apple-darwin16. ---- - configure | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/configure b/configure -index 5b6b710..2d8ac42 100755 ---- a/configure -+++ b/configure -@@ -410,6 +410,7 @@ else - amigaos) TARGET_OS=AmigaOS ;; - mingw32*) TARGET_OS=MINGW32 ;; - wine) TARGET_OS=Wine ;; -+ darwin*) TARGET_OS=Darwin ;; - esac - } - TARGET_OS="UNKNOWN" diff --git a/app-crypt/rhash/files/freebsd-triplet.patch b/app-crypt/rhash/files/freebsd-triplet.patch deleted file mode 100644 index 94b615824be7..000000000000 --- a/app-crypt/rhash/files/freebsd-triplet.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 14db7f9ee87e05450853ba0e1d8e83cc34aef3e4 Mon Sep 17 00:00:00 2001 -From: James Le Cuirot <chewi@aura-online.co.uk> -Date: Sat, 24 Mar 2018 13:51:56 +0000 -Subject: [PATCH] configure: Match FreeBSD triplets with versions - -Triplets such as x86_64-unknown-freebsd11.1 are common. ---- - configure | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure b/configure -index 8ebb929..5b6b710 100755 ---- a/configure -+++ b/configure -@@ -398,7 +398,7 @@ else - part=$(echo $BUILD_TARGET | cut -d '-' -f $component) - case "$(echo $part | tr '[A-Z]' '[a-z]')" in - linux) TARGET_OS=Linux ;; -- freebsd) TARGET_OS=FreeBSD ;; -+ freebsd*) TARGET_OS=FreeBSD ;; - gnu/kfreebsd) TARGET_OS=FreeBSD ;; - netbsd) TARGET_OS=NetBSD ;; - bsd/os) TARGET_OS=BSD/OS ;; diff --git a/app-crypt/rhash/files/rhash-1.3.6-no_echon.patch b/app-crypt/rhash/files/rhash-1.3.6-no_echon.patch deleted file mode 100644 index 9b25b29a89f3..000000000000 --- a/app-crypt/rhash/files/rhash-1.3.6-no_echon.patch +++ /dev/null @@ -1,54 +0,0 @@ -From c1776248a0b34a690e99ab9a7a814c34f78088ec Mon Sep 17 00:00:00 2001 -From: Lars Wendler <polynomial-c@gentoo.org> -Date: Mon, 19 Mar 2018 10:47:13 +0100 -Subject: [PATCH] "echo -n" cannot be expected to work with every POSIX shell - -See "man 1p echo" section APPLICATION USAGE. This patch replaces "echo -n" -with "printf '%s'". ---- - configure | 15 ++------------- - 1 file changed, 2 insertions(+), 13 deletions(-) - -diff --git a/configure b/configure -index f480f7b..2a7d485 100755 ---- a/configure -+++ b/configure -@@ -22,17 +22,6 @@ INSTALL_LIB_STATIC=auto - INSTALL_LIB_SHARED=auto - INSTALL_PKGCONFIGDIR="$PKG_INSTALLDIR" - --case $(echo -n) in -- -n) # SysV style -- ECHO_N= -- ECHO_C='\c' -- ;; -- *) # BSD style -- ECHO_N='-n ' -- ECHO_C= -- ;; --esac -- - # display error message and exit - die () { - echo -@@ -235,7 +224,7 @@ trap remove_tmpdir EXIT - - str_concat() - { -- echo ${ECHO_N} $@ ${ECHO_C} -+ printf '%s ' $@ - } - - yn_nonempty() -@@ -246,7 +235,7 @@ yn_nonempty() - # Use this before starting a check - start_check() { - echo "============ Checking for $1 ============" >> "$TMPLOG" -- echo ${ECHO_N} "Checking for $1 ... ${ECHO_C}" -+ printf '%s' "Checking for $1 ... " - res_comment="" - } - --- -2.16.2 - diff --git a/app-crypt/rhash/files/rhash-1.4.2-clang.patch b/app-crypt/rhash/files/rhash-1.4.2-clang.patch deleted file mode 100644 index 460e73a6ace7..000000000000 --- a/app-crypt/rhash/files/rhash-1.4.2-clang.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 4dc506066cf1727b021e6352535a8bb315c3f8dc Mon Sep 17 00:00:00 2001 -From: Aleksey <rhash.admin@gmail.com> -Date: Sat, 17 Jul 2021 18:39:41 +0300 -Subject: [PATCH] configure: fix clang detection on macOS - ---- - configure | 58 +++++++++++++++++++++++++++---------------------------- - 1 file changed, 28 insertions(+), 30 deletions(-) - -diff --git a/configure b/configure -index 59d432b..111270a 100755 ---- a/configure -+++ b/configure -@@ -519,38 +519,36 @@ else - elif run_cmd "$CC --version"; then - cc_name_tmp=$($CC --version 2>&1 | head -n 1 | cut -d ' ' -f 1) - fi -- if test -n "${cc_name_tmp}"; then -- if echo "$cc_name_tmp" | grep -q "gcc"; then -- cc_name=$cc_name_tmp -- start_check "$CC version" -- cc_vendor=gnu -- cc_version=$($CC -dumpversion 2>&1) -- if ! echo $cc_version | grep -q '^[0-9][0-9]*\.[0-9]'; then -- cc_v2=$($CC -dumpfullversion -dumpversion 2>/dev/null) -- if echo $cc_v2 | grep -q '^[0-9][0-9]*\.[0-9]'; then -- cc_version=$cc_v2 -- fi -+ if echo "$cc_name_tmp" | grep -q "gcc"; then -+ cc_name=$cc_name_tmp -+ start_check "$CC version" -+ cc_vendor=gnu -+ cc_version=$($CC -dumpversion 2>&1) -+ if ! echo $cc_version | grep -q '^[0-9][0-9]*\.[0-9]'; then -+ cc_v2=$($CC -dumpfullversion -dumpversion 2>/dev/null) -+ if echo $cc_v2 | grep -q '^[0-9][0-9]*\.[0-9]'; then -+ cc_version=$cc_v2 - fi -- case $cc_version in -- 2.96*) -- cc_fail=yes -- ;; -- *) -- _cc_major=$(echo $cc_version | cut -d '.' -f 1) -- _cc_minor=$(echo $cc_version | cut -d '.' -f 2) -- _cc_mini=$(echo $cc_version | cut -d '.' -f 3) -- ;; -- esac -- finish_check "$cc_name $cc_version" -- break -- fi -- if echo "$cc_name_tmp" | grep -q "clang"; then -- start_check "$CC version" -- cc_vendor=clang -- cc_version=$($CC -dumpversion 2>&1) -- finish_check "clang $cc_version" -- break - fi -+ case $cc_version in -+ 2.96*) -+ cc_fail=yes -+ ;; -+ *) -+ _cc_major=$(echo $cc_version | cut -d '.' -f 1) -+ _cc_minor=$(echo $cc_version | cut -d '.' -f 2) -+ _cc_mini=$(echo $cc_version | cut -d '.' -f 3) -+ ;; -+ esac -+ finish_check "$cc_name $cc_version" -+ break -+ elif $CC --version 2>&1 | grep -q "clang"; then -+ start_check "$CC version" -+ cc_vendor=clang -+ cc_version=$($CC -dumpversion 2>&1) -+ finish_check "clang $cc_version" -+ break -+ else - cc_name_tmp=$($CC -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3) - if test "$cc_name_tmp" = "Sun C"; then - start_check "$CC version" diff --git a/app-crypt/rhash/files/rhash-1.4.4-prefix.patch b/app-crypt/rhash/files/rhash-1.4.4-prefix.patch new file mode 100644 index 000000000000..ce2e72bf149e --- /dev/null +++ b/app-crypt/rhash/files/rhash-1.4.4-prefix.patch @@ -0,0 +1,22 @@ +From c804982d1b24c6533118b3068d2cfdca685076f3 Mon Sep 17 00:00:00 2001 +From: Aleksey Kravchenko <rhash.admin@gmail.com> +Date: Mon, 7 Aug 2023 01:00:37 +0300 +Subject: [PATCH] Fix #243: Incorrect assigment in the configure script + +--- + configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index 39ef8c1b..63cbd8d0 100755 +--- a/configure ++++ b/configure +@@ -877,7 +877,7 @@ if test "$OPT_STATIC" = "no"; then + RHASH_TEST_OPTIONS=--shared + test "$INSTALL_LIB_SHARED" = "auto" && INSTALL_LIB_SHARED=yes + test "$INSTALL_LIB_STATIC" = "yes" && RHASH_BUILD_TARGETS="$RHASH_BUILD_TARGETS \$(LIBRHASH_STATIC)" +- RHASH_LDFLAGS=$RHASH_LDFLAGS $GETTEXT_LDFLAGS ++ RHASH_LDFLAGS=$(join_params $RHASH_LDFLAGS $GETTEXT_LDFLAGS) + else + LIBRHASH_TYPE=static + LIBRHASH_PATH="\$(LIBRHASH_STATIC)" diff --git a/app-crypt/rhash/files/unquote-cc.patch b/app-crypt/rhash/files/unquote-cc.patch deleted file mode 100644 index 77ccc9b2c5f7..000000000000 --- a/app-crypt/rhash/files/unquote-cc.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 4558d6753611ab1bf21765017e5b451aee8409f6 Mon Sep 17 00:00:00 2001 -From: James Le Cuirot <chewi@gentoo.org> -Date: Sun, 18 Mar 2018 14:23:28 +0000 -Subject: [PATCH] configure: Don't quote $CC when calling it - -It might have additional arguments. ---- - configure | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure b/configure -index f480f7b..8ebb929 100755 ---- a/configure -+++ b/configure -@@ -480,7 +480,7 @@ if test "$(basename $CC)" = "icc" || test "$(basename $CC)" = "ecc"; then - else - CC_TMP="$CC" - for CC in "$CC_TMP" gcc cc ; do -- if "$CC" -v >/dev/null 2>&1; then -+ if $CC -v >/dev/null 2>&1; then - cc_name_tmp=$($CC -v 2>&1 | tail -n 1 | cut -d ' ' -f 1) - if test "$cc_name_tmp" = "gcc"; then - cc_name=$cc_name_tmp --- -2.16.1 - diff --git a/app-crypt/rhash/rhash-1.3.6-r1.ebuild b/app-crypt/rhash/rhash-1.3.6-r1.ebuild deleted file mode 100644 index 9dfdd81943a2..000000000000 --- a/app-crypt/rhash/rhash-1.3.6-r1.ebuild +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit toolchain-funcs multilib-minimal - -DESCRIPTION="Console utility and library for computing and verifying file hash sums" -HOMEPAGE="http://rhash.sourceforge.net/" -SRC_URI="mirror://sourceforge/${PN}/${P}-src.tar.gz" - -LICENSE="MIT" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris ~x86-solaris" -IUSE="debug nls ssl static-libs" - -RDEPEND=" - ssl? ( - dev-libs/openssl:0=[${MULTILIB_USEDEP}] -)" - -DEPEND="${RDEPEND} - nls? ( sys-devel/gettext )" - -S="${WORKDIR}/RHash-${PV}" - -PATCHES=( - "${FILESDIR}"/unquote-cc.patch - "${FILESDIR}"/${P}-no_echon.patch - "${FILESDIR}"/{freebsd,darwin}-triplet.patch -) - -src_prepare() { - default - multilib_copy_sources -} - -multilib_src_configure() { - set -- \ - ./configure \ - --target="${CHOST}" \ - --cc="$(tc-getCC)" \ - --ar="$(tc-getAR)" \ - --extra-cflags="${CFLAGS}" \ - --extra-ldflags="${LDFLAGS}" \ - --prefix="${EPREFIX}"/usr \ - --libdir="${EPREFIX}"/usr/$(get_libdir) \ - --sysconfdir="${EPREFIX}"/etc \ - --disable-openssl-runtime \ - --disable-static \ - --enable-lib-shared \ - $(use_enable debug) \ - $(use_enable nls gettext) \ - $(use_enable ssl openssl) \ - $(use_enable static-libs lib-static) - - echo "${@}" - "${@}" || die "configure failed" -} - -# We would add compile-gmo to the build targets but install-gmo always -# recompiles unconditionally. :( - -multilib_src_install() { - # -j1 needed due to race condition. - emake DESTDIR="${D}" -j1 \ - install{,-pkg-config} \ - $(use nls && echo install-gmo) \ - $(use kernel_Winnt || echo install-lib-so-link) - - emake DESTDIR="${D}" -j1 \ - -C lib${PN} install-headers -} - -multilib_src_test() { - emake test -} diff --git a/app-crypt/rhash/rhash-1.4.2.ebuild b/app-crypt/rhash/rhash-1.4.3.ebuild index 95bea74843c5..416de743289a 100644 --- a/app-crypt/rhash/rhash-1.4.2.ebuild +++ b/app-crypt/rhash/rhash-1.4.3.ebuild @@ -1,17 +1,17 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 -inherit toolchain-funcs multilib-minimal +inherit flag-o-matic toolchain-funcs multilib-minimal DESCRIPTION="Console utility and library for computing and verifying file hash sums" -HOMEPAGE="http://rhash.sourceforge.net/" -SRC_URI="mirror://sourceforge/${PN}/${P}-src.tar.gz" +HOMEPAGE="https://rhash.sourceforge.net/" +SRC_URI="https://downloads.sourceforge.net/${PN}/${P}-src.tar.gz" -LICENSE="MIT" +LICENSE="0BSD" SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" IUSE="debug nls ssl static-libs" RDEPEND=" @@ -29,10 +29,6 @@ BDEPEND=" S="${WORKDIR}/RHash-${PV}" -PATCHES=( - "${FILESDIR}"/${P}-clang.patch -) - src_prepare() { default @@ -46,6 +42,13 @@ src_prepare() { } multilib_src_configure() { + # ideally we want !tc-ld-is-bfd for best future-proofing, but it needs + # https://github.com/gentoo/gentoo/pull/28355 + # mold needs this too but right now tc-ld-is-mold is also not available + if tc-ld-is-lld; then + append-ldflags -Wl,--undefined-version + fi + set -- \ ./configure \ --target="${CHOST}" \ @@ -68,17 +71,17 @@ multilib_src_configure() { "${@}" || die "configure failed" } -# We would add compile-gmo to the build targets but install-gmo always -# recompiles unconditionally. :( -# (note from sam: this might be fixed in >1.4.2? -# https://github.com/rhash/RHash/commit/9e4eeb1268149b24b7fbe0fc0fe91e3a266e6261) +multilib_src_compile() { + emake all \ + $(multilib_is_native_abi && use nls && echo compile-gmo) +} multilib_src_install() { # -j1 needed due to race condition. emake DESTDIR="${D}" -j1 \ install{,-lib-headers,-pkg-config} \ - $(use nls && echo install-gmo) \ - $(use kernel_Winnt || echo install-lib-so-link) + $(multilib_is_native_abi && use nls && echo install-gmo) \ + install-lib-so-link } multilib_src_test() { diff --git a/app-crypt/rhash/rhash-1.4.4-r1.ebuild b/app-crypt/rhash/rhash-1.4.4-r1.ebuild new file mode 100644 index 000000000000..0f75fbc1bd3a --- /dev/null +++ b/app-crypt/rhash/rhash-1.4.4-r1.ebuild @@ -0,0 +1,96 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit flag-o-matic toolchain-funcs multilib-minimal + +DESCRIPTION="Console utility and library for computing and verifying file hash sums" +HOMEPAGE="https://rhash.sourceforge.net/" +SRC_URI="https://downloads.sourceforge.net/${PN}/${P}-src.tar.gz" + +LICENSE="0BSD" +SLOT="0/1" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="debug nls ssl static-libs" + +RDEPEND=" + ssl? ( + dev-libs/openssl:0=[${MULTILIB_USEDEP}] +)" + +DEPEND=" + ${RDEPEND} +" + +BDEPEND=" + nls? ( sys-devel/gettext ) +" + +S="${WORKDIR}/RHash-${PV}" + +PATCHES=( + "${FILESDIR}"/${P}-prefix.patch +) + +src_prepare() { + default + + if [[ ${CHOST} == *-darwin* && ${CHOST##*darwin} -le 9 ]] ; then + # we lack posix_memalign + sed -i -e '/if _POSIX_VERSION/s/if .*$/if 0/' \ + librhash/util.h || die + fi + + # upstream fix for BSD and others, but was only applied for BSD + # we need support for Solaris, where we use a GNU toolchain, so use + # the original hack, hopefully next release has this fixed + # https://github.com/rhash/RHash/issues/238 + if [[ ${CHOST} == *-solaris* ]] ; then + sed -i -e 's/^elif linux; then/else/' configure || die + fi + + multilib_copy_sources +} + +multilib_src_configure() { + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) + + set -- \ + ./configure \ + --target="${CHOST}" \ + --cc="$(tc-getCC)" \ + --ar="$(tc-getAR)" \ + --extra-cflags="${CFLAGS}" \ + --extra-ldflags="${LDFLAGS}" \ + --prefix="${EPREFIX}"/usr \ + --libdir="${EPREFIX}"/usr/$(get_libdir) \ + --sysconfdir="${EPREFIX}"/etc \ + --disable-openssl-runtime \ + --disable-static \ + --enable-lib-shared \ + $(use_enable debug) \ + $(use_enable nls gettext) \ + $(use_enable ssl openssl) \ + $(use_enable static-libs lib-static) + + echo "${@}" + "${@}" || die "configure failed" +} + +multilib_src_compile() { + emake all \ + $(multilib_is_native_abi && use nls && echo compile-gmo) +} + +multilib_src_install() { + # -j1 needed due to race condition. + emake DESTDIR="${D}" -j1 \ + install{,-lib-headers,-pkg-config} \ + $(multilib_is_native_abi && use nls && echo install-gmo) \ + install-lib-so-link +} + +multilib_src_test() { + emake test +} diff --git a/app-crypt/rhash/rhash-1.4.4.ebuild b/app-crypt/rhash/rhash-1.4.4.ebuild new file mode 100644 index 000000000000..01f9f0849a56 --- /dev/null +++ b/app-crypt/rhash/rhash-1.4.4.ebuild @@ -0,0 +1,101 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit flag-o-matic toolchain-funcs multilib-minimal + +DESCRIPTION="Console utility and library for computing and verifying file hash sums" +HOMEPAGE="https://rhash.sourceforge.net/" +SRC_URI="https://downloads.sourceforge.net/${PN}/${P}-src.tar.gz" + +LICENSE="0BSD" +SLOT="0/1" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="debug nls ssl static-libs" + +RDEPEND=" + ssl? ( + dev-libs/openssl:0=[${MULTILIB_USEDEP}] +)" + +DEPEND=" + ${RDEPEND} +" + +BDEPEND=" + nls? ( sys-devel/gettext ) +" + +S="${WORKDIR}/RHash-${PV}" + +PATCHES=( + "${FILESDIR}"/${P}-prefix.patch +) + +src_prepare() { + default + + if [[ ${CHOST} == *-darwin* && ${CHOST##*darwin} -le 9 ]] ; then + # we lack posix_memalign + sed -i -e '/if _POSIX_VERSION/s/if .*$/if 0/' \ + librhash/util.h || die + fi + + # upstream fix for BSD and others, but was only applied for BSD + # we need support for Solaris, where we use a GNU toolchain, so use + # the original hack, hopefully next release has this fixed + # https://github.com/rhash/RHash/issues/238 + if [[ ${CHOST} == *-solaris* ]] ; then + sed -i -e 's/^elif linux; then/else/' configure || die + fi + + multilib_copy_sources +} + +multilib_src_configure() { + # ideally we want !tc-ld-is-bfd for best future-proofing, but it needs + # https://github.com/gentoo/gentoo/pull/28355 + # mold needs this too but right now tc-ld-is-mold is also not available + if tc-ld-is-lld; then + append-ldflags -Wl,--undefined-version + fi + + set -- \ + ./configure \ + --target="${CHOST}" \ + --cc="$(tc-getCC)" \ + --ar="$(tc-getAR)" \ + --extra-cflags="${CFLAGS}" \ + --extra-ldflags="${LDFLAGS}" \ + --prefix="${EPREFIX}"/usr \ + --libdir="${EPREFIX}"/usr/$(get_libdir) \ + --sysconfdir="${EPREFIX}"/etc \ + --disable-openssl-runtime \ + --disable-static \ + --enable-lib-shared \ + $(use_enable debug) \ + $(use_enable nls gettext) \ + $(use_enable ssl openssl) \ + $(use_enable static-libs lib-static) + + echo "${@}" + "${@}" || die "configure failed" +} + +multilib_src_compile() { + emake all \ + $(multilib_is_native_abi && use nls && echo compile-gmo) +} + +multilib_src_install() { + # -j1 needed due to race condition. + emake DESTDIR="${D}" -j1 \ + install{,-lib-headers,-pkg-config} \ + $(multilib_is_native_abi && use nls && echo install-gmo) \ + install-lib-so-link +} + +multilib_src_test() { + emake test +} |