commit: 6c78230a2d18b16890c2389533bf45e489a797fd Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Sun Jun 8 00:02:21 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sun Jun 8 00:03:18 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c78230a
dev-libs/zxcvbn-c: new package, add 2.5 I considered blessing it with LO's keywords but I'd like the testsuite to be run once for each arch instead (which is part of why I love unbundling). Bug: https://bugs.gentoo.org/957161 Closes: https://bugs.gentoo.org/916961 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-libs/zxcvbn-c/Manifest | 1 + dev-libs/zxcvbn-c/files/zxcvbn-c-2.5-gcc15.patch | 14 ++++++++++ .../files/zxcvbn-c-2.5-makefile-install.patch | 30 ++++++++++++++++++++++ dev-libs/zxcvbn-c/metadata.xml | 11 ++++++++ dev-libs/zxcvbn-c/zxcvbn-c-2.5.ebuild | 22 ++++++++++++++++ 5 files changed, 78 insertions(+) diff --git a/dev-libs/zxcvbn-c/Manifest b/dev-libs/zxcvbn-c/Manifest new file mode 100644 index 000000000000..d338281e13c8 --- /dev/null +++ b/dev-libs/zxcvbn-c/Manifest @@ -0,0 +1 @@ +DIST zxcvbn-c-2.5.gh.tar.gz 1404434 BLAKE2B f0f22fc8643f785e8f9ed42033d6654c2e67aa4e258bbc4fecf533efcf8b86b6d7e67f9042326247c311c42a4e2b24b844e0bae65cdb2e46ea043a2974ffd857 SHA512 d7199b3cc36cd0e401bd8f857132425908307aefcdb1bb635ee81c34cf71ccbcdf0fe36a336a55da1281692b508881b54773afa41379a448863095f4abd5c0e8 diff --git a/dev-libs/zxcvbn-c/files/zxcvbn-c-2.5-gcc15.patch b/dev-libs/zxcvbn-c/files/zxcvbn-c-2.5-gcc15.patch new file mode 100644 index 000000000000..f57969f78cfb --- /dev/null +++ b/dev-libs/zxcvbn-c/files/zxcvbn-c-2.5-gcc15.patch @@ -0,0 +1,14 @@ +https://bugs.gentoo.org/957161 +https://github.com/tsyrogit/zxcvbn-c/commit/b9f30993c88d9057d7d95a1b059989f7853fd1b0 +https://src.fedoraproject.org/rpms/zxcvbn-c/blob/rawhide/f/gcc15-c++23_fix.patch + +--- a/dict-generate.cpp ++++ b/dict-generate.cpp +@@ -22,6 +22,7 @@ + * + **********************************************************************************/ + ++#include <cstdint> + #include <iostream> + #include <string> + #include <fstream> diff --git a/dev-libs/zxcvbn-c/files/zxcvbn-c-2.5-makefile-install.patch b/dev-libs/zxcvbn-c/files/zxcvbn-c-2.5-makefile-install.patch new file mode 100644 index 000000000000..a45138e6f3f4 --- /dev/null +++ b/dev-libs/zxcvbn-c/files/zxcvbn-c-2.5-makefile-install.patch @@ -0,0 +1,30 @@ +Based on rpm/libzxcvbn-2.4-makefile-install.patch in the upstream repo. +--- a/makefile ++++ b/makefile +@@ -13,6 +13,8 @@ CPPFLAGS += -I. + TARGET_LIB = libzxcvbn.so.0.0.0 + SONAME = libzxcvbn.so.0 + ++LIBDIR := $(or $(LIBDIR),$(/usr/lib)) ++ + WORDS = words-eng_wiki.txt words-female.txt words-male.txt words-passwd.txt words-surname.txt words-tv_film.txt + + all: test-file test-inline test-c++inline test-c++file test-shlib test-statlib test-internals +@@ -101,6 +103,17 @@ test: test-internals test-file test-inline test-c++inline test-c++file test-shli + ./test-c++inline -t testcases.txt + @echo Finished + ++package: $(TARGET_LIB) libzxcvbn.a dict-crc.h dict-src.h ++ ++install: package ++ mkdir -p $(DESTDIR)/usr/include/zxcvbn $(DESTDIR)/usr/share/zxcvbn $(DESTDIR)/usr/bin $(DESTDIR)$(LIBDIR) ++ install -m 0644 *.h $(DESTDIR)/usr/include/zxcvbn ++ install -m 0644 $(TARGET_LIB) libzxcvbn.a $(DESTDIR)$(LIBDIR) ++ ln -s $(TARGET_LIB) $(DESTDIR)$(LIBDIR)/$(SONAME) ++ ln -s $(SONAME) $(basename $(DESTDIR)$(LIBDIR)/$(SONAME)) ++ install -m 0755 dictgen $(DESTDIR)/usr/bin/zxcvbn-dictgen ++ install -m 0644 zxcvbn.dict $(DESTDIR)/usr/share/zxcvbn ++ + clean: + rm -f test-file zxcvbn-file.o test-c++file zxcvbn-c++file.o + rm -f test-inline test-internals zxcvbn-inline.o zxcvbn-inline-pic.o test-c++inline zxcvbn-c++inline.o diff --git a/dev-libs/zxcvbn-c/metadata.xml b/dev-libs/zxcvbn-c/metadata.xml new file mode 100644 index 000000000000..46af6cef0a27 --- /dev/null +++ b/dev-libs/zxcvbn-c/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>[email protected]</email> + <name>Gentoo Office project</name> + </maintainer> + <upstream> + <remote-id type="github">tsyrogit/zxcvbn-c</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-libs/zxcvbn-c/zxcvbn-c-2.5.ebuild b/dev-libs/zxcvbn-c/zxcvbn-c-2.5.ebuild new file mode 100644 index 000000000000..30116a977b3c --- /dev/null +++ b/dev-libs/zxcvbn-c/zxcvbn-c-2.5.ebuild @@ -0,0 +1,22 @@ +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="C/C++ version of the zxcvbn password strength estimator" +HOMEPAGE="https://github.com/tsyrogit/zxcvbn-c" +SRC_URI="https://github.com/tsyrogit/zxcvbn-c/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" + +PATCHES=( + "${FILESDIR}"/${P}-gcc15.patch + "${FILESDIR}"/${PN}-2.5-makefile-install.patch +) + +src_install() { + emake DESTDIR="${ED}" LIBDIR="/usr/$(get_libdir)" install + rm "${ED}/usr/$(get_libdir)/libzxcvbn.a" || die +}
