sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (53956ec3941749eb777cfe17eced9c3d72a388b3)
- From: Ismael Luceno <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
- Subject: [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (53956ec3941749eb777cfe17eced9c3d72a388b3)
- Date: Sat, 25 Jan 2025 23:20:08 +0000
GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:
ChangeLog
| 3
doc/mupdf/HISTORY
| 3
doc/mupdf/TRIGGERS
| 1
gnome2-apps/xournal/DETAILS
| 1
gnome2-apps/xournal/HISTORY
| 7
gnome2-apps/xournal/PRE_BUILD
| 3
gnome2-apps/xournal/patches/0001-Fix-build-with-clang16.patch
| 26 ++
gnome2-apps/xournal/patches/0001-Fix-implicit-function-declarations-by-including-config.h-in-ttsubset-.c.patch
| 64 ++++++
gnome2-apps/xournal/patches/0001-Preserve-aspect-ratio-when-resizing.patch
| 87 ++++++++
gnu/gcc/HISTORY
| 3
gnu/gcc/INSTALL
| 6
libs/zxcvbn-c/CONFIGURE
| 1
libs/zxcvbn-c/DEPENDS
| 1
libs/zxcvbn-c/DETAILS
| 45 ++++
libs/zxcvbn-c/HISTORY
| 5
libs/zxcvbn-c/PRE_BUILD
| 3
libs/zxcvbn-c/patches/0001-add-cmake-support-equivalent-to-the-original-makefil.patch
| 100 ++++++++++
libs/zxcvbn-c/patches/0002-Changed-the-compiler-warning-option-to-stop-warning-.patch
| 28 ++
libs/zxcvbn-c/patches/0003-Add-CMake-installation-rules.patch
| 25 ++
19 files changed, 410 insertions(+), 2 deletions(-)
New commits:
commit 53956ec3941749eb777cfe17eced9c3d72a388b3
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>
zxcvbn-c: new spell, Low-budget password strength estimator
commit 500009d77b012586c401ac12d17d88ee877830b8
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>
xournal: Fix build with GCC 14; PATCHLEVEL++
commit 7fc6c5ef8dd43b1430704a3abb9c91766e9316fd
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>
mupdf: Add trigger for gumbo-parser
commit 1c385deb871bf879e10b9a8012aacbb90cc7f1a1
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>
gcc: Add standard symlinks
diff --git a/ChangeLog b/ChangeLog
index 95e577c..730c7d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2025-01-25 Ismael Luceno <ismael AT sourcemage.org>
+ * libs/zxcvbn-c: new spell, Low-budget password strength estimator
+
2025-01-26 Justin Boffemmyer <flux AT sourcemage.org>
* wm-addons/tofi: new spell, fast and minimal Wayland launcher
diff --git a/doc/mupdf/HISTORY b/doc/mupdf/HISTORY
index d4c9f19..df7deee 100644
--- a/doc/mupdf/HISTORY
+++ b/doc/mupdf/HISTORY
@@ -1,3 +1,6 @@
+2025-01-25 Ismael Luceno <ismael AT sourcemage.org>
+ * TRIGGERS: added check_self for gumbo-parser
+
2025-01-17 Treeve Jelbert <treeve AT sourcemage.org>
* DETAILS: version 1.25.2
diff --git a/doc/mupdf/TRIGGERS b/doc/mupdf/TRIGGERS
new file mode 100755
index 0000000..b71bad3
--- /dev/null
+++ b/doc/mupdf/TRIGGERS
@@ -0,0 +1 @@
+on_cast gumbo-parser check_self
diff --git a/gnome2-apps/xournal/DETAILS b/gnome2-apps/xournal/DETAILS
index d20de00..b07833a 100755
--- a/gnome2-apps/xournal/DETAILS
+++ b/gnome2-apps/xournal/DETAILS
@@ -1,5 +1,6 @@
SPELL=xournal
VERSION=0.4.8.2016
+ PATCHLEVEL=1
SOURCE="${SPELL}-${VERSION}.tar.gz"
SOURCE_URL[0]="http://downloads.sourceforge.net/sourceforge/project/${SPELL}/${SPELL}/${VERSION}/${SOURCE}"
SOURCE_HASH=sha512:1426d5c9ba3486fbe342d49fc19fcc162965cd6a7b7754f79665e43fe0e60e6f42f61969405ace78fdaa7b99cbb3d4b07b7fb5df246d68a329b52084b6eec76e
diff --git a/gnome2-apps/xournal/HISTORY b/gnome2-apps/xournal/HISTORY
index bb62c2f..03a17f5 100644
--- a/gnome2-apps/xournal/HISTORY
+++ b/gnome2-apps/xournal/HISTORY
@@ -1,3 +1,10 @@
+2025-01-25 Ismael Luceno <ismael AT sourcemage.org>
+ * PRE_BUILD, patches/0001-Fix-build-with-clang16.patch,
+
patches/0001-Fix-implicit-function-declarations-by-including-config.h-in-ttsubset-.c.patch,
+ patches/0001-Preserve-aspect-ratio-when-resizing.patch:
+ fixed build with GCC 14
+ * DETAILS: PATCHLEVEL++
+
2021-05-27 Ismael Luceno <ismael AT sourcemage.org>
* DETAILS: updated spell to 0.4.8.2016
* BUILD: forced -O2 due to linking issues with GCC 11
diff --git a/gnome2-apps/xournal/PRE_BUILD b/gnome2-apps/xournal/PRE_BUILD
new file mode 100755
index 0000000..32c0555
--- /dev/null
+++ b/gnome2-apps/xournal/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+apply_patch_dir patches
diff --git a/gnome2-apps/xournal/patches/0001-Fix-build-with-clang16.patch
b/gnome2-apps/xournal/patches/0001-Fix-build-with-clang16.patch
new file mode 100644
index 0000000..8c7db7f
--- /dev/null
+++ b/gnome2-apps/xournal/patches/0001-Fix-build-with-clang16.patch
@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ian Jordan <immoloism AT gmail.com>
+Date: Wed, 7 Dec 2022 13:19:52 +0000
+Subject: [PATCH] Fix build with clang16
+
+Add missing include directives for make_dashed, set_cursor_busy.
+
+Ref: https://bugs.gentoo.org/875158
+Origin: Gentoo
+Upstream-Status: Unknown
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ src/xo-image.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/src/xo-image.c
++++ b/src/xo-image.c
+@@ -25,6 +25,8 @@
+ #include "xo-support.h"
+ #include "xo-image.h"
+ #include "xo-misc.h"
++#include "xo-selection.h"
++#include "xo-paint.h"
+
+ // create pixbuf from buffer, or return NULL on failure
+ GdkPixbuf *pixbuf_from_buffer(const gchar *buf, gsize buflen)
diff --git
a/gnome2-apps/xournal/patches/0001-Fix-implicit-function-declarations-by-including-config.h-in-ttsubset-.c.patch
b/gnome2-apps/xournal/patches/0001-Fix-implicit-function-declarations-by-including-config.h-in-ttsubset-.c.patch
new file mode 100644
index 0000000..8118a02
--- /dev/null
+++
b/gnome2-apps/xournal/patches/0001-Fix-implicit-function-declarations-by-including-config.h-in-ttsubset-.c.patch
@@ -0,0 +1,64 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Denis Auroux <auroux AT users.sourceforge.net>
+Date: Sun, 24 Jan 2021 15:48:16 -0500
+Subject: [PATCH] Fix implicit function declarations by including config.h in
ttsubset/*.c
+
+Ref: https://bugs.gentoo.org/875158
+Origin: Fedora
+Upstream-Status: Unknown
+[ismael AT sourcemage.org: Normalised and simplified the patch]
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ src/ttsubset/list.c | 4 ++++
+ src/ttsubset/sft.c | 4 ++++
+ src/ttsubset/ttcr.c | 4 ++++
+ 3 files changed, 12 insertions(+)
+
+diff --git a/src/ttsubset/list.c b/src/ttsubset/list.c
+index 0cf958e43468c5ee..6b764ae7dabbe0ef 100644
+--- a/src/ttsubset/list.c
++++ b/src/ttsubset/list.c
+@@ -44,6 +44,10 @@
+ *
+ */
+
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <stdlib.h>
+ #include <assert.h>
+ #ifdef MALLOC_TRACE
+diff --git a/src/ttsubset/sft.c b/src/ttsubset/sft.c
+index 249fbdf03b074575..678359eb580f9b56 100644
+--- a/src/ttsubset/sft.c
++++ b/src/ttsubset/sft.c
+@@ -43,6 +43,10 @@
+ * @version 1.0
+ */
+
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <assert.h>
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/src/ttsubset/ttcr.c b/src/ttsubset/ttcr.c
+index eecfcade1a5f1b5d..38962def32de00c3 100644
+--- a/src/ttsubset/ttcr.c
++++ b/src/ttsubset/ttcr.c
+@@ -44,6 +44,10 @@
+ *
+ */
+
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <sys/types.h>
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+--
+Fixed up by sm-checkpatch 0.1
+
diff --git
a/gnome2-apps/xournal/patches/0001-Preserve-aspect-ratio-when-resizing.patch
b/gnome2-apps/xournal/patches/0001-Preserve-aspect-ratio-when-resizing.patch
new file mode 100644
index 0000000..0b8afeb
--- /dev/null
+++
b/gnome2-apps/xournal/patches/0001-Preserve-aspect-ratio-when-resizing.patch
@@ -0,0 +1,87 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: David Barton <db9052 AT users.sourceforge.net>
+Subject: [PATCH] Preserve aspect ratio when resizing
+Date: Sat, 25 Jan 2025 23:55:40 +0100
+
+Allow the aspect ratio to be preserved when resizing selections, using the
+right mouse button (button-3) rather than the left mouse button.
+
+Forward-port upstream patch submission.
+
+It applies cleanly, just to xo-selection.c instead of xo-paint.c.
+
+Signed-off-by: Robin H. Johnson <robbat2 AT gentoo.org>
+Upstream-Status: Submitted [https://sourceforge.net/p/xournal/patches/58/]
+[ismael AT sourcemage.org: Normalised the patch]
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ src/xo-selection.c | 38 ++++++++++++++++++++++++++++++++++++++
+ src/xournal.h | 1 +
+ 2 files changed, 39 insertions(+)
+
+diff -Narpu --exclude '*.orig' --exclude '*.rej' --exclude '*~'
xournal-0.4.8.orig/src/xo-selection.c xournal-0.4.8/src/xo-selection.c
+--- xournal-0.4.8.orig/src/xo-selection.c 2014-06-06 16:41:45.000000000
-0700
++++ xournal-0.4.8/src/xo-selection.c 2017-02-09 15:31:08.960817336 -0800
+@@ -347,6 +347,12 @@ gboolean start_resizesel(GdkEvent *event
+ ui.selection->new_x2 = ui.selection->bbox.right;
+ gnome_canvas_item_set(ui.selection->canvas_item, "dash", NULL, NULL);
+ update_cursor_for_resize(pt);
++
++ // Check whether we should preserve the aspect ratio
++ if (event->button.button == 3)
++ ui.cur_brush->tool_options |= TOOLOPT_SELECT_PRESERVE;
++ else
++ ui.cur_brush->tool_options &= ~TOOLOPT_SELECT_PRESERVE;
+ return TRUE;
+ }
+ return FALSE;
+@@ -498,6 +504,38 @@ void continue_resizesel(GdkEvent *event)
+ if (ui.selection->resizing_left) ui.selection->new_x1 = pt[0];
+ if (ui.selection->resizing_right) ui.selection->new_x2 = pt[0];
+
++ if (ui.cur_brush->tool_options & TOOLOPT_SELECT_PRESERVE) {
++ double aspectratio = (ui.selection->bbox.top -
ui.selection->bbox.bottom)/(ui.selection->bbox.right -
ui.selection->bbox.left);
++ double newheight = ui.selection->new_y1 - ui.selection->new_y2;
++ double newwidth = ui.selection->new_x2 - ui.selection->new_x1;
++ gboolean boundheight;
++
++ // Resizing from top or bottom only
++ if ((ui.selection->resizing_top || ui.selection->resizing_bottom)
&& !(ui.selection->resizing_left || ui.selection->resizing_right))
++ boundheight = 0;
++ // Resizing from right or left only
++ else if (!(ui.selection->resizing_top ||
ui.selection->resizing_bottom) && (ui.selection->resizing_left ||
ui.selection->resizing_right))
++ boundheight = 1;
++ // Resizing from a corner
++ else if (newheight/aspectratio > newwidth)
++ boundheight = 0;
++ else
++ boundheight = 1;
++
++ if (boundheight) {
++ // Bound the height
++ newheight = newwidth*aspectratio;
++ if (ui.selection->resizing_top) ui.selection->new_y1 =
ui.selection->new_y2 + newheight;
++ else ui.selection->new_y2 = ui.selection->new_y1 -
newheight;
++ }
++ else {
++ // Bound the width
++ newwidth = newheight/aspectratio;
++ if (ui.selection->resizing_left) ui.selection->new_x1 =
ui.selection->new_x2 - newwidth;
++ else ui.selection->new_x2 = ui.selection->new_x1 + newwidth;
++ }
++ }
++
+ gnome_canvas_item_set(ui.selection->canvas_item,
+ "x1", ui.selection->new_x1, "x2", ui.selection->new_x2,
+ "y1", ui.selection->new_y1, "y2", ui.selection->new_y2, NULL);
+diff -Narpu --exclude '*.orig' --exclude '*.rej' --exclude '*~'
xournal-0.4.8.orig/src/xournal.h xournal-0.4.8/src/xournal.h
+--- xournal-0.4.8.orig/src/xournal.h 2014-06-28 12:47:20.000000000 -0700
++++ xournal-0.4.8/src/xournal.h 2017-02-09 15:29:08.866517375 -0800
+@@ -154,6 +154,7 @@ extern guint predef_bgcolors_rgba[COLOR_
+ #define TOOLOPT_ERASER_STANDARD 0
+ #define TOOLOPT_ERASER_WHITEOUT 1
+ #define TOOLOPT_ERASER_STROKES 2
++#define TOOLOPT_SELECT_PRESERVE 1 // Preserve the aspect ratio of the
selection when resizing
+
+ extern double predef_thickness[NUM_STROKE_TOOLS][THICKNESS_MAX];
+
diff --git a/gnu/gcc/HISTORY b/gnu/gcc/HISTORY
index ba22547..e95e537 100644
--- a/gnu/gcc/HISTORY
+++ b/gnu/gcc/HISTORY
@@ -1,3 +1,6 @@
+2025-01-25 Ismael Luceno <ismael AT sourcemage.org>
+ * INSTALL: added missing standard symlinks (c89, c99, c17)
+
2024-08-31 Ismael Luceno <ismael AT sourcemage.org>
* BUILD, CONFIGURE: added knob to make a portable/generic build
* DETAILS: PATCHLEVEL++
diff --git a/gnu/gcc/INSTALL b/gnu/gcc/INSTALL
index 136c120..6e74bd6 100755
--- a/gnu/gcc/INSTALL
+++ b/gnu/gcc/INSTALL
@@ -9,8 +9,10 @@ make CFLAGS="$CFLAGS" BOOT_CFLAGS="$CFLAGS"
LDFLAGS="$LDFLAGS" \
install &&
make_normal &&
-# no symlink to cc
-ln -vsf $INSTALL_ROOT/usr/bin/gcc $INSTALL_ROOT/usr/bin/cc &&
+# add standard symlinks
+for i in cc c89 c99 c17; do
+ ln -vsf gcc "$INSTALL_ROOT/usr/bin/$i" || return 1
+done &&
if [[ "$HOST" == x86_64-* ]]; then
[ -d /lib64 -a ! -f /lib/ld-linux-x86-64.so.2 -a -f
/lib64/ld-linux-x86-64.so.2 ] &&
diff --git a/libs/zxcvbn-c/CONFIGURE b/libs/zxcvbn-c/CONFIGURE
new file mode 100755
index 0000000..b1e2770
--- /dev/null
+++ b/libs/zxcvbn-c/CONFIGURE
@@ -0,0 +1 @@
+. "$GRIMOIRE"/CMAKE_CONFIGURE
diff --git a/libs/zxcvbn-c/DEPENDS b/libs/zxcvbn-c/DEPENDS
new file mode 100755
index 0000000..bd2c258
--- /dev/null
+++ b/libs/zxcvbn-c/DEPENDS
@@ -0,0 +1 @@
+. "$GRIMOIRE"/CMAKE_DEPENDS
diff --git a/libs/zxcvbn-c/DETAILS b/libs/zxcvbn-c/DETAILS
new file mode 100755
index 0000000..5952f35
--- /dev/null
+++ b/libs/zxcvbn-c/DETAILS
@@ -0,0 +1,45 @@
+. "$GRIMOIRE"/CMAKE_FUNCTIONS
+ SPELL=zxcvbn-c
+ VERSION=2.5
+ SOURCE="$SPELL-$VERSION.tar.gz"
+
SOURCE_URL[0]=https://github.com/tsyrogit/$SPELL/archive/refs/tags/v$VERSION.tar.gz
+
SOURCE_HASH=sha512:d7199b3cc36cd0e401bd8f857132425908307aefcdb1bb635ee81c34cf71ccbcdf0fe36a336a55da1281692b508881b54773afa41379a448863095f4abd5c0e8
+SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
+ WEB_SITE="https://github.com/tsyrogit/zxcvbn-c"
+ LICENSE[0]="MIT"
+ ENTERED=20250123
+ KEYWORDS=""
+ SHORT="Low-budget password strength estimator"
+cat << EOF
+This is a C/C++ implementation of the zxcvbn password strength estimation.
+
+zxcvbn is a password strength estimator inspired by password crackers.
Through
+pattern matching and conservative estimation, it recognizes and weighs 30k
+common passwords, common names and surnames according to US census data,
+popular English words from Wikipedia and US television and movies, and other
+common patterns like dates, repeats (aaa), sequences (abcd), keyboard
patterns
+(qwertyuiop), and l33t speak.
+
+Consider using zxcvbn as an algorithmic alternative to password composition
+policy — it is more secure, flexible, and usable when sites require a
+minimal complexity score in place of annoying rules like "passwords must
+contain three of: lower, upper, numbers, symbols".
+
+* More secure: policies often fail both ways, allowing weak passwords
+ (P@ssword1) and disallowing strong passwords.
+* More flexible: zxcvbn allows many password styles to flourish so long as it
+ detects sufficient complexity — passphrases are rated highly given enough
+ uncommon words, keyboard patterns are ranked based on length and number
+ of turns, and capitalization adds more complexity when it's unpredictaBle.
+* More usable: zxcvbn is designed to power simple, rule-free interfaces that
+ give instant feedback. In addition to strength estimation, zxcvbn includes
+ minimal, targeted verbal feedback that can help guide users towards less
+ guessable passwords.
+
+Like the original this code is for character sets which use single byte
+characters primarily in the code range 0x20 to 0x7E.
+
+For further detail and motivation, please refer to:
+*
https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/wheeler
+*
https://blogs.dropbox.com/tech/2012/04/zxcvbn-realistic-password-strength-estimation/
+EOF
diff --git a/libs/zxcvbn-c/HISTORY b/libs/zxcvbn-c/HISTORY
new file mode 100644
index 0000000..e672aa6
--- /dev/null
+++ b/libs/zxcvbn-c/HISTORY
@@ -0,0 +1,5 @@
+2025-01-25 Ismael Luceno <ismael AT sourcemage.org>
+ * CONFIGURE, DEPENDS, DETAILS, PRE_BUILD,
+
patches/0001-add-cmake-support-equivalent-to-the-original-makefil.patch,
+
patches/0002-Changed-the-compiler-warning-option-to-stop-warning-.patch,
+ patches/0003-Add-CMake-installation-rules.patch: spell created
diff --git a/libs/zxcvbn-c/PRE_BUILD b/libs/zxcvbn-c/PRE_BUILD
new file mode 100755
index 0000000..c230ad1
--- /dev/null
+++ b/libs/zxcvbn-c/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+apply_patch_dir patches
diff --git
a/libs/zxcvbn-c/patches/0001-add-cmake-support-equivalent-to-the-original-makefil.patch
b/libs/zxcvbn-c/patches/0001-add-cmake-support-equivalent-to-the-original-makefil.patch
new file mode 100644
index 0000000..12ea882
--- /dev/null
+++
b/libs/zxcvbn-c/patches/0001-add-cmake-support-equivalent-to-the-original-makefil.patch
@@ -0,0 +1,100 @@
+From d5ef1234ed0624cb5eb1449b141b2d2636e82a85 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= <hana.dusikova AT gendigital.com>
+Date: Thu, 20 Jul 2023 08:39:21 +0200
+Subject: [PATCH 1/3] add cmake support equivalent to the original makefile
+
+Upstream-Status: Backport
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ CMakeLists.txt | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 79 insertions(+)
+ create mode 100644 CMakeLists.txt
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+new file mode 100644
+index 000000000000..9cf0ef78d329
+--- /dev/null
++++ b/CMakeLists.txt
+@@ -0,0 +1,79 @@
++cmake_minimum_required(VERSION 3.14)
++
++project(zxcvbn-c VERSION 0 LANGUAGES C CXX)
++
++add_executable(dictgen dict-generate.cpp)
++target_compile_features(dictgen PUBLIC cxx_std_11)
++target_compile_options(dictgen PRIVATE "-O3")
++
++add_compile_options("-Wextra" "-Wdeclaration-after-statement")
++
++find_library(LIBM m)
++
++# list of dictionaries
++set(WORDS words-eng_wiki.txt words-female.txt words-male.txt
words-passwd.txt words-surname.txt words-tv_film.txt)
++list(TRANSFORM WORDS PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/)
++
++# generate dict-src.h and dict-crc.h
++add_custom_command(OUTPUT dict-src.h COMMAND dictgen -o
${CMAKE_CURRENT_BINARY_DIR}/dict-src.h ${WORDS} DEPENDS dictgen ${WORDS}
COMMENT "Generating dict-src.h")
++
++add_custom_command(OUTPUT dict-crc.h zxcvbn.dict COMMAND dictgen -b -o
${CMAKE_CURRENT_BINARY_DIR}/zxcvbn.dict -h
${CMAKE_CURRENT_BINARY_DIR}/dict-crc.h ${WORDS} DEPENDS dictgen ${WORDS}
COMMENT "Generating dict-crc.h")
++
++# build shared version of library
++add_library(zxcvbn-shared SHARED zxcvbn.c dict-crc.h dict-src.h)
++target_include_directories(zxcvbn-shared PRIVATE
${CMAKE_CURRENT_BINARY_DIR})
++target_include_directories(zxcvbn-shared PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
++target_link_libraries(zxcvbn-shared PUBLIC ${LIBM})
++set_target_properties(zxcvbn-shared PROPERTIES
++ POSITION_INDEPENDENT_CODE ON
++ OUTPUT_NAME zxcvbn
++ VERSION ${CMAKE_PROJECT_VERSION}
++ SOVERSION ${PROJECT_VERSION_MAJOR}
++)
++
++# build static version of library
++add_library(zxcvbn-static STATIC zxcvbn.c dict-crc.h dict-src.h)
++target_include_directories(zxcvbn-static PRIVATE
${CMAKE_CURRENT_BINARY_DIR} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
++target_link_libraries(zxcvbn-static PUBLIC ${LIBM})
++set_target_properties(zxcvbn-static PROPERTIES OUTPUT_NAME zxcvbn)
++
++# in root projects we also want to build/run tests...
++if(PROJECT_IS_TOP_LEVEL)
++
++ # C tests
++ add_executable(test-internals test-internals.c dict-src.h dict-crc.h
zxcvbn.h)
++ target_include_directories(test-internals PRIVATE
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
++ target_link_libraries(test-internals PUBLIC ${LIBM})
++
++ add_executable(test-file test.c zxcvbn.c dict-src.h dict-crc.h
zxcvbn.h)
++ target_compile_definitions(test-file PRIVATE USE_DICT_FILE)
++ target_include_directories(test-file PRIVATE
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
++ target_link_libraries(test-file PUBLIC ${LIBM})
++
++ add_executable(test-inline test.c zxcvbn.c dict-src.h dict-crc.h
zxcvbn.h)
++ target_include_directories(test-inline PRIVATE
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
++ target_link_libraries(test-inline PUBLIC ${LIBM})
++
++ # C++ tests
++ file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/zxcvbn.c
${CMAKE_CURRENT_BINARY_DIR}/zxcvbn.cpp SYMBOLIC)
++ file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/test.c
${CMAKE_CURRENT_BINARY_DIR}/test.cpp SYMBOLIC)
++
++ add_executable(test-c++file ${CMAKE_CURRENT_BINARY_DIR}/test.cpp
${CMAKE_CURRENT_BINARY_DIR}/zxcvbn.cpp dict-src.h dict-crc.h zxcvbn.h)
++ target_compile_definitions(test-c++file PRIVATE USE_DICT_FILE)
++ target_include_directories(test-c++file PRIVATE
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
++ target_link_libraries(test-c++file PUBLIC ${LIBM})
++
++ add_executable(test-c++inline ${CMAKE_CURRENT_BINARY_DIR}/test.cpp
${CMAKE_CURRENT_BINARY_DIR}/zxcvbn.cpp dict-src.h dict-crc.h zxcvbn.h)
++ target_include_directories(test-c++inline PRIVATE
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
++ target_link_libraries(test-c++inline PUBLIC ${LIBM})
++
++ # libraries tests
++ add_executable(test-shlib test.c)
++ target_link_libraries(test-shlib zxcvbn-shared)
++
++ add_executable(test-statlib test.c)
++ target_link_libraries(test-statlib zxcvbn-static)
++
++ # test target
++ add_custom_target(test COMMAND test-internals COMMAND test-file
COMMAND test-inline COMMAND test-c++inline COMMAND test-c++file COMMAND
test-shlib COMMAND test-statlib DEPENDS testcases.txt)
++endif()
+--
+2.47.1
+
diff --git
a/libs/zxcvbn-c/patches/0002-Changed-the-compiler-warning-option-to-stop-warning-.patch
b/libs/zxcvbn-c/patches/0002-Changed-the-compiler-warning-option-to-stop-warning-.patch
new file mode 100644
index 0000000..8bf696a
--- /dev/null
+++
b/libs/zxcvbn-c/patches/0002-Changed-the-compiler-warning-option-to-stop-warning-.patch
@@ -0,0 +1,28 @@
+From 271f4f68f5970cb9ca0aa90d2a096edb9d34630c Mon Sep 17 00:00:00 2001
+From: tony <tsyrogit AT users.noreply.github.com>
+Date: Fri, 11 Aug 2023 22:28:15 +0100
+Subject: [PATCH 2/3] Changed the compiler warning option to stop warning
about
+ invalid option for c++ files. Occurred when using cmake and gcc version
12.3.
+
+Upstream-Status: Backport
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9cf0ef78d329..78d2cd8dce03 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,7 +6,7 @@ add_executable(dictgen dict-generate.cpp)
+ target_compile_features(dictgen PUBLIC cxx_std_11)
+ target_compile_options(dictgen PRIVATE "-O3")
+
+-add_compile_options("-Wextra" "-Wdeclaration-after-statement")
++add_compile_options("-Wall" "-Wextra")
+
+ find_library(LIBM m)
+
+--
+2.47.1
+
diff --git a/libs/zxcvbn-c/patches/0003-Add-CMake-installation-rules.patch
b/libs/zxcvbn-c/patches/0003-Add-CMake-installation-rules.patch
new file mode 100644
index 0000000..da3a9d3
--- /dev/null
+++ b/libs/zxcvbn-c/patches/0003-Add-CMake-installation-rules.patch
@@ -0,0 +1,25 @@
+From fea35625329d3184c5523ecf11597499a0c0fe9b Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT iodev.co.uk>
+Date: Thu, 23 Jan 2025 00:46:35 +0100
+Subject: [PATCH 3/3] Add CMake installation rules
+
+Upstream-Status: Pending
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ CMakeLists.txt | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 78d2cd8dce03..5ab8b92d379d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -77,3 +77,6 @@ if(PROJECT_IS_TOP_LEVEL)
+ # test target
+ add_custom_target(test COMMAND test-internals COMMAND test-file
COMMAND test-inline COMMAND test-c++inline COMMAND test-c++file COMMAND
test-shlib COMMAND test-statlib DEPENDS testcases.txt)
+ endif()
++
++install(TARGETS zxcvbn-shared zxcvbn-static DESTINATION lib)
++install(FILES zxcvbn.h DESTINATION include)
+--
+2.47.1
+
- [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (53956ec3941749eb777cfe17eced9c3d72a388b3), Ismael Luceno, 01/25/2025
Archive powered by MHonArc 2.6.24.