[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] 08/09: -also check for LaTeX packages used by gnunet-bcd

From: gnunet
Subject: [gnunet] 08/09: -also check for LaTeX packages used by gnunet-bcd
Date: Thu, 25 Nov 2021 20:49:17 +0100

This is an automated email from the git hooks/post-receive script.

alessio-vanni pushed a commit to branch master
in repository gnunet.

commit 0bd99177d2424a76bcf26b5347bfe8ee568348e8
Author: Alessio Vanni <>
AuthorDate: Wed Nov 24 21:21:32 2021 +0100

    -also check for LaTeX packages used by gnunet-bcd
    Just checking if the command is available is not enough; for example, some
    people might not have TikZ installed, a package required to draw the logo on
    the business cards.
---              |  8 +++++---
 m4/check-latex-package.m4 | 42 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 3 deletions(-)

diff --git a/ b/
index 6ad98cfc2..840bc48d3 100644
--- a/
+++ b/
@@ -265,9 +265,11 @@ AS_IF([test -x "$AWK_BINARY"],
       [AC_DEFINE([HAVE_AWK], [1], [Define to 1 if awk is available])],
       [AC_DEFINE([HAVE_AWK], [0], [Define to 1 if awk is available])])
-# check for pdflatex to build gnunet-bcd
-AC_CHECK_PROG([PDFLATEX_BINARY], [pdflatex], [true], [false])
+# check for some LaTeX packages used by gnunet-bcd
+CHECK_LATEX_PACKAGE([QR Code], [qrcode])
+CHECK_LATEX_PACKAGE([Labels], [labels])
             [AS_HELP_STRING([--with-gnunet-logread], [Install 
diff --git a/m4/check-latex-package.m4 b/m4/check-latex-package.m4
new file mode 100644
index 000000000..7b7861134
--- /dev/null
+++ b/m4/check-latex-package.m4
@@ -0,0 +1,42 @@
+dnl                     PACKAGE-NAME,
+dnl                     ACTION-IF-FOUND,
+dnl                     ACTION-IF-NOT-FOUND)
+dnl Tries to compile a small LaTeX document to see if the requested package is
+dnl available to be used with \usepackage.
+dnl The result will be cached in the ac_cv_tex_PACKAGE-NAME variable.
+dnl This macro also checks for pdflatex as in AC_CHECK_PROGS and the result
+dnl is made available in the PDFLATEX_BINARY variable (all capitals like that.)
+dnl FEATURE-NAME is one or more words to identify the check;
+dnl PACKAGE-NAME is the package as it appears in the \usepackage statement
+dnl ACTION-IF-FOUND (optional) commands to execute if the package is installed
+dnl ACTION-IF-NOT-FOUND (optional) the inverse of ACTION-IF-FOUND
+[AC_CHECK_PROGS([PDFLATEX_BINARY], [pdflatex], [no])
+ AS_IF([test "x$ac_cv_prog_PDFLATEX_BINARY" = "xno"],
+   [m4_if([$4], ,:,[$4])],
+   [AC_CACHE_CHECK([for the $1 package for LaTeX], 
+      [cat <<EOF > conftest.tex
+       "$ac_cv_prog_PDFLATEX_BINARY" conftest.tex 1>/dev/null 2>&1
+       AS_IF([test "x$?" = "x0"],
+         [AS_VAR_SET([AS_TR_SH([ac_cv_tex_][$2])], [yes])],
+        [AS_VAR_SET([AS_TR_SH([ac_cv_tex_][$2])], [no])])])
+    AS_VAR_IF([AS_TR_SH([ac_cv_tex_][$2])], [xyes],
+      [m4_if([$3], ,:,[$3])],
+      [m4_if([$4], ,:,[$4])])])

To stop receiving notification emails like this one, please contact

reply via email to

[Prev in Thread] Current Thread [Next in Thread]