1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-09 21:30:42 +00:00

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
This commit is contained in:
Dmitry Podgorny 2014-04-08 00:46:43 +03:00
parent 73437f2efd
commit 3ceb9b0d1d
2 changed files with 28 additions and 0 deletions

View File

@ -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

View File

@ -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"