#9 Introduce --without-gtk to optionally disable GTK functionality
Merged 2 years ago by jkucera. Opened 3 years ago by robert.
robert/usermode optional-gtk  into  master

file modified
+24 -6
@@ -20,20 +20,27 @@ 

  PIXMAPDIR_CPPFLAGS = -DPIXMAPDIR='"$(pixmapdir)"'

  SBINDIR_CPPFLAGS = -DSBINDIR='"$(sbindir)"'

  

- bin_PROGRAMS = userinfo usermount userpasswd consolehelper consolehelper-gtk \

- 	pam-panel-icon

+ bin_PROGRAMS = consolehelper

+ if GTK

+ bin_PROGRAMS += userinfo usermount userpasswd consolehelper-gtk pam-panel-icon

+ endif

  sbin_PROGRAMS = userhelper

+ if GTK

  noinst_PROGRAMS = test-userdialog

  dist_man_MANS = consolehelper-gtk.8 pam-panel-icon.1 \

  	userinfo.1 usermount.1 userpasswd.1

+ endif

  man_MANS = consolehelper.8 userhelper.8

  

+ if GTK

  pixmapdir = $(datadir)/pixmaps

  dist_pixmap_DATA = keys.xpm status_lock.png status_unlocked.png user_icon.png \

  	password.png disks.png keyring.png badge-small.png

+ endif

  

  noinst_LIBRARIES = liblib.a

  

+ if GTK

  install-data-local: userinfo.desktop usermount.desktop userpasswd.desktop

  	mkdir -p $(DESTDIR)$(datadir)/applications

  	for i in userinfo.desktop usermount.desktop userpasswd.desktop; do \
@@ -46,6 +53,7 @@ 

  	-rm -f $(DESTDIR)$(datadir)/applications/$(VENDOR)-userinfo.desktop   \

  	       $(DESTDIR)$(datadir)/applications/$(VENDOR)-usermount.desktop  \

  	       $(DESTDIR)$(datadir)/applications/$(VENDOR)-userpasswd.desktop

+ endif

  

  CLEANFILES = $(man_MANS)

  DISTCLEANFILES =            \
@@ -57,12 +65,14 @@ 

  debug-install:

  	$(INSTALL) -m4711 userhelper $(sbindir)/

  	$(INSTALL)  -m755 consolehelper $(bindir)/

+ if GTK

  	$(INSTALL)  -m755 consolehelper-gtk $(bindir)/

  	$(INSTALL)  -m755 userinfo          $(bindir)/

  	$(INSTALL)  -m755 usermount         $(bindir)/

  	$(INSTALL)  -m755 userpasswd        $(bindir)/

  

  dist_pkgdata_DATA = usermode.ui

+ endif

  

  @INTLTOOL_DESKTOP_RULE@

  
@@ -71,6 +81,7 @@ 

  userhelper_LDADD = liblib.a $(LIBUSER_LIBS) $(GLIB_LIBS) $(PAM_LIBS) -lm \

  	$(SELINUX_LIBS) $(EFENCE_LIBS)

  

+ if GTK

  userinfo_SOURCES = userinfo.c

  userinfo_CPPFLAGS = $(AM_CPPFLAGS) $(PIXMAPDIR_CPPFLAGS) $(SBINDIR_CPPFLAGS) \

  	-DPKGDATADIR='"$(pkgdatadir)"'
@@ -83,6 +94,7 @@ 

  userpasswd_SOURCES = userpasswd.c

  userpasswd_CPPFLAGS = $(AM_CPPFLAGS) $(SBINDIR_CPPFLAGS)

  userpasswd_LDADD = liblib.a $(SN_LIBS) $(GTK_LIBS) $(EFENCE_LIBS)

+ endif

  

  consolehelper_SOURCES = consolehelper-nox.c

  consolehelper_CPPFLAGS = $(AM_CPPFLAGS) $(BINDIR_CPPFLAGS) $(SBINDIR_CPPFLAGS)
@@ -92,6 +104,7 @@ 

  consolehelper_gtk_CPPFLAGS = $(AM_CPPFLAGS) $(SBINDIR_CPPFLAGS)

  consolehelper_gtk_LDADD = liblib.a $(SN_LIBS) $(GTK_LIBS) $(EFENCE_LIBS)

  

+ if GTK

  pam_panel_icon_SOURCES = pam-panel-icon.c gsmclient.c gsmclient.h props.c \

  	props.h

  pam_panel_icon_CPPFLAGS = $(AM_CPPFLAGS) $(BINDIR_CPPFLAGS) \
@@ -100,10 +113,15 @@ 

  

  test_userdialog_SOURCES = test-userdialog.c

  test_userdialog_LDADD = liblib.a $(GTK_LIBS) $(EFENCE_LIBS)

- 

- liblib_a_SOURCES = userdialogs.c userdialogs.h userhelper-messages.c \

- 	userhelper-messages.h userhelper-wrap.c userhelper-wrap.h

- liblib_a_CPPFLAGS = $(AM_CPPFLAGS) $(PIXMAPDIR_CPPFLAGS)

+ endif

+ 

+ liblib_a_SOURCES = userhelper-messages.c userhelper-messages.h

+ liblib_a_CPPFLAGS = $(AM_CPPFLAGS)

+ if GTK

+ liblib_a_SOURCES += userdialogs.c userdialogs.h userhelper-wrap.c \

+ 	userhelper-wrap.h

+ liblib_a_CPPFLAGS += $(PIXMAPDIR_CPPFLAGS)

+ endif

  

  consolehelper.8: $(srcdir)/consolehelper.8.in Makefile

  	sed 's,@''BINDIR@,$(bindir),g' < $(srcdir)/consolehelper.8.in > $@

file modified
+11 -1
@@ -30,7 +30,17 @@ 

  IT_PROG_INTLTOOL

  AC_PATH_XTRA

  PKG_CHECK_MODULES([GLIB], [glib-2.0])

- PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.23])

+ 

+ AC_MSG_CHECKING([whether we should use GTK])

+ AC_ARG_WITH([gtk],

+        AS_HELP_STRING([--without-gtk], [Disable GTK functionality]),

+        [gtk=${withval}], [gtk=yes])

+ if test "x$gtk" != xno ; then

+        PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.23])

+ fi

+ AC_MSG_RESULT([$gtk])

+ AM_CONDITIONAL([GTK], [test x$gtk != xno])

+ 

  PKG_CHECK_MODULES([LIBUSER], [libuser])

  AC_CACHE_CHECK([for startup notification], [mitr_cv_lib_sn],

  [mitr_cv_lib_sn=no

Some downstreams not providing any GUI may dislike the build-time GTK dependency, so the GTK tools can now be disabled optionally.

Given the ancestor of this patch lingers around downstream-only for 11+ years here, it might make sense to kindly propose it to upstream hereby. The intention is to not change the current default behaviour at all.

Thanks for the patch. I will merge it and after testing and possible adjustments it will be added to next release tarball.

Commit 07828a2 fixes this pull-request

Pull-Request has been merged by jkucera

2 years ago

Pull-Request has been merged by jkucera

2 years ago
Metadata