summaryrefslogtreecommitdiffstats
path: root/external/zxcvbn-c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
commit267c6f2ac71f92999e969232431ba04678e7437e (patch)
tree358c9467650e1d0a1d7227a21dac2e3d08b622b2 /external/zxcvbn-c
parentInitial commit. (diff)
downloadlibreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz
libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'external/zxcvbn-c')
-rw-r--r--external/zxcvbn-c/ExternalProject_zxcvbn-c.mk35
-rw-r--r--external/zxcvbn-c/Makefile14
-rw-r--r--external/zxcvbn-c/Module_zxcvbn-c.mk18
-rw-r--r--external/zxcvbn-c/README.md3
-rw-r--r--external/zxcvbn-c/StaticLibrary_zxcvbn-c.mk26
-rw-r--r--external/zxcvbn-c/UnpackedTarball_zxcvbn-c.mk18
-rw-r--r--external/zxcvbn-c/zxcvbn-c-2.5-do-not-use-stdafx.patch13
7 files changed, 127 insertions, 0 deletions
diff --git a/external/zxcvbn-c/ExternalProject_zxcvbn-c.mk b/external/zxcvbn-c/ExternalProject_zxcvbn-c.mk
new file mode 100644
index 0000000000..51b60a9c2e
--- /dev/null
+++ b/external/zxcvbn-c/ExternalProject_zxcvbn-c.mk
@@ -0,0 +1,35 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,zxcvbn-c))
+
+$(eval $(call gb_ExternalProject_register_targets,zxcvbn-c,\
+ generate-dictionary-nodes \
+))
+
+$(call gb_ExternalProject_get_state_target,zxcvbn-c,generate-dictionary-nodes): \
+ $(call gb_Executable_get_runtime_dependencies,gcc-wrapper) \
+ $(call gb_Executable_get_runtime_dependencies,g++-wrapper) \
+ $(if $(CROSS_COMPILING),$(call gb_ExternalProject_get_target_for_build,zxcvbn-c))
+ $(call gb_Trace_StartRange,zxcvbn-c,EXTERNAL)
+ $(call gb_ExternalProject_run,generate-dictionary-nodes,\
+ $(if $(CROSS_COMPILING),\
+ cp $(WORKDIR_FOR_BUILD)/UnpackedTarball/zxcvbn-c/dict-src.h \
+ $(WORKDIR)/UnpackedTarball/zxcvbn-c/dict-src.h \
+ ,\
+ $(MAKE) dict-src.h \
+ AR="$(gb_AR)" \
+ CFLAGS="$(gb_CFLAGS)" \
+ CXXFLAGS="$(gb_CXXFLAGS)" \
+ $(if $(filter MSC,$(COM)),$(gb_AUTOCONF_WRAPPERS) )\
+ )\
+ )
+ $(call gb_Trace_EndRange,zxcvbn-c,EXTERNAL)
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/zxcvbn-c/Makefile b/external/zxcvbn-c/Makefile
new file mode 100644
index 0000000000..6427d44e37
--- /dev/null
+++ b/external/zxcvbn-c/Makefile
@@ -0,0 +1,14 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/zxcvbn-c/Module_zxcvbn-c.mk b/external/zxcvbn-c/Module_zxcvbn-c.mk
new file mode 100644
index 0000000000..14d5dfbe6a
--- /dev/null
+++ b/external/zxcvbn-c/Module_zxcvbn-c.mk
@@ -0,0 +1,18 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,zxcvbn-c))
+
+$(eval $(call gb_Module_add_targets,zxcvbn-c,\
+ UnpackedTarball_zxcvbn-c \
+ ExternalProject_zxcvbn-c \
+ StaticLibrary_zxcvbn-c \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/zxcvbn-c/README.md b/external/zxcvbn-c/README.md
new file mode 100644
index 0000000000..6193c7307e
--- /dev/null
+++ b/external/zxcvbn-c/README.md
@@ -0,0 +1,3 @@
+C/C++ version of the zxcvbn password strength estimator.
+
+zxcvbn-c is available from [ https://github.com/tsyrogit/zxcvbn-c ].
diff --git a/external/zxcvbn-c/StaticLibrary_zxcvbn-c.mk b/external/zxcvbn-c/StaticLibrary_zxcvbn-c.mk
new file mode 100644
index 0000000000..9748ef850c
--- /dev/null
+++ b/external/zxcvbn-c/StaticLibrary_zxcvbn-c.mk
@@ -0,0 +1,26 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,zxcvbn-c))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,zxcvbn-c,zxcvbn-c))
+
+# zxcvbn-c static library depends on generation of dictionary nodes resulting in dict-src.h
+$(eval $(call gb_StaticLibrary_use_external_project,zxcvbn-c,zxcvbn-c,full))
+
+$(eval $(call gb_StaticLibrary_set_include,zxcvbn-c,\
+ -I$(call gb_UnpackedTarball_get_dir,zxcvbn-c)\
+ $$(INCLUDE)\
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,zxcvbn-c,\
+ UnpackedTarball/zxcvbn-c/zxcvbn \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/zxcvbn-c/UnpackedTarball_zxcvbn-c.mk b/external/zxcvbn-c/UnpackedTarball_zxcvbn-c.mk
new file mode 100644
index 0000000000..b6eba6b8cb
--- /dev/null
+++ b/external/zxcvbn-c/UnpackedTarball_zxcvbn-c.mk
@@ -0,0 +1,18 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,zxcvbn-c))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,zxcvbn-c,$(ZXCVBN_C_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,zxcvbn-c,\
+ external/zxcvbn-c/zxcvbn-c-2.5-do-not-use-stdafx.patch \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/zxcvbn-c/zxcvbn-c-2.5-do-not-use-stdafx.patch b/external/zxcvbn-c/zxcvbn-c-2.5-do-not-use-stdafx.patch
new file mode 100644
index 0000000000..1b51519950
--- /dev/null
+++ b/external/zxcvbn-c/zxcvbn-c-2.5-do-not-use-stdafx.patch
@@ -0,0 +1,13 @@
+--- a/zxcvbn-c/zxcvbn.c
++++ b/zxcvbn-c/zxcvbn.c
+@@ -44,11 +44,6 @@
+ #endif
+ #endif
+
+-/* For pre-compiled headers under windows */
+-#ifdef _WIN32
+-#include "stdafx.h"
+-#endif
+-
+ /* Minimum number of characters in a incrementing/decrementing sequence match */
+ #define MIN_SEQUENCE_LEN 3