From 80da576240caac2a0c746288868e9c10b6c46342 Mon Sep 17 00:00:00 2001 From: Brent Spillner Date: Sun, 3 Dec 2023 17:47:23 +1000 Subject: [PATCH] libraries/wxWidgets: Autodetect NanoSVG. Signed-off-by: Willy Sudiarto Raharjo --- libraries/wxWidgets/README | 7 +++++++ libraries/wxWidgets/wxWidgets.SlackBuild | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/libraries/wxWidgets/README b/libraries/wxWidgets/README index 16c1bd01a3..441c51d749 100644 --- a/libraries/wxWidgets/README +++ b/libraries/wxWidgets/README @@ -5,6 +5,13 @@ controls and utilities. webkit2gtk is an optional dependency of this package. This will provide webview support. +nanosvg is another optional dependency. By default, the +SlackBuild script checks for the nanosvg system headers and +disables SVG support if they are not found; you can force +different behavior (e.g. using wxWidgets' internal copy of +nanosvg, or always disabling SVG support) with the "NANOSVG" +environment variable (see wxWidgets.SlackBuild for details). + Notes: 1. This package is NOT built using --enable-stl by default. diff --git a/libraries/wxWidgets/wxWidgets.SlackBuild b/libraries/wxWidgets/wxWidgets.SlackBuild index f0e9bdac07..d0bd31f480 100644 --- a/libraries/wxWidgets/wxWidgets.SlackBuild +++ b/libraries/wxWidgets/wxWidgets.SlackBuild @@ -76,6 +76,15 @@ else wk="OFF" fi +# BCS: check for NanoSVG +test -f /usr/include/nanosvg/nanosvg.h +case "${NANOSVG:-auto}" in + no|off) nanosvg=OFF ;; + yes|on) [ $? = 0 ] && nanosvg=sys || nanosvg=builtin ;; + auto) [ $? = 0 ] && nanosvg=sys || nanosvg=OFF ;; + internal) nanosvg=builtin ;; +esac + set -e rm -rf $PKG @@ -108,7 +117,7 @@ cmake -B build-gtk3 \ -DwxUSE_LIBTIFF=sys \ -DwxUSE_LIBLZMA=sys \ -DwxUSE_LIBMSPACK=ON \ - -DwxUSE_NANOSVG=OFF \ + -DwxUSE_NANOSVG=$nanosvg \ -DwxUSE_STL=$stl \ -DwxUSE_WEBVIEW_WEBKIT=$wk \ -DwxUSE_PRIVATE_FONTS=ON \