Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 686906 - net-misc/asterisk-13.23.1 - Replace External libjansson Dependency with Bundled Asterisk Version
Summary: net-misc/asterisk-13.23.1 - Replace External libjansson Dependency with Bundl...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jaco Kroon
Depends on:
Reported: 2019-05-28 11:49 UTC by Reuben Farrelly
Modified: 2019-11-30 07:50 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Reuben Farrelly 2019-05-28 11:49:19 UTC
One of the current build time requirements for Asterisk is libjansson.  This is currently reflected in the asterisk-13.23.1.ebuild as a CDEPEND  (dev-libs/jansson).

More modern versions of Asterisk including our current 13.23.1 ebuild now ships a bundled version of jansson instead which means a few things need to change with the existing 13.23.1 and future ebuilds to use this.  In my case this change also fixes a fatal compilation build I was experiencing.

The following modifications therefore need to be made to the ebuild:

- Removal of the CDEPEND value dev-libs/jansson - it is not required if we use the bundled version
- Change the configure options to include --with-jansson-bundled
- Add "third-party/jansson" to the AT_M4DIR in src_prepare() in the ebuild

The last item is critical.  Prior to me adding "third-party/jansson" to the list, the directory was not autoreconf'd.  This meant that ./configure always failed when executed, like this:

checking uuid/uuid.h usability... yes
checking uuid/uuid.h presence... yes
checking for uuid/uuid.h... yes
./configure: line 14317: syntax error near unexpected token `else'
./configure: line 14317: `else'

This was caused by the presence of an unprocessed line in configure, namely  "JANSSON_DEFINE_JSON_INT()".  This is invalid syntax.  By adding the third-party/jansson directory to AT_M4DIR the autoconf function then processed third-party/jansson correctly and the error went away.
Comment 1 Jaco Kroon 2019-05-29 08:31:50 UTC
Hi Reuben,

We'd prefer to use system-installed packages (Gentoo policy, in part to avoid installation bloat) where possible.

Would you mind providing the compilation error so that we can look at that?

Kind Regards,
Comment 2 Reuben Farrelly 2019-05-29 11:20:04 UTC
Actually it seems I had my wires crossed on this - I apologise.  I was testing out an ebuild of 13.26.0 (by simply modifying the name of 13.23.1 ebuild - the contents of the ebuild itself were the same).

Therefore I accept that this bug as logged is invalid in the sense that it does not apply to the current 13.23.1 ebuild in the tree - so it can be closed.

However for the record now that I have spent time working this out, in these later releases of Asterisk the bundled jansson is used by default and in this case the third change I mentioned below would be required.  So when the in-tree ebuild is updated in the future this will have to be taken care of one way or another - either this bug will have to be fixed, or bundled jansson be explicitly disabled.

The 13.26.0 ebuild dies like this:

checking sys/io.h usability... yes
checking sys/io.h presence... yes
checking for sys/io.h... yes
checking for x86_64-pc-linux-gnu-pkg-config... /usr/bin/x86_64-pc-linux-gnu-pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libedit... yes
checking for Testing for libedit unicode support... yes
checking for uuid_generate_random in -luuid... yes
checking uuid/uuid.h usability... yes
checking uuid/uuid.h presence... yes
checking for uuid/uuid.h... yes
./configure: line 14317: syntax error near unexpected token `else'
./configure: line 14317: `else'

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/net-misc/asterisk-13.26.0/work/asterisk-13.26.0/config.log

Yes it really is that obscure.

The configure file ends up with this around line 14336:


                { $as_echo "$as_me:${as_lineno-$LINENO}: *** use './configure --with-jansson-bundled'" >&5
$as_echo "$as_me: *** use './configure --with-jansson-bundled'" >&6;}
                exit 1


Which is fixed by adding the jansson third party directory to AT_M4DIR in the ebuild as per my original report.

I would also suggest if you don't want to use bundle packages you probably also should't have the third-party/pjsip directory in the AT_M4DIR list or be using that either, and should explicitly disable it too, including in 13.23.1  ;-)

Once that is fixed the 13.26.0 release builds through to completion.
Comment 3 Jaco Kroon 2019-11-14 13:00:39 UTC
I've tracked down the AT_M4DIR issue independently.  I'm marking my update to asterisk 13.29.1 to close this.
Comment 4 Larry the Git Cow gentoo-dev 2019-11-30 07:50:07 UTC
The bug has been closed via the following commit(s):

commit b44a1be8b8e28517ce843e630e30ccc1ddf3fae4
Author:     Jaco Kroon <>
AuthorDate: 2019-11-10 18:29:19 +0000
Commit:     Joonas Niilola <>
CommitDate: 2019-11-30 07:48:56 +0000

    net-misc/asterisk: version bump to 13.29.1 + maintainership
    Converted to GLEP 81 for user+group.
    Consolidated a few DEPEND issues.
    Dropped pkg_config phase function.
    Took maintainership.
    Fixed a bunch of other issues from pkgcheck (${D} and ${ROOT} not having
        a / following it directly).
    Bumped to EAPI=7
    Use $ED over $D where applicable.
    Fix statsd integration.
    Update depend on virtual/mysql to db/mysql-connector-c
    Enable NOISY_BUILD as requested (instructed) by slyfox.
    Fix /usr/share/doc/${PV} being asterisk: owned.
    Make SSL optional.
    This commit enables progress on the GLSA bug:
    Might close: (SIGILL, may be GRSEC, or #667498)
    Package-Manager: Portage-2.3.76, Repoman-2.3.16
    Signed-off-by: Jaco Kroon <>
    Signed-off-by: Joonas Niilola <>

 net-misc/asterisk/Manifest                |   2 +
 net-misc/asterisk/asterisk-13.29.1.ebuild | 327 ++++++++++++++++++++++++++++++
 net-misc/asterisk/metadata.xml            |  21 +-
 3 files changed, 342 insertions(+), 8 deletions(-)