Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 817803 - net-libs/pjproject silently ignore opus use flag
Summary: net-libs/pjproject silently ignore opus use flag
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jaco Kroon
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2021-10-11 19:07 UTC by Ilia Pavlikhin
Modified: 2022-06-15 13:32 UTC (History)
1 user (show)

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


Attachments
Fixing aconfigure.ac for properly OPUS building (pjproject-2.10-fix-configure-for-opus-building.patch,987 bytes, patch)
2021-10-11 19:07 UTC, Ilia Pavlikhin
Details | Diff
Little bit fixed patch (with full fixed behavior) (pjproject-2.10-fix-configure-for-opus-building.patch,2.37 KB, patch)
2021-10-11 20:08 UTC, Ilia Pavlikhin
Details | Diff
Simple application for listing available codes in PJSIP (pjtest.cpp,580 bytes, text/x-c++src)
2021-10-11 20:24 UTC, Ilia Pavlikhin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ilia Pavlikhin 2021-10-11 19:07:22 UTC
Created attachment 744501 [details, diff]
Fixing aconfigure.ac for properly OPUS building

I found strange behavior with "configure" file generating from aconfigure.ac. When you enable OPUS as USE flag portage pass to fresh generated configure script --enable-opus argument and here seems all is ok, but aconfigure.ac have next OPUS-part definition:

.........

 dnl # Include OPUS support
 AC_SUBST(ac_no_opus)
 AC_ARG_ENABLE(opus,
           AS_HELP_STRING([--disable-opus],
                  [Exclude OPUS support from the build (default: autodetect)])
           ,
           [
         if test "$enable_opus" = "no"; then
          [ac_no_opus=1]
          AC_DEFINE(PJMEDIA_HAS_OPUS_CODEC,0)
          AC_MSG_RESULT([Checking if OPUS support is disabled... yes])
             fi
           ],
           [
         AC_MSG_RESULT([checking for OPUS installations..])
                 if test "x$with_opus" != "xno" -a "x$with_opus" != "x"; then
                     CFLAGS="$CFLAGS -I$with_opus/include"
                     CPPFLAGS="$CPPFLAGS -I$with_opus/include"
                     LDFLAGS="$LDFLAGS -L$with_opus/lib"
                     AC_MSG_RESULT([Using OPUS prefix... $with_opus])
                 fi

...

This part after autoconf expanded to next code:

....

# Check whether --enable-opus was given.
if test "${enable_opus+set}" = set; then :
  enableval=$enable_opus;
        if test "$enable_opus" = "no"; then
         ac_no_opus=1
         $as_echo "#define PJMEDIA_HAS_OPUS_CODEC 0" >>confdefs.h

         { $as_echo "$as_me:${as_lineno-$LINENO}: result: Checking if OPUS support is disabled... yes" >&5
$as_echo "Checking if OPUS support is disabled... yes" >&6; }
            fi

else

        { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for OPUS installations.." >&5
$as_echo "checking for OPUS installations.." >&6; }
                if test "x$with_opus" != "xno" -a "x$with_opus" != "x"; then
                    CFLAGS="$CFLAGS -I$with_opus/include"
                    CPPFLAGS="$CPPFLAGS -I$with_opus/include"
                    LDFLAGS="$LDFLAGS -L$with_opus/lib"
                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using OPUS prefix... $with_opus" >&5
$as_echo "Using OPUS prefix... $with_opus" >&6; }
                fi

........

And as you understand if we pass --enable-opus argument - configure silently skip any work around OPUS, because argument is set, all is ok, but he is "yes" instead "no". I think we have a simple problem with block ordering in aconfigure.ac.

Please, accept next patch, while upstream in progress of review. Also, I didn't review another parts of configure. (some modules can be broken too)


Emerge information:

owlbook@kraken:~> emerge --info
Portage 3.0.20 (python 3.9.5-final-0, default/linux/amd64/17.1, gcc-10.3.0, glibc-2.33-r1, 5.10.27-gentoo x86_64)
=================================================================
System uname: Linux-5.10.27-gentoo-x86_64-Intel-R-_Core-TM-_i5-8265U_CPU_@_1.60GHz-with-glibc2.33
KiB Mem:    24457704 total,  16636428 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 05 Oct 2021 11:30:01 +0000
Head commit of repository gentoo: 1346f8c2ef6c78007bc0e41c771495aaaa217e17                   
Head commit of repository owlerlay: 172c1dd4c7d6219f36fbe99ef342e2cc78c89c67                                                                                                                                                                
                                                           
Head commit of repository steam-overlay: d90ce0627d7c30027f4971dce6f67f22abd71e6d
                                                                                                                                                                                                                                            
sh bash 5.1_p8                   
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2                                                                                                                                                                                                         app-shells/bash:          5.1_p8::gentoo                                                                                                                                                                                                    
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.34.0::gentoo    
dev-lang/python:          3.9.5_p2::gentoo
dev-lang/rust:            1.52.1::gentoo
dev-util/cmake:           3.20.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo                                                                                                                                                                                  sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            10.3.0-r1::gentoo                                                                                                                                                                                                 sys-devel/gcc-config:     2.4::gentoo                                                                                                                                                                                                       sys-devel/libtool:        2.4.6-r6::gentoo                                                                                                                                                                                                  sys-devel/make:           4.3::gentoo                                                                                                                                                                                                       sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)                                                                                                                                                                                 sys-libs/glibc:           2.33-r1::gentoo                                                                                                                                                                                                   Repositories:                                                                                                                                                                                                                                                                                                                                                                                                                                                                           gentoo                                                                                                                                                                                                                                      
    location: /var/db/repos/gentoo                                                                                                                                                                                                          
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 

owlerlay
    location: /var/db/repos/owlerlay
    sync-type: git
    sync-uri: https://git.owlhost.in/owlerlay

steam-overlay
    location: /usr/local/portage/steam-overlay
    sync-type: git
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

Installed sets: @steam
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe -march=native"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=native"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j7"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="256-color X acl alsa amd64 apng bash-completion bluetooth bzip2 cairo cli crypt cups dbus dri elogind fortran gdbm gif iconv ipv6 jack jpeg libglvnd libtirpc mad multilib ncurses nls nptl opengl openmp pam pcre png pulseaudio readline sane seccomp split-usr ssl synaptics tcpd tiff truetype udev unicode unicode3 utf8 vim-syntax vulkan xattr xft xinerama zlib" ABI_X86="64 32" ADA_TARGET="gnat_2019" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Comment 1 Ilia Pavlikhin 2021-10-11 20:08:34 UTC
Created attachment 744504 [details, diff]
Little bit fixed patch (with full fixed behavior)

I've reworked patch for satisfy behavior:

1. Argument --enable-opus not passed - autochecking and linking to opus
2. Argument --enable-opus passed - autochecking and linking to opus
3. Argument --enable-opus=no passed - disabled linking to opus
4. Argument --disable-opus - same as --enable-opus=no
Comment 2 Ilia Pavlikhin 2021-10-11 20:24:07 UTC
Created attachment 744507 [details]
Simple application for listing available codes in PJSIP

Building is pretty simple:

  g++ -o pjtest -lpjsua2 -lpj pjtest.cpp

Output (depend on enabled codecs of course):

  Available codecs:

   - speex/16000/1 (priority: 130)
   - speex/8000/1 (priority: 129)
   - speex/32000/1 (priority: 128)
   - GSM/8000/1 (priority: 128)
   - PCMU/8000/1 (priority: 128)
   - PCMA/8000/1 (priority: 128)
   - G722/16000/1 (priority: 128)
   - opus/48000/2 (priority: 128)
   - L16/44100/2 (priority: 0)
   - L16/44100/1 (priority: 0)
Comment 3 Ilia Pavlikhin 2021-10-12 09:48:18 UTC
Yes, same problem in FFMPEG part. I think fix of ebuild will be simpler, than fix upstream aconfigure.ac. Just don't pass any --enable-FEATURE flag if it's already enabled by default.
Comment 4 Jaco Kroon 2022-06-09 20:16:21 UTC
I've previously created PRs for --enabled,disable}-ssl too.  They're not interested.  I've now gone through the ./configure for all options, and adjusted as needed (all of them).

It should be noted that asterisk doesn't need any of this, other than ssl, which is probably why none of this was ever properly picked up.
Comment 5 Larry the Git Cow gentoo-dev 2022-06-15 13:32:15 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74bc4476b50218718af7c43038176f1d69c50e61

commit 74bc4476b50218718af7c43038176f1d69c50e61
Author:     Jaco Kroon <jaco@uls.co.za>
AuthorDate: 2021-07-24 08:36:57 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2022-06-15 13:32:11 +0000

    net-libs/pjproject: Version 2.12.1.
    
    Upstream release.
    
    Remove the need for custom patches (which is still required but no
    longer applies, instead, rely on ./configure detecting openssl, we do
    depend on it, and only --disable-ssl works, passing --enable-ssl also
    effectively disables ssl).
    
    Compile tested asterisk 13, 16 and 18 (in-tree versions) against this.
    Would appreciate a double-check on this one.  One version from each is
    sufficient.
    
    Since the two libraries that were the target of parallel build failures
    are now one, I believe the parallel build issue is fixed too.
    
    Included patch for CVE-2022-31031
    
    Closes: https://bugs.gentoo.org/833765
    Closes: https://bugs.gentoo.org/817803
    Closes: https://bugs.gentoo.org/808099
    Closes: https://bugs.gentoo.org/834491
    Bug: https://bugs.gentoo.org/803614
    Bug: https://bugs.gentoo.org/765799
    Bug: https://bugs.gentoo.org/829894
    Package-Manager: Portage-3.0.20, Repoman-3.0.2
    Signed-off-by: Jaco Kroon <jaco@uls.co.za>
    Closes: https://github.com/gentoo/gentoo/pull/21761
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 net-libs/pjproject/Manifest                        |   1 +
 .../files/pjproject-2.12.1-CVE-2022-31031.patch    |  41 +++++++
 net-libs/pjproject/pjproject-2.12.1.ebuild         | 125 +++++++++++++++++++++
 3 files changed, 167 insertions(+)