On Sun Jul 10, 2022 at 09:54:00PM +0200, Omar Polo wrote: > I was taking a look at deadbeef for curiosity and it seems that newer > versions needs this Grand Central Dispatch thingy. Fortunately, an > impavid user has already done the though work to get this working on > OpenBSD [0], so this took just minutes to port. (thanks!) > > [0]: https://github.com/apple/swift-corelibs-libdispatch/pull/559 > > (I've just added two small patches on top to drop a -O3 and -Werror) > > All but one test are passing! > > As-is this conflicts with devel/blocksruntime due to > /usr/local/include/Block.h. FWIW the two headers are practically > identical. Maybe this libdispatch will deprecate blocksruntime? Never > used blocks before so I don't know. > > With this installed i manage to start compiling deadbeef and get until > the linking of the deadbeef executable (which fails for other reasons > than libdispatch.) >
This may help us with asterisk? Of course this requires run-time tests. I have no chance to test this. Don't shoot the messenger! Rafael Index: Makefile.inc =================================================================== RCS file: /cvs/ports/telephony/asterisk/Makefile.inc,v retrieving revision 1.13 diff -u -p -r1.13 Makefile.inc --- Makefile.inc 12 May 2022 20:51:20 -0000 1.13 +++ Makefile.inc 12 Jul 2022 10:09:08 -0000 @@ -25,33 +25,14 @@ PERMIT_PACKAGE= Yes WANTLIB-main += c crypto curl curses edit gsm iconv iksemel WANTLIB-main += jansson m ogg portaudio pthread radcli spandsp WANTLIB-main += sqlite3 srtp2 ssl tiff uriparser unbound uuid -WANTLIB-main += vorbis vorbisenc vorbisfile xml2 xslt z +WANTLIB-main += vorbis vorbisenc vorbisfile xml2 xslt z BlocksRuntime DEBUG_PACKAGES= ${BUILD_PACKAGES} DPB_PROPERTIES= parallel -# Asterisk requires either nested functions (gcc extension), or -fblocks (clang). -# However -fblocks fails: -# -# - configure test fails on ld.bfd arches: -# -# echo 'int main(){return ^{return 42;}();}' | \ -# clang -o /tmp/blockstest -fblocks -x c -L/usr/local/lib -lBlocksRuntime - -# -# -> undefined reference to `_NSConcreteGlobalBlock' (also can be tested -# on ld.lld arches by adding "-fuse-ld=bfd") -# -# - runtime fails on ld.lld arches: dlopen()ing the .so modules results in -# undefined symbols from the BlocksRuntime lib (_NSConcreteStackBlock, -# _Block_object_dispose, _Block_object_assign, etc); Asterisk appears to -# start up but without modules loaded it is useless. -# -# So, as things stand, this requires building with gcc. -# -# If this is fixed and moved to clang, update telephony/asterisk-g729 in sync. COMPILER= ports-gcc -# XXX bsd.port.arch.mk is included below, before compiler.port.mk can set -# ONLY_FOR_ARCHS +#COMPILER= base-clang ports-gcc + ONLY_FOR_ARCHS= ${GCC49_ARCHS} SHARED_LIBS+= asteriskssl ${SHLIB_V} @@ -74,6 +55,7 @@ FLAVOR+= no_vm_odbc # MODGCC4_CPPLIBDEP is empty on a clang build. # leave it here, don't try to conditionalize it below, dpb doesn't like that. LIB_DEPENDS-main= ${MODGCC4_CPPLIBDEP} \ + devel/libdispatch \ audio/gsm \ audio/libogg \ audio/libvorbis \ @@ -113,6 +95,7 @@ MODPY_RUNDEP= No CPPFLAGS+= -I${X11BASE}/include -I${LOCALBASE}/include LDFLAGS+= -L${X11BASE}/lib -L${LOCALBASE}/lib +LDFLAGS+= -lBlocksRuntime CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" \ CFLAGS="${CFLAGS}" \ LDFLAGS="${LDFLAGS}" \ @@ -179,20 +162,19 @@ CFLAGS += -DHAVE_OPENSSL_BIO_METHOD .include <bsd.port.arch.mk> -#.if ${PROPERTIES:Mclang} -#BUILD_DEPENDS += devel/blocksruntime -#LDFLAGS += -lBlocksRuntime -#WANTLIB-main += ${COMPILER_LIBCXX} -#.else -CFLAGS += -ftrampolines +.if ${PROPERTIES:Mclang} +WANTLIB-main += ${COMPILER_LIBCXX} +.else +FLAGS += -ftrampolines WANTLIB-main += ${MODGCC4_CPPWANTLIB} -#.endif +.endif # calendar COMMENT-calendar= calendar support for Asterisk WANTLIB-calendar= crypto expat ical intl iksemel neon \ - proxy pthread ssl xml2 z + proxy pthread ssl xml2 z BlocksRuntime LIB_DEPENDS-calendar= devel/gettext,-runtime \ + devel/libdispatch \ net/neon \ textproc/libical .if !${BUILD_PACKAGES:M-calendar} @@ -202,24 +184,27 @@ CONFIGURE_ARGS+= --with-ical=no # http_post COMMENT-http_post= HTTP POST support for Asterisk LIB_DEPENDS-http_post= devel/gettext,-runtime \ + devel/libdispatch \ mail/gmime30 -WANTLIB-http_post= gio-2.0 glib-2.0 gmime-3.0 gobject-2.0 intl pthread +WANTLIB-http_post= gio-2.0 glib-2.0 gmime-3.0 gobject-2.0 intl pthread BlocksRuntime .if !${BUILD_PACKAGES:M-http_post} CONFIGURE_ARGS+= --with-gmime=no .endif # ldap COMMENT-ldap= LDAP support for Asterisk -LIB_DEPENDS-ldap= databases/openldap,-main -WANTLIB-ldap= ldap pthread +LIB_DEPENDS-ldap= databases/openldap,-main \ + devel/libdispatch +WANTLIB-ldap= ldap pthread BlocksRuntime .if !${BUILD_PACKAGES:M-ldap} CONFIGURE_ARGS+= --with-ldap=no .endif # freetds COMMENT-tds= MSSQL/Sybase support for Asterisk -LIB_DEPENDS-tds= databases/freetds -WANTLIB-tds= pthread sybdb +LIB_DEPENDS-tds= databases/freetds \ + devel/libdispatch +WANTLIB-tds= pthread sybdb BlocksRuntime .if !${BUILD_PACKAGES:M-tds} CONFIGURE_ARGS+= --with-tds=no .else @@ -228,8 +213,8 @@ CONFIGURE_ARGS+= --with-tds=${LOCALBASE} # kqueue COMMENT-kqueue= kqueue-backed timer for Asterisk -LIB_DEPENDS-kqueue= -WANTLIB-kqueue= pthread +LIB_DEPENDS-kqueue= devel/libdispatch +WANTLIB-kqueue= pthread BlocksRuntime # lua MODULES+= lang/lua @@ -237,8 +222,9 @@ MODLUA_SA= yes MODLUA_RUNDEP= no MODLUA_VERSION= 5.3 COMMENT-lua= lua support for Asterisk -LIB_DEPENDS-lua= ${MODLUA_LIB_DEPENDS} -WANTLIB-lua= ${MODLUA_WANTLIB} m pthread +LIB_DEPENDS-lua= ${MODLUA_LIB_DEPENDS} \ + devel/libdispatch +WANTLIB-lua= ${MODLUA_WANTLIB} m pthread BlocksRuntime .if !${BUILD_PACKAGES:M-lua} CONFIGURE_ARGS+= --with-lua=no MODLUA_BUILDDEP= no @@ -249,8 +235,9 @@ CONFIGURE_ENV+= LUA_VERSIONS="${MODLUA_ # odbc COMMENT-odbc= ODBC support for Asterisk -LIB_DEPENDS-odbc= databases/iodbc -WANTLIB-odbc= iodbc pthread +LIB_DEPENDS-odbc= databases/iodbc \ + devel/libdispatch +WANTLIB-odbc= iodbc pthread BlocksRuntime .if !${BUILD_PACKAGES:M-odbc} CONFIGURE_ARGS+= --with-iodbc=no \ --with-ltdl=no @@ -258,24 +245,27 @@ CONFIGURE_ARGS+= --with-iodbc=no \ # postgresql COMMENT-pgsql= PostgreSQL support for Asterisk -WANTLIB-pgsql= pq pthread z -LIB_DEPENDS-pgsql= databases/postgresql +WANTLIB-pgsql= pq pthread z BlocksRuntime +LIB_DEPENDS-pgsql= databases/postgresql \ + devel/libdispatch .if !${BUILD_PACKAGES:M-pgsql} CONFIGURE_ARGS+= --with-postgres=no .endif # snmp COMMENT-snmp= Net-SNMP support for Asterisk -WANTLIB-snmp= netsnmp netsnmpagent netsnmpmibs pthread -LIB_DEPENDS-snmp= net/net-snmp +WANTLIB-snmp= netsnmp netsnmpagent netsnmpmibs pthread BlocksRuntime +LIB_DEPENDS-snmp= net/net-snmp \ + devel/libdispatch .if !${BUILD_PACKAGES:M-snmp} CONFIGURE_ARGS+= --with-snmp=no .endif # speex COMMENT-speex= Speex codec for Asterisk -WANTLIB-speex= m ogg pthread speex speexdsp -LIB_DEPENDS-speex= audio/speex>=1.2rc1 +WANTLIB-speex= m ogg pthread speex speexdsp BlocksRuntime +LIB_DEPENDS-speex= audio/speex>=1.2rc1 \ + devel/libdispatch .if !${BUILD_PACKAGES:M-speex} CONFIGURE_ARGS+= --with-speex=no .endif @@ -283,8 +273,9 @@ CONFIGURE_ARGS+= --with-speex=no .if ${MULTI_PACKAGES:M-vm_imap} # vm_imap COMMENT-vm_imap= IMAP voicemail support for Asterisk -LIB_DEPENDS-vm_imap= mail/alpine,-c-client -WANTLIB-vm_imap= c-client crypto pthread ssl +LIB_DEPENDS-vm_imap= mail/alpine,-c-client \ + devel/libdispatch +WANTLIB-vm_imap= c-client crypto pthread ssl BlocksRuntime . if !${BUILD_PACKAGES:M-vm_imap} CONFIGURE_ARGS+= --with-imap=no . else @@ -297,8 +288,9 @@ MENUSELECT+= --enable app_voicemail_ima .if ${MULTI_PACKAGES:M-vm_imap} # vm_odbc COMMENT-vm_odbc= ODBC voicemail support for Asterisk -LIB_DEPENDS-vm_odbc= databases/iodbc -WANTLIB-vm_odbc= iodbc pthread +LIB_DEPENDS-vm_odbc= databases/iodbc \ + devel/libdispatch +WANTLIB-vm_odbc= iodbc pthread BlocksRuntime . if ${BUILD_PACKAGES:M-vm_odbc} MENUSELECT+= --enable app_voicemail_odbc . endif Index: 16/Makefile =================================================================== RCS file: /cvs/ports/telephony/asterisk/16/Makefile,v retrieving revision 1.17 diff -u -p -r1.17 Makefile --- 16/Makefile 27 Jun 2022 08:23:06 -0000 1.17 +++ 16/Makefile 12 Jul 2022 10:09:08 -0000 @@ -3,6 +3,16 @@ PJ_V= 2.12 SHLIB_V= 0.0 VERSION_SPEC= >=16.0,<17.0 PORTROACH= limit:^16\. -REVISION-main= 0 +REVISION-main= 1 +REVISION-calendar= 0 +REVISION-http_post= 0 +REVISION-kqueue= 0 +REVISION-ldap= 0 +REVISION-lua= 0 +REVISION-odbc= 0 +REVISION-pgsql= 0 +REVISION-snmp= 0 +REVISION-speex= 0 +REVISION-tds= 0 .include <bsd.port.mk> Index: 18/Makefile =================================================================== RCS file: /cvs/ports/telephony/asterisk/18/Makefile,v retrieving revision 1.19 diff -u -p -r1.19 Makefile --- 18/Makefile 27 Jun 2022 08:23:07 -0000 1.19 +++ 18/Makefile 12 Jul 2022 10:09:08 -0000 @@ -3,6 +3,16 @@ PJ_V= 2.12 SHLIB_V= 0.0 VERSION_SPEC= >=18.0,<19.0 PORTROACH= limit:^18\. -REVISION-main= 0 +REVISION-main= 1 +REVISION-calendar= 0 +REVISION-http_post= 0 +REVISION-kqueue= 0 +REVISION-ldap= 0 +REVISION-lua= 0 +REVISION-odbc= 0 +REVISION-pgsql= 0 +REVISION-snmp= 0 +REVISION-speex= 0 +REVISION-tds= 0 .include <bsd.port.mk> Index: 19/Makefile =================================================================== RCS file: /cvs/ports/telephony/asterisk/19/Makefile,v retrieving revision 1.17 diff -u -p -r1.17 Makefile --- 19/Makefile 27 Jun 2022 08:23:07 -0000 1.17 +++ 19/Makefile 12 Jul 2022 10:09:08 -0000 @@ -3,6 +3,16 @@ PJ_V= 2.12 SHLIB_V= 0.0 VERSION_SPEC= >=19.0,<20.0 # no PORTROACH marker for the highest branch, to allow finding new branches -REVISION-main= 0 +REVISION-main= 1 +REVISION-calendar= 0 +REVISION-http_post= 0 +REVISION-kqueue= 0 +REVISION-ldap= 0 +REVISION-lua= 0 +REVISION-odbc= 0 +REVISION-pgsql= 0 +REVISION-snmp= 0 +REVISION-speex= 0 +REVISION-tds= 0 .include <bsd.port.mk>