Merge lp:~heirecka/inkscape/use-pkg_prog_pkg_config into lp:~inkscape.dev/inkscape/trunk

Proposed by Heiko Becker
Status: Needs review
Proposed branch: lp:~heirecka/inkscape/use-pkg_prog_pkg_config
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 33 lines (+3/-6)
1 file modified
configure.ac (+3/-6)
To merge this branch: bzr merge lp:~heirecka/inkscape/use-pkg_prog_pkg_config
Reviewer Review Type Date Requested Status
jazzynico (community) Needs Fixing
Krzysztof Kosinski Approve
Review via email: mp+255157@code.launchpad.net

Description of the change

It has the advantage that it respects the PKG_CONF environment variable which comes in handy when you're using a prefixed pkg-config (e.g arch-prefix) executable.

Successfully built inkscape with a x86_64-pc-linux-gnu-pkg-config exectuable.

To post a comment you must log in.
Revision history for this message
Krzysztof Kosinski (tweenk) wrote :

Looks okay, but I would welcome some information about the required version of Autoconf / pkg-config and how old they are.

review: Approve
Revision history for this message
Heiko Becker (heirecka) wrote :

> Looks okay, but I would welcome some information about the required version of
> Autoconf / pkg-config and how old they are.

It was first introduced in 2005 (http://cgit.freedesktop.org/pkg-config/commit/pkg.m4?id=b1584b5aaf9ce396e61599caff2b5e15f01daf91). So the autoconf version shouldn't really matter, but I could not find anything specific. The macro itself checks for a pkg-config version of 0.9.0. which seems to be released in 2003.

Revision history for this message
jazzynico (jazzynico) wrote :

Tested successfully with gtkspell-2 on Xubuntu 15.10, Inkscape trunk rev. 14674.

Unfortunately, it doesn't work with gtkspell-3 (--enable-gtk3-experimental configure option) due to an incorrect package name (gtkspell-3.0 doesn't exist). To fix it, I had to use the following code:

if pkg-config --exists gtkspell3-3.0; then
 ink_spell_pkg=gtkspell3-3.0

I have just checked with other Gnu/Linux distros, and it seems the gtkspell3-3.0 package name is consistent.

review: Needs Fixing

Unmerged revisions

14042. By Heiko Becker

configure: Use PKG_PROG_PKG_CONFIG macro

It has the advantage that it respects the PKG_CONF environment
variable which comes in handy when you're using a prefixed pkg-config
(e.g arch-prefix) executable.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2015-02-12 12:09:59 +0000
+++ configure.ac 2015-04-02 23:42:42 +0000
@@ -220,10 +220,7 @@
220AC_SUBST(GETTEXT_PACKAGE)220AC_SUBST(GETTEXT_PACKAGE)
221AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Translation domain used])221AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Translation domain used])
222222
223AC_PATH_PROG(PKG_CONFIG, pkg-config, no)223PKG_PROG_PKG_CONFIG
224if test "x$PKG_CONFIG" = "xno"; then
225 AC_MSG_ERROR(You have to install pkg-config to compile inkscape.)
226fi
227224
228dnl Find msgfmt. Without this, po/Makefile fails to set MSGFMT on some platforms.225dnl Find msgfmt. Without this, po/Makefile fails to set MSGFMT on some platforms.
229AC_PATH_PROG(MSGFMT, msgfmt, msgfmt)226AC_PATH_PROG(MSGFMT, msgfmt, msgfmt)
@@ -723,7 +720,7 @@
723if test "x$enable_gtk3" = "xyes"; then720if test "x$enable_gtk3" = "xyes"; then
724721
725 ink_spell_pkg=722 ink_spell_pkg=
726 if pkg-config --exists gtkspell-3.0; then723 if $PKG_CONFIG --exists gtkspell-3.0; then
727 ink_spell_pkg=gtkspell-3.0724 ink_spell_pkg=gtkspell-3.0
728 AC_DEFINE(WITH_GTKSPELL, 1, [enable gtk spelling widget])725 AC_DEFINE(WITH_GTKSPELL, 1, [enable gtk spelling widget])
729 fi726 fi
@@ -800,7 +797,7 @@
800else797else
801798
802 ink_spell_pkg=799 ink_spell_pkg=
803 if pkg-config --exists gtkspell-2.0; then800 if $PKG_CONFIG --exists gtkspell-2.0; then
804 ink_spell_pkg=gtkspell-2.0801 ink_spell_pkg=gtkspell-2.0
805 AC_DEFINE(WITH_GTKSPELL, 1, [enable gtk spelling widget])802 AC_DEFINE(WITH_GTKSPELL, 1, [enable gtk spelling widget])
806 fi803 fi