Attempt to update net-misc/asterisk to 16.15.1-r2 fails with a missing header file in compilation: x86_64-pc-linux-gnu-gcc -o io.o -c io.c -MD -MT io.o -MF .io.o.d -MP -pthread -I/scratch/tmp/portage/net-misc/asterisk-16.15.1-r2/work/asterisk-16.15.1/include -O2 -march=native -mtune=native -fno-omit-frame-pointer -pipe -I/usr/include/libxml2 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3 -O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DAST_MODULE=\"core\" -DAST_IN_CORE -O2 -march=native -mtune=native -fno-omit-frame-pointer -pipe io.c:38:10: fatal error: systemd/sd-daemon.h: No such file or directory 38 | #include <systemd/sd-daemon.h> | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[1]: *** [/scratch/tmp/portage/net-misc/asterisk-16.15.1-r2/work/asterisk-16.15.1/Makefile.rules:165: io.o] Error 1 I have a non-systemd install of gentoo, using "-systemd" in make.conf, have sys-auth/elogind installed. emerge --info: Portage 3.0.13 (python 3.7.9-final-0, default/linux/amd64/17.0, gcc-9.3.0, glibc-2.32-r5, 5.10.6-gentoo x86_64) ================================================================= System uname: Linux-5.10.6-gentoo-x86_64-Intel-R-_Core-TM-_i7-4810MQ_CPU_@_2.80GHz-with-gentoo-2.7 KiB Mem: 16299588 total, 3599884 free KiB Swap: 53513300 total, 53513300 free Timestamp of repository gentoo: Tue, 26 Jan 2021 09:30:01 +0000 Head commit of repository gentoo: 4827b00977b4373ed05e98ece169ee11ceabf1fa sh bash 5.0_p18 ld GNU ld (Gentoo 2.34 p6) 2.34.0 app-shells/bash: 5.0_p18::gentoo dev-lang/perl: 5.30.3::gentoo dev-lang/python: 2.7.18-r6::gentoo, 3.6.12-r2::gentoo, 3.7.9-r2::gentoo, 3.8.7-r1::gentoo, 3.9.1-r1::gentoo, 3.10.0_alpha4::gentoo dev-util/cmake: 3.19.3::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.7::gentoo sys-apps/openrc: 0.42.1::gentoo sys-apps/sandbox: 2.20::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r5::gentoo sys-devel/automake: 1.11.6-r3::gentoo, 1.14.1-r2::gentoo, 1.15.1-r2::gentoo, 1.16.3-r1::gentoo sys-devel/binutils: 2.25.1-r1::gentoo, 2.26.1::gentoo, 2.28-r2::gentoo, 2.28.1::gentoo, 2.29.1-r1::gentoo, 2.30-r4::gentoo, 2.31.1-r6::gentoo, 2.32-r1::gentoo, 2.33.1-r1::gentoo, 2.34-r2::gentoo sys-devel/gcc: 4.5.4::gentoo, 4.8.5::gentoo, 4.9.3::gentoo, 4.9.4::gentoo, 5.4.0-r3::gentoo, 7.2.0-r1::gentoo, 8.2.0-r6::gentoo, 8.3.0-r3::gentoo, 9.1.0-r1::gentoo, 9.2.0-r4::gentoo, 9.3.0-r2::gentoo, 10.2.0-r5::gentoo sys-devel/gcc-config: 2.3.2-r1::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.32-r5::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-verify-metamanifest: yes sync-rsync-extra-opts: sync-rsync-verify-max-age: 24 sync-rsync-verify-jobs: 1 science location: /var/lib/layman/science masters: gentoo priority: 1 unity-gentoo location: /var/lib/layman/unity-gentoo masters: gentoo priority: 2 crossdev location: /opt/portage masters: gentoo science priority: 3 x-portage location: /local/portage masters: gentoo priority: 4 ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=native -mtune=native -fno-omit-frame-pointer -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /var/bind /var/lib/hsqldb /var/lib/i2pd/certificates" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.3/ext-active/ /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.3/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.3/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -march=native -mtune=native -fno-omit-frame-pointer -pipe" DISTDIR="/usr/portage/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" 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 splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://gentoo.supp.name/ http://ftp.fi.muni.cz/pub/linux/gentoo/ http://147.251.48.205/pub/linux/gentoo/ http://gentoo.mirror.dkm.cz/pub/gentoo/ http://86.49.49.49/pub/gentoo/ ftp://gentoo.mirror.dkm.cz/pub/gentoo/ ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://141.76.119.131/pub/mirrors/gentoo ftp://ftp.sh.cvut.cz/MIRRORS/gentoo ftp://mirror.switch.ch/mirror/gentoo/ http://gentoo.supp.name/ rsync://gentoo.mirror.dkm.cz/gentoo/ http://gentoo.mirror.web4u.cz/" LANG="C" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j8" 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="/scratch/tmp" USE="X acl aes alsa amd64 berkdb bluetooth bzip2 cli crypt cups dri fortran gcj gdbm hal iconv ipv6 lapack latex libglvnd libtirpc linguas_cs linguas_de linguas_en linguas_nl linguas_sk mbox mmx multilib multislot ncurses nls nptl openmp pam pcre readline seccomp split-usr sse sse2 sse3 sse4 ssl static-libs systemtap tcpd tetex unicode webp xattr zlib" ABI_X86="64 32" ADA_TARGET="gnat_2018" 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="keyboard mouse 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="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7 python3_8 python3_9" RUBY_TARGETS="ruby25 ruby26 ruby27 ruby30" USERLAND="GNU" VIDEO_CARDS="nvidia nouveau vesa nv fbdev v4l vga" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Looks similar to what seem to be happening in bug #767259 There's this unconditional automagic check that enables HAVE_SYSTEMD: AST_PKG_CONFIG_CHECK([SYSTEMD], [libsystemd]) Which I guess could be an issue if ever switch from/to systemd. I can reproduce include error if I add dummy libsystemd.pc file without working libraries/includes.
I found a workaround: cd /usr/include; ln -s elogind/systemd systemd Then the include file is found and compilation successfull. Obviously, the configure test in asterisk finds existing libsystemd.pc, which is however provided by elogind, not systemd, and expects headers to be in /usr/include/systemd, which does not exist.
jkroon@plastiekpoot ~ $ ls -lah /usr/include/systemd ls: cannot access '/usr/include/systemd': No such file or directory But asterisk merges for me ... Could you please confirm your USE flags for asterisk specifically please? I def do not have systemd installed.
But I guess you do not have elogind either. Try to install elogind and then asterisk. After the workaaround andupdate, I have these USE flags for asterisk: [I] net-misc/asterisk Available versions: 13.38.1 (~)13.38.1-r1 13.38.1-r2(0/13) (~)16.15.1 (~)16.15.1-r1 (~)16.15.1-r2(0/16) {alsa blocks bluetooth calendar +caps cluster codec2 curl dahdi debug doc freetds gtalk http iconv ilbc ldap libressl lua mysql newt odbc oss pjproject portaudio postgres radius selinux snmp span speex srtp +ssl static statsd syslog unbound vorbis xmpp KERNEL="linux" LUA_SINGLE_TARGET="lua5-1 lua5-2 lua5-3 lua5-4" VOICEMAIL_STORAGE="(+)file imap odbc"} Installed versions: 16.15.1-r2(0/16)(13:41:15 01/26/21)(alsa bluetooth caps gtalk iconv ssl xmpp -blocks -calendar -cluster -codec2 -curl -dahdi -debug -doc -freetds -http -ilbc -ldap -libressl -lua -mysql -newt -odbc -oss -pjproject -portaudio -postgres -radius -selinux -snmp -span -speex -srtp -static -statsd -syslog -unbound -vorbis KERNEL="linux" LUA_SINGLE_TARGET="lua5-1 -lua5-2 -lua5-3 -lua5-4" VOICEMAIL_STORAGE="file -imap -odbc") Homepage: https://www.asterisk.org/ Description: Asterisk: A Modular Open Source PBX System
May want to see comments in the see also bug I linked, user has a libsystemd.pc symlink I (personally) can't explain at the moment given elogind doesn't create that symlink for me. But being a automagic dep is still an issue in itself.
(In reply to Jiri Pittner from comment #4) > But I guess you do not have elogind either. > Try to install elogind and then asterisk. jkroon@plastiekpoot ~ $ equery list -ipo elogind * Searching for elogind ... [I-O] [ ] sys-auth/elogind-243.7:0 [-P-] [ ~] sys-auth/elogind-243.7-r1:0 [-P-] [ ~] sys-auth/elogind-246.9.2:0 > After the workaaround andupdate, I have these USE flags for asterisk: > [I] net-misc/asterisk > Available versions: 13.38.1 (~)13.38.1-r1 13.38.1-r2(0/13) (~)16.15.1 > (~)16.15.1-r1 (~)16.15.1-r2(0/16) {alsa blocks bluetooth calendar +caps > cluster codec2 curl dahdi debug doc freetds gtalk http iconv ilbc ldap > libressl lua mysql newt odbc oss pjproject portaudio postgres radius selinux > snmp span speex srtp +ssl static statsd syslog unbound vorbis xmpp > KERNEL="linux" LUA_SINGLE_TARGET="lua5-1 lua5-2 lua5-3 lua5-4" > VOICEMAIL_STORAGE="(+)file imap odbc"} > Installed versions: 16.15.1-r2(0/16)(13:41:15 01/26/21)(alsa bluetooth > caps gtalk iconv ssl xmpp -blocks -calendar -cluster -codec2 -curl -dahdi > -debug -doc -freetds -http -ilbc -ldap -libressl -lua -mysql -newt -odbc > -oss -pjproject -portaudio -postgres -radius -selinux -snmp -span -speex > -srtp -static -statsd -syslog -unbound -vorbis KERNEL="linux" > LUA_SINGLE_TARGET="lua5-1 -lua5-2 -lua5-3 -lua5-4" VOICEMAIL_STORAGE="file > -imap -odbc") > Homepage: https://www.asterisk.org/ > Description: Asterisk: A Modular Open Source PBX System [ebuild R ] net-misc/asterisk-16.15.1-r2:0/16::gentoo USE="alsa bluetooth caps gtalk* iconv ssl xmpp* -blocks -calendar -cluster -codec2 -curl -dahdi -debug -doc -freetds -http -ilbc -ldap -libressl -lua -mysql* -newt* -odbc* -oss -pjproject* -portaudio -postgres -radius (-selinux) -snmp* -span* -speex -srtp* -static -statsd -syslog -unbound -vorbis" LUA_SINGLE_TARGET="lua5-1 -lua5-2 -lua5-3 -lua5-4" VOICEMAIL_STORAGE="file* -imap -odbc*" 0 KiB ... On the referenced bug there is mention of the profile of 17.0 vs 17.1. Could you please do equery belongs /usr/lib/pkgconfig/libsystemd.pc This (and the referenced bug) really is an issue with THAT package IMHO. Having said that - the automagic dependency I do agree is a problem, not sure how to solve that one though, so if you have suggestions on how to best solve it, please do share.
Yes, I still have 17.0 profile, as the profile change seems to be non-trivial with a non-negligible risc of breaking the system, I plan to use new profile only with a new install on a new hardware in the future. But I am not convinced this would be the cause of the problem. equery belongs /usr/lib/pkgconfig/libsystemd.pc * Searching for /usr/lib/pkgconfig/libsystemd.pc ... sys-auth/elogind-243.7 (/usr/lib64/pkgconfig/libelogind.pc) Sorry, no ideas how to fix it, I am a mere user of gentoo with no deep knowledge of the ebuild system.
Oh right, equery follow symlinks so that's not going to say much. "qfile /usr/lib/pkgconfig/libsystemd.pc" Will return nothing if it's orphaned or doesn't exist, otherwise show the package. Some orphans make sense (e.g. created by eselect), but I have the feeling this one doesn't if it's one.
qfile returns nothing. I have the feeling I might have created that symlink myself in order to compile some third party software depending on systemd and then forgotten on it, so it was my mistake. Nevertheless, ebuilds of asterisk etc. should probably respect the "-systemd" USE flag and give it a priority over a found libsystemd.pc.
(In reply to Jiri Pittner from comment #9) > qfile returns nothing. > I have the feeling I might have created that symlink myself in order > to compile some third party software depending on systemd and then forgotten > on it, so it was my mistake. > Nevertheless, ebuilds of asterisk etc. should probably respect the > "-systemd" USE flag and give it a priority over a found libsystemd.pc. Ok, so that sorts that out at least. I'll deal with the automagic dependency bug in the next release.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c21e28747944f84b98359b37cfe4d2f2e0b7bb0b commit c21e28747944f84b98359b37cfe4d2f2e0b7bb0b Author: Jaco Kroon <jaco@uls.co.za> AuthorDate: 2021-03-13 19:59:24 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2021-03-19 08:51:49 +0000 net-misc/asterisk: rev bump for 16. Same changes as for 13, except that format_ogg_speex isn't being dropped since it it was introduced in 16. Closes: https://bugs.gentoo.org/772821 Introduce USE=deprecated to enable deprecated apps/funcs/features. For now, this is only app_macro. Closes: https://bugs.gentoo.org/775005 net-misc/asterisk: injects some CFLAGS. Thanks Sam. Closes: https://bugs.gentoo.org/767262 systemd automagic dependency. Closes: https://bugs.gentoo.org/775353 Make asterisk depend on the pjproject SUBSLOT. Ie, rebuild if pjproject gets updated. Closes: https://bugs.gentoo.org/761442 Repair "security" issue in that /var/lib/asterisk can now be root:root. The problem with having it asterisk: is that any arbitrary code vuln becomes a data modification one. So with this as root:root we can at least prevent modifications to /var/lib/asterisk whilst still allowing /var/lib/asterisk/astdb to be modified as required. Repair default voicemail selection. Thank you pkgcheck scan. Drop ASTCFLAGS= and ASTLDFLAGS since ./configure already imports these. I believe Tony added this as a hammer to deal with 775005 above since these got re-added again after the asterisk injected ones. By setting DEBUG= and OPTIMIZE= this problem should now be something of the past. Introduce GENTOO_ASTERISK_CUSTOM_MENUSELECT= environment variable that can be set from make.conf and takes a string similar to USE flags, except that these gets passed to menuselect one by one, if -option as --disable option, else --enable option. Prefixes + and - is supported, and will be stripped before passing to menuselect. menuselect has been patched to exit non-zero in case of invalid option passed to --enable or --disable, resulting in above being reliable (if you have something invalid in there, it will die). Accordingly drop format_ogg_speex which doesn't exist in asterisk 13. Drop no longer required ncurses dependencies (system libedit). Explicitly pass ASTCACHEDIR=/var/cache/asterisk, and update install patch to not install this path, handle in tmpfiles and initd since we're not supposed to install into /var/cache either ... Package-Manager: Portage-3.0.13, Repoman-3.0.2 Signed-off-by: Jaco Kroon <jaco@uls.co.za> Signed-off-by: Joonas Niilola <juippis@gentoo.org> net-misc/asterisk/asterisk-16.16.2-r1.ebuild | 365 +++++++++++++++++++++ .../asterisk-16.16.2-no-var-run-install.patch | 2 +- net-misc/asterisk/files/asterisk.tmpfiles3.conf | 2 + net-misc/asterisk/files/confd-16.16.2-r1 | 171 ++++++++++ net-misc/asterisk/files/initd-16.16.2-r1 | 363 ++++++++++++++++++++ net-misc/asterisk/metadata.xml | 3 +- 6 files changed, 904 insertions(+), 2 deletions(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c7d0aa6515bffacdaed2237cd28231100465422 commit 2c7d0aa6515bffacdaed2237cd28231100465422 Author: Jaco Kroon <jaco@uls.co.za> AuthorDate: 2021-03-13 12:13:02 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2021-03-19 08:51:49 +0000 net-misc/asterisk: version bump for 13. This is primarily aimed to fixing bugs, asterisk 13 is sec-only upstream, so no further fixes will be made except to address bugs reported to bus.gentoo.org. Note that bugs aren't being closed since 16* is still affected (will be fixed on next bump, just waiting for 16.17.0 to be cut). Bug: https://bugs.gentoo.org/775005 net-misc/asterisk: injects some CFLAGS. Thanks Sam. Bug: https://bugs.gentoo.org/767262 systemd automagic dependency. Bug: https://bugs.gentoo.org/775353 Make asterisk depend on the pjproject SUBSLOT. Ie, rebuild if pjproject gets updated. Bug: https://bugs.gentoo.org/761442 Repair "security" issue in that /var/lib/asterisk can now be root:root. The problem with having it asterisk: is that any arbitrary code vuln becomes a data modification one. So with this as root:root we can at least prevent modifications to /var/lib/asterisk whilst still allowing /var/lib/asterisk/astdb to be modified as required. Repair default voicemail selection. Thank you pkgcheck scan. Drop ASTCFLAGS= and ASTLDFLAGS since ./configure already imports these. I believe Tony added this as a hammer to deal with 775005 above since these got re-added again after the asterisk injected ones. By setting DEBUG= and OPTIMIZE= this problem should now be something of the past. Introduce GENTOO_ASTERISK_CUSTOM_MENUSELECT= environment variable that can be set from make.conf and takes a string similar to USE flags, except that these gets passed to menuselect one by one, if -option as --disable option, else --enable option. Prefixes + and - is supported, and will be stripped before passing to menuselect. menuselect has been patched to exit non-zero in case of invalid option passed to --enable or --disable, resulting in above being reliable (if you have something invalid in there, it will die). Accordingly drop format_ogg_speex which doesn't exist in asterisk 13. Drop no longer required ncurses dependencies (system libedit). Signed-off-by: Jaco Kroon <jaco@uls.co.za> Signed-off-by: Joonas Niilola <juippis@gentoo.org> net-misc/asterisk/asterisk-13.38.2-r1.ebuild | 348 +++++++++++++++++++++ .../asterisk-13.38.2-r1-menuselect-exitcodes.patch | 67 ++++ 2 files changed, 415 insertions(+)