app-crypt/argon2 - 20190702 (mva)

Search

Install

Install this version:

emerge -a =app-crypt/argon2-20190702

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =app-crypt/argon2-20190702

Or alternatively:

emerge --autounmask-write -a =app-crypt/argon2-20190702

Package Information

Description:
The password hash Argon2, winner of PHC
Homepage:
https://github.com/P-H-C/phc-winner-argon2
License:
|| ( Apache-2.0 CC0-1.0 )

Ebuild Details

Version EAPI Keywords Slot
20190702 8 ~amd64 ~arm ~arm64 ~x86 0/1
View Raw Ebuild
# Copyright 2026 mva
# Distributed under the terms of the Public Domain or CC0 License

EAPI=8

inherit patches toolchain-funcs

DESCRIPTION="The password hash Argon2, winner of PHC"
HOMEPAGE="https://github.com/P-H-C/phc-winner-argon2"
EGIT_REPO_URI="https://github.com/P-H-C/phc-winner-argon2"
if [[ "${PV}" == 9999* ]]; then
	inherit git-r3
else
	SRC_URI="${EGIT_REPO_URI}/archive/${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~amd64 ~arm ~arm64 ~x86"
	S="${WORKDIR}/phc-winner-${P}"
fi
LICENSE="|| ( Apache-2.0 CC0-1.0 )"
SLOT="0/1"
IUSE="static-libs"

DOCS=("README.md" "CHANGELOG.md" "${PN}-specs.pdf")

src_prepare() {
	default
	if ! use static-libs; then
		sed -i -e '/LIBRARIES =/s/\$(LIB_ST)//' Makefile || die "sed failed!"
	fi
	sed \
		-e 's/-O3 //' \
		-e 's/-g //' \
		-e "s/-march=\$(OPTTARGET)//" \
		-e "/^LIBRARY_REL/s@LIBRARY_REL.*@LIBRARY_REL = $(get_libdir)@" \
		-i Makefile || die "sed failed"

	tc-export CC

	OPTTEST=1
	if use amd64 || use x86; then
		$(tc-getCPP) ${CFLAGS} ${CPPFLAGS} -P - <<-EOF &>/dev/null && OPTTEST=0
			#if defined(__SSE2__)
			true
			#else
			#error false
			#endif
		EOF
	fi
}

src_compile() {
	emake OPTTEST="${OPTTEST}" LIBRARY_REL="$(get_libdir)" PREFIX="${EPREFIX}/usr" \
		ARGON2_VERSION="0~${PV}"
}

src_test() {
	emake OPTTEST="${OPTTEST}" test
}

src_install() {
	emake OPTTEST="${OPTTEST}" DESTDIR="${ED}" LIBRARY_REL="$(get_libdir)" install
	einstalldocs
	doman man/argon2.1
}

USE Flags

Manage flags for this package: euse -i <flag> -p app-crypt/argon2 | euse -E <flag> -p app-crypt/argon2 | euse -D <flag> -p app-crypt/argon2

Global/Standard Flags

Inherited Eclasses

Manifest for 20190702

Type File Size Source URLs
DIST argon2-20190702.tar.gz 1505307 bytes https://github.com/P-H-C/phc-winner-argon2/archive/20190702.tar.gz