From 5c43eb66ca5f0ce179805737418aa301baf96fb5 Mon Sep 17 00:00:00 2001 From: David Seifert Date: Sun, 15 May 2022 00:50:04 +0200 Subject: [PATCH] Add option for disabling/customizing of demos * Many distros have different directories for where to install example files to. Gentoo installs them under `$(docdir)/examples`. With `--without-demos`, we can suppress installation of the demos altogether. --- configure.ac | 12 ++++++++ tclpkg/gdtclft/demo/Makefile.am | 4 +-- tclpkg/gv/demo/Makefile.am | 28 ++++++++++--------- tclpkg/tcldot/demo/Makefile.am | 4 +-- tclpkg/tclpathplan/demo/Makefile.am | 4 +-- .../demo/pathplan_data/Makefile.am | 4 ++- tclpkg/tkspline/demo/Makefile.am | 4 +-- 7 files changed, 38 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac index d76d918cd..e9a994402 100644 --- a/configure.ac +++ b/configure.ac @@ -291,6 +291,18 @@ AS_IF([test "x$enable_man_pdfs" != "xno"], [ ]) AM_CONDITIONAL([ENABLE_MAN_PDFS], [test "x$enable_man_pdfs" != "xno" && test -n "$GROFF" && test -n "$PS2PDF"]) +# allow disabling of demos installation +AC_ARG_WITH([demos], + [AS_HELP_STRING([--with-demos=DIR], [Install demos (default: $(pkgdatadir)/demo)])]) + +demodir='$(pkgdatadir)/demo' +AS_IF([test "$with_demos" != "xyes" && test -n "$with_demos"], [ + dnl user provided --with-demos=/my/demo/dir + demodir="$with_demos" +]) +AM_CONDITIONAL([INSTALL_DEMOS], [test "x$with_demos" != "xno"]) +AC_SUBST([demodir]) + PKG_INSTALLDIR PKG_PROG_PKG_CONFIG diff --git a/tclpkg/gdtclft/demo/Makefile.am b/tclpkg/gdtclft/demo/Makefile.am index 96a032cf7..64f24c75f 100644 --- a/tclpkg/gdtclft/demo/Makefile.am +++ b/tclpkg/gdtclft/demo/Makefile.am @@ -1,8 +1,8 @@ ## Process this file with automake to produce Makefile.in -demodir = $(pkgdatadir)/demo - +if INSTALL_DEMOS if WITH_TCL dist_demo_SCRIPTS = entities.tcl dist_demo_DATA = entities.tcl.README entities.html endif +endif diff --git a/tclpkg/gv/demo/Makefile.am b/tclpkg/gv/demo/Makefile.am index d33e74af4..a6ab30805 100644 --- a/tclpkg/gv/demo/Makefile.am +++ b/tclpkg/gv/demo/Makefile.am @@ -1,19 +1,20 @@ ## Process this file with automake to produce Makefile.in -demosharpdir = $(pkgdatadir)/demo -demoguiledir = $(pkgdatadir)/demo -demoiodir = $(pkgdatadir)/demo -demojavadir = $(pkgdatadir)/demo -demoluadir = $(pkgdatadir)/demo -demoocamldir = $(pkgdatadir)/demo -demoperldir = $(pkgdatadir)/demo -demophpdir = $(pkgdatadir)/demo -demopythondir = $(pkgdatadir)/demo -demopython3dir = $(pkgdatadir)/demo -demoRdir = $(pkgdatadir)/demo -demorubydir = $(pkgdatadir)/demo -demotcldir = $(pkgdatadir)/demo +demosharpdir = $(demodir) +demoguiledir = $(demodir) +demoiodir = $(demodir) +demojavadir = $(demodir) +demoluadir = $(demodir) +demoocamldir = $(demodir) +demoperldir = $(demodir) +demophpdir = $(demodir) +demopythondir = $(demodir) +demopython3dir = $(demodir) +demoRdir = $(demodir) +demorubydir = $(demodir) +demotcldir = $(demodir) +if INSTALL_DEMOS if WITH_SHARP demosharp_SCRIPTS = endif @@ -53,5 +54,6 @@ endif if WITH_TCL demotcl_SCRIPTS = modgraph.tcl endif +endif EXTRA_DIST = modgraph.* diff --git a/tclpkg/tcldot/demo/Makefile.am b/tclpkg/tcldot/demo/Makefile.am index a03f3a0d2..a358ab465 100644 --- a/tclpkg/tcldot/demo/Makefile.am +++ b/tclpkg/tcldot/demo/Makefile.am @@ -1,10 +1,10 @@ ## Process this file with automake to produce Makefile.in -demodir = $(pkgdatadir)/demo - +if INSTALL_DEMOS if WITH_TCL demo_SCRIPTS = doted.tcl gcat.tcl demo_DATA = doted.tcl.README gcat.tcl.README endif +endif EXTRA_DIST = doted.tcl gcat.tcl doted.tcl.README gcat.tcl.README diff --git a/tclpkg/tclpathplan/demo/Makefile.am b/tclpkg/tclpathplan/demo/Makefile.am index cd772cf20..a8737d1b5 100644 --- a/tclpkg/tclpathplan/demo/Makefile.am +++ b/tclpkg/tclpathplan/demo/Makefile.am @@ -2,11 +2,11 @@ SUBDIRS = pathplan_data -demodir = $(pkgdatadir)/demo - +if INSTALL_DEMOS if WITH_TCL demo_SCRIPTS = pathplan.tcl demo_DATA = pathplan.tcl.README endif +endif EXTRA_DIST = pathplan.tcl pathplan.tcl.README diff --git a/tclpkg/tclpathplan/demo/pathplan_data/Makefile.am b/tclpkg/tclpathplan/demo/pathplan_data/Makefile.am index e79a1ce17..f4e79eafc 100644 --- a/tclpkg/tclpathplan/demo/pathplan_data/Makefile.am +++ b/tclpkg/tclpathplan/demo/pathplan_data/Makefile.am @@ -1,8 +1,10 @@ ## Process this file with automake to produce Makefile.in -pathplanexampledir = $(pkgdatadir)/demo/pathplan_data +pathplanexampledir = $(demodir)/pathplan_data +if INSTALL_DEMOS if WITH_TCL dist_pathplanexample_DATA = boxes.dat dpd.dat funny.dat maze.dat nested.dat northo.dat \ obs.dat other.dat paths.dat rotor.dat u.dat unknown.dat endif +endif diff --git a/tclpkg/tkspline/demo/Makefile.am b/tclpkg/tkspline/demo/Makefile.am index a0e3f05b8..b0abd4f23 100644 --- a/tclpkg/tkspline/demo/Makefile.am +++ b/tclpkg/tkspline/demo/Makefile.am @@ -1,10 +1,10 @@ ## Process this file with automake to produce Makefile.in -demodir = $(pkgdatadir)/demo - +if INSTALL_DEMOS if WITH_TK demo_SCRIPTS = spline.tcl demo_DATA = spline.tcl.README endif +endif EXTRA_DIST = spline.tcl spline.tcl.README -- 2.40.0