From 3ceb9b0d1d0854021cacfa0ed354e1ce5b27fb58 Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Tue, 8 Apr 2014 00:46:43 +0300 Subject: [PATCH] autotools: install themes during 'make install' Default path for themes is ${pkgdatadir}/themes that usualy equals to /usr/share/profanity/themes. This patch also introduces new option --with-themes[=PATH] that specifies installation path. This option can be used for cancel of installation at all: --without-themes. References: issue #323 --- Makefile.am | 14 ++++++++++++++ configure.ac | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/Makefile.am b/Makefile.am index 9b17247a..f9d04fde 100644 --- a/Makefile.am +++ b/Makefile.am @@ -90,6 +90,16 @@ otr3_sources = \ otr4_sources = \ src/otr/otrlib.h src/otr/otrlibv4.c src/otr/otr.h src/otr/otr.c +themes_sources = \ + themes/aqua \ + themes/boothj5 \ + themes/hacker \ + themes/headache \ + themes/original \ + themes/redsplash \ + themes/whiteness \ + themes/yellowsplash + if BUILD_OTR if BUILD_OTR3 core_sources += $(otr3_sources) @@ -103,6 +113,10 @@ endif bin_PROGRAMS = profanity profanity_SOURCES = $(core_sources) $(main_source) +if THEMES_INSTALL +profanity_themesdir = @THEMES_PATH@ +profanity_themes_DATA = $(themes_sources) +endif if INCLUDE_GIT_VERSION BUILT_SOURCES = $(git_include) endif diff --git a/configure.ac b/configure.ac index 706cc0b4..83bdc8cb 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,8 @@ AC_ARG_WITH([libxml2], [AS_HELP_STRING([--with-libxml2], [link with libxml2 instead of expat])]) AC_ARG_WITH([xscreensaver], [AS_HELP_STRING([--with-xscreensaver], [use libXScrnSaver to determine idle time])]) +AC_ARG_WITH([themes], + [AS_HELP_STRING([--with-themes[[=PATH]]], [install themes (default yes)])]) ### Select first existing xml library among expat and libxml2 PARSER="" @@ -192,6 +194,15 @@ elif test "x$enable_otr" = x; then [AC_MSG_NOTICE([libotr not found, otr encryption support not enabled])]) fi +AS_IF([test "x$with_themes" = xno], + [THEMES_INSTALL="false"], + [THEMES_INSTALL="true"]) +AS_IF([test "x$with_themes" = xno -o "x$with_themes" = xyes -o "x$with_themes" = x], + [THEMES_PATH='${pkgdatadir}/themes'], + [THEMES_PATH="$with_themes"]) +AC_SUBST(THEMES_PATH) +AM_CONDITIONAL([THEMES_INSTALL], "$THEMES_INSTALL") + ### cmocka is required only for tests, profanity shouldn't be linked with it ### TODO: pass cmocka_CFLAGS and cmocka_LIBS to Makefile.am PKG_CHECK_MODULES([cmocka], [cmocka], [], @@ -206,6 +217,7 @@ AM_CFLAGS="-Wall -Wno-deprecated-declarations" AS_IF([test "x$PACKAGE_STATUS" = xdevelopment], [AM_CFLAGS="$AM_CFLAGS -Wunused -Werror"]) AM_CPPFLAGS="$AM_CPPFLAGS $glib_CFLAGS $curl_CFLAGS $libnotify_CFLAGS" +AM_CPPFLAGS="$AM_CPPFLAGS -DTHEMES_PATH=\"$THEMES_PATH\"" LIBS="$LIBS $glib_LIBS $curl_LIBS $libnotify_LIBS" AC_SUBST(AM_CFLAGS) @@ -225,5 +237,7 @@ echo "AM_CFLAGS : $AM_CFLAGS" echo "AM_CPPFLAGS : $AM_CPPFLAGS" echo "LIBS : $LIBS" echo "XML Parser : $PARSER" +echo "Install themes : $THEMES_INSTALL" +echo "Themes path : $THEMES_PATH" echo "" echo "Now you can run \`make' to build profanity"