app-crypt/rhash: Sync with gentoo

It's from gentoo commit be3ac74c8316881622238f55bc498d5886bef527.
This commit is contained in:
Krzesimir Nowak 2022-03-02 18:14:38 +01:00
parent 49448edd03
commit 840eef562e
8 changed files with 221 additions and 102 deletions

View File

@ -1,2 +1,2 @@
DIST rhash-1.3.5-src.tar.gz 316867 BLAKE2B 3ffbf2ec5aef24ef63455e21c3efcae043a321a78be522a26bd25086111430071a496ab3775ff9b4956da7304df8d8e552a061f3306a7a683be5fc65ea3fd1c4 SHA512 e8450aab0c16bfb975bf4aeee218740fb4d86d5514e426b70c3edb84e4d63865cd4051939aa95c24a87a78baaedc49e40bb509b2610e89ca3745930808b3ef6c
DIST rhash-1.3.6-src.tar.gz 328097 BLAKE2B c74993d183f0f2e479f0bd5831a9f653b9bd17bbed4d1ba896f6e33db98b7141175cd3c688dc41dfd8ec4b98acb51255ae5b795435cbc9dfb5ab77573cb25543 SHA512 54f7f238ed1fdc01c29cc1338fa86be90b69beff0df8f20d24ce9cb3c48c7f4668b84a3fe0d4d8b04b54bc8145485d493435edf3219de3a637af0f9c007c85c6 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

View File

@ -0,0 +1,23 @@
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"

View File

@ -0,0 +1,23 @@
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 ;;

View File

@ -0,0 +1,80 @@
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"

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata> <pkgmetadata>
<maintainer type="person"> <maintainer type="person">
<email>chewi@gentoo.org</email> <email>chewi@gentoo.org</email>
@ -8,6 +8,7 @@
<upstream> <upstream>
<remote-id type="sourceforge">rhash</remote-id> <remote-id type="sourceforge">rhash</remote-id>
<remote-id type="github">rhash/RHash</remote-id> <remote-id type="github">rhash/RHash</remote-id>
<remote-id type="cpe">cpe:/a:rhash_project:rhash</remote-id>
<bugs-to>https://github.com/rhash/RHash/issues</bugs-to> <bugs-to>https://github.com/rhash/RHash/issues</bugs-to>
</upstream> </upstream>
<longdescription lang="en"> <longdescription lang="en">

View File

@ -1,94 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# 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.anz.ru/"
SRC_URI="mirror://sourceforge/${PN}/${P}-src.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
IUSE="debug nls libressl ssl static-libs"
RDEPEND="
ssl? (
!libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
)"
DEPEND="${RDEPEND}
nls? ( sys-devel/gettext )"
S="${WORKDIR}/RHash-${PV}"
src_prepare() {
default
# Install /etc stuff inside the Prefix
sed -i -e 's:\$(DESTDIR)/etc:\$(DESTDIR)/$(SYSCONFDIR):g' Makefile || die
if use elibc_Darwin ; then
local ver_script='-Wl,--version-script,exports.sym,-soname,$(SONAME)'
local install_name='-install_name $(LIBDIR)/$(SONAME)'
sed -i -e '/^\(SONAME\|SHAREDLIB\)/s/\.so\.\([0-9]\+\)/.\1.dylib/' \
-e '/^SOLINK/s/\.so/.dylib/' \
-e "s:${ver_script}:${install_name}:" \
librhash/Makefile \
Makefile || die
fi
if use elibc_SunOS ; then
# https://sourceware.org/bugzilla/show_bug.cgi?id=12548
# skip the export.sym for now
sed -i -e 's/,--version-script,exports.sym//' librhash/Makefile || die
fi
multilib_copy_sources
}
multilib_src_compile() {
local ADDCFLAGS=(
$(use debug || echo -DNDEBUG)
$(use nls && echo -DUSE_GETTEXT)
$(use ssl && echo -DOPENSSL_RUNTIME -rdynamic)
)
local ADDLDFLAGS=(
$(use ssl && echo -ldl)
)
use elibc_Darwin || use elibc_DragonFly ||
use elibc_NetBSD || use elibc_OpenBSD || use elibc_SunOS &&
ADDLDFLAGS+=( $(use nls && echo -lintl) )
emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)" \
ADDCFLAGS="${ADDCFLAGS[*]}" ADDLDFLAGS="${ADDLDFLAGS[*]}" \
PREFIX="${EPREFIX}"/usr LIBDIR='$(PREFIX)'/$(get_libdir) \
build-shared $(use static-libs && echo lib-static)
}
myemake() {
emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr \
LIBDIR='$(PREFIX)'/$(get_libdir) SYSCONFDIR="${EPREFIX}"/etc "${@}"
}
multilib_src_install() {
myemake -C librhash install-lib-shared install-so-link
multilib_is_native_abi && myemake install-shared
use static-libs && myemake install-lib-static
}
multilib_src_install_all() {
myemake -C librhash install-headers
use nls && myemake install-gmo
einstalldocs
}
multilib_src_test() {
cd tests || die
LD_LIBRARY_PATH=$(pwd)/../librhash ./test_rhash.sh --full ../rhash_shared || die "tests failed"
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation # Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=6 EAPI=6
@ -6,18 +6,17 @@ EAPI=6
inherit toolchain-funcs multilib-minimal inherit toolchain-funcs multilib-minimal
DESCRIPTION="Console utility and library for computing and verifying file hash sums" DESCRIPTION="Console utility and library for computing and verifying file hash sums"
HOMEPAGE="http://rhash.anz.ru/" HOMEPAGE="http://rhash.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}-src.tar.gz" SRC_URI="mirror://sourceforge/${PN}/${P}-src.tar.gz"
LICENSE="MIT" LICENSE="MIT"
SLOT="0" SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x64-solaris ~x86-solaris" 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 libressl ssl static-libs" IUSE="debug nls ssl static-libs"
RDEPEND=" RDEPEND="
ssl? ( ssl? (
!libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] ) dev-libs/openssl:0=[${MULTILIB_USEDEP}]
libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
)" )"
DEPEND="${RDEPEND} DEPEND="${RDEPEND}
@ -28,6 +27,7 @@ S="${WORKDIR}/RHash-${PV}"
PATCHES=( PATCHES=(
"${FILESDIR}"/unquote-cc.patch "${FILESDIR}"/unquote-cc.patch
"${FILESDIR}"/${P}-no_echon.patch "${FILESDIR}"/${P}-no_echon.patch
"${FILESDIR}"/{freebsd,darwin}-triplet.patch
) )
src_prepare() { src_prepare() {

View File

@ -0,0 +1,86 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
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 ~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"
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}-clang.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
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. :(
# (note from sam: this might be fixed in >1.4.2?
# https://github.com/rhash/RHash/commit/9e4eeb1268149b24b7fbe0fc0fe91e3a266e6261)
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_src_test() {
emake test
}