logo

badwolf

minimalist and privacy-oriented web browser based on WebKitGTK git clone https://hacktivis.me/git/badwolf.git
commit: 7ba150db12c0512b397b82585b1293204a25590e
parent 8fbd2a2f285dd580c19df7786f7901883a97c147
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 29 Oct 2021 18:52:24 +0200

configure: Allow WITH_* variables, describe dependencies

Diffstat:

Mconfigure57+++++++++++++++++++++++++++++++++++++--------------------
1 file changed, 37 insertions(+), 20 deletions(-)

diff --git a/configure b/configure @@ -4,27 +4,40 @@ VERSION_FULL=${VERSION}$(./version.sh) ICON_SIZES="$(for i in 24 32 48 64 128 256; do printf 'icons/hicolor/%sx%s/apps/badwolf.png ' $i $i ; done)" DEPS="gtk+-3.0 libxml-2.0" +min_webkitgtk=2.32.0 +min_glib_guri=2.66.0 + usage() { cat <<END Usage: [variables] configure [variables] Variables: - PREFIX=DIR - BINDIR=DIR - MANDIR=DIR - DOCDIR=DIR - DATADIR=DIR - APPSDIR=DIR - - PKGCONFIG=BIN - MSGFMT=BIN - INKSCAPE=BIN - CC=BIN - CFLAGS=OPTIONS - EXTRA_CFLAGS=OPTIONS - MANDOC=BIN + PREFIX=DIR + BINDIR=DIR + MANDIR=DIR + DOCDIR=DIR + DATADIR=DIR + APPSDIR=DIR + + PKGCONFIG=BIN + MSGFMT=BIN + INKSCAPE=BIN + CC=BIN + CFLAGS=OPTIONS + EXTRA_CFLAGS=OPTIONS + MANDOC=BIN + + WITH_WEBKITGTK=(4.0|4.1) + WITH_URI_PARSER=(guri|libsoup2) Variables are set in the following order: Default, Environment, Arguments + +Dependencies: +- gtk+-3.0 +- libxml-2.0 +- webkit2gtk-4.1 version >=${min_webkitgtk} or webkit2gtk-4.0 version >=${min_webkitgtk} +- libsoup-2.4 or glib-2.0 version >=${min_glib_guri} +- mandoc: for linting the manual page (optionnal, test dep) END } @@ -74,6 +87,10 @@ for i; do export "${i%%=*}"="${i#*=}" shift ;; + WITH_WEBKITGTK=*|WITH_URI_PARSER=*) + export "${i%%=*}"="${i#*=}" + shift + ;; -h|--help) usage exit 1 @@ -119,20 +136,20 @@ done case "${WITH_WEBKITGTK}n" in 4.1n) - pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.1 || exit 1 + pkg_config_check --atleast-version="${min_webkitgtk}" webkit2gtk-4.1 || exit 1 DEPS="${DEPS} webkit2gtk-4.1" ;; 4.0n) - pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.0 || exit 1 + pkg_config_check --atleast-version="${min_webkitgtk}" webkit2gtk-4.0 || exit 1 DEPS="${DEPS} webkit2gtk-4.0" ;; n) echo "notice: Packagers should consider setting the ABI version (4.0 or 4.1) in WITH_WEBKITGTK" >&2 - if pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.1 + if pkg_config_check --atleast-version="${min_webkitgtk}" webkit2gtk-4.1 then DEPS="${DEPS} webkit2gtk-4.1" else - pkg_config_check --atleast-version=2.32.0 webkit2gtk-4.0 || exit 1 + pkg_config_check --atleast-version="${min_webkitgtk}" webkit2gtk-4.0 || exit 1 DEPS="${DEPS} webkit2gtk-4.0" fi ;; @@ -145,7 +162,7 @@ esac case "${WITH_URI_PARSER}n" in gurin) echo "URI parser selected: GUri from glib-2.0" - pkg_config_check --atleast-version=2.66.0 glib-2.0 || exit 1 + pkg_config_check --atleast-version="${min_glib_guri}" glib-2.0 || exit 1 DEPS="${DEPS} glib-2.0" ;; libsoup2n) @@ -162,7 +179,7 @@ case "${WITH_URI_PARSER}n" in n) echo "notice: Packagers should consider setting the URI parsing library (guri or libsoup2) in WITH_URI_PARSER" >&2 - if pkg_config_check --atleast-version=2.66.0 glib-2.0 + if pkg_config_check --atleast-version="${min_glib_guri}" glib-2.0 then echo "URI parser selected: GUri from glib-2.0" DEPS="${DEPS} glib-2.0"