GNOME Bugzilla – Bug 770759
Can no longer be built on non-systemd systems
Last modified: 2016-09-06 08:59:13 UTC
The addition of systemd user service files is a welcome change. But adding PKG_CHECK_EXISTS([systemd],, [AC_MSG_ERROR([systemd development headers not found])]) makes the package non-buildable on non-systemd systems. There are two ways to solve this: We add a fallback in case the systemd.pc file is not found (like e.g. dbus [1] does), or we add a AM_CONDITIONAL(HAVE_SYSTEMD,...) and install the user unit files only if systemduserunitdir is not empty. Let me know which approach you prefer and I'll prep a patch accordingly. [1] https://cgit.freedesktop.org/dbus/dbus/tree/configure.ac#n1554
Created attachment 334656 [details] [review] build: Don't install systemd user unit files if target directory is not set I've decided to conditionally install the systemd user units as this seems the proper fix.
Review of attachment 334656 [details] [review]: ::: Makefile.am @@ +238,3 @@ $(AM_V_GEN)$(SED) -e "s|[@]libexecdir[@]|$(libexecdir)|" $< > $@ +if HAVE_SYSTEMD This won't add the files into the dist if systemd isn't available on the systemd that create the tarball. Either you need to turn the systemd check in configure.ac into an error following a flag (which would be added to AM_DISTCHECK_CONFIGURE_FLAGS), or add those files manually to the dist in the else of this conditional. The latter requires less code.
(In reply to Bastien Nocera from comment #2) > Review of attachment 334656 [details] [review] [review]: > > ::: Makefile.am > @@ +238,3 @@ > $(AM_V_GEN)$(SED) -e "s|[@]libexecdir[@]|$(libexecdir)|" $< > $@ > > +if HAVE_SYSTEMD > > This won't add the files into the dist if systemd isn't available on the > systemd that create the tarball. > > Either you need to turn the systemd check in configure.ac into an error > following a flag (which would be added to AM_DISTCHECK_CONFIGURE_FLAGS), or > add those files manually to the dist in the else of this conditional. > > The latter requires less code. I explicitly tested that and server/vino-server.service.in was correctly added to the dist tarball in the absence of systemd.pc. TTBOMK, AM_CONDITIONAL does unconditional build but not dist nowadays. Old automake versions did not handle this properly. Is this not working for you? Which automake version do you use?
(In reply to Michael Biebl from comment #3) > TTBOMK, AM_CONDITIONAL does unconditional build but not dist nowadays. Old That's the wrong way around: AM_CONDITIONAL should unconditionally dist files, but conditionally build/process files.
Looking at the generated Makefile.in, I have am__dist_noinst_DATA_DIST = server/vino-server.service.in \ ... This is with automake 1.15
Fixed on master with commit 1538798a89653b8921ca574aebb3f153543b4921.