libxcrypt: 4.4.30 (#33845)

* libxcrypt: 4.4.30

* libxcrypt.so.2 by default

* add libs prop, since libxcrypt provides libcrypt
This commit is contained in:
Harmen Stoppels 2022-11-11 22:22:17 +01:00 committed by GitHub
parent 022a2d2eaf
commit 368dde437a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 5 deletions

View File

@ -10,13 +10,38 @@ class Libxcrypt(AutotoolsPackage):
"""libxcrypt is a modern library for one-way hashing of passwords."""
homepage = "https://github.com/besser82/libxcrypt"
url = "https://github.com/besser82/libxcrypt/archive/v4.4.17.tar.gz"
url = "https://github.com/besser82/libxcrypt/releases/download/v4.4.30/libxcrypt-4.4.30.tar.xz"
def url_for_version(self, version):
if version <= Version("4.4.17"):
return "https://github.com/besser82/libxcrypt/archive/v{}.tar.gz".format(version)
return "https://github.com/besser82/libxcrypt/releases/download/v{}/libxcrypt-{}.tar.xz".format(
version, version
)
version("4.4.30", sha256="b3667f0ba85daad6af246ba4090fbe53163ad93c8b6a2a1257d22a78bb7ceeba")
version("4.4.17", sha256="7665168d0409574a03f7b484682e68334764c29c21ca5df438955a381384ca07")
version("4.4.16", sha256="a98f65b8baffa2b5ba68ee53c10c0a328166ef4116bce3baece190c8ce01f375")
version("4.4.15", sha256="8bcdef03bc65f9dbda742e56820435b6f13eea59fb903765141c6467f4655e5a")
depends_on("autoconf", type="build")
depends_on("automake", type="build")
depends_on("libtool", type="build")
depends_on("m4", type="build")
variant("obsolete_api", default=False, when="@4.4.30:")
patch("truncating-conversion.patch", when="@4.4.30")
def configure_args(self):
# Disable test dependency on Python (Python itself depends on libxcrypt).
args = [
"ac_cv_path_python3_passlib=not found",
]
args += self.enable_or_disable("obsolete-api", variant="obsolete_api")
return args
@property
def libs(self):
return find_libraries("libcrypt", root=self.prefix, recursive=True)
with when("@:4.4.17"):
depends_on("autoconf", type="build")
depends_on("automake", type="build")
depends_on("libtool", type="build")
depends_on("m4", type="build")

View File

@ -0,0 +1,13 @@
diff --git a/lib/alg-yescrypt-opt.c b/lib/alg-yescrypt-opt.c
index 60a6ccd..a33c6e4 100644
--- a/lib/alg-yescrypt-opt.c
+++ b/lib/alg-yescrypt-opt.c
@@ -514,7 +514,7 @@ static volatile uint64_t Smask2var = Smask2;
#define PWXFORM_SIMD(X) { \
uint64_t x; \
FORCE_REGALLOC_1 \
- uint32_t lo = x = EXTRACT64(X) & Smask2reg; \
+ uint32_t lo = (uint32_t)(x = ((uint64_t)EXTRACT64(X)) & Smask2reg); \
FORCE_REGALLOC_2 \
uint32_t hi = x >> 32; \
X = _mm_mul_epu32(HI32(X), X); \