aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Falsi <madpilot@FreeBSD.org>2022-08-30 08:06:02 +0000
committerGuido Falsi <madpilot@FreeBSD.org>2022-08-30 08:06:02 +0000
commit103c97c2f57a0b959c68f69650dc98648f2dd908 (patch)
tree3d3dbeb5f37b545b46f7ba59fd9fe4161d5281bd
parentbaf7c8d360970a9ae2d56b0126955fca9940cfbb (diff)
downloadports-103c97c2f57a0b959c68f69650dc98648f2dd908.tar.gz
ports-103c97c2f57a0b959c68f69650dc98648f2dd908.zip
net/asterisk16: Add red_geolocation support
Add a GEOLOCATION option (off by default) to allow building the new res_geolocation module, which allows to use geolocation information in SIP protocol (upstream provider support required). Since it requires architecture specific flags to be passed to ld, I've enabled it only for tier 1 architectures at present. PR: 266053 Tested by: Seneca Cunningham <seneca@vybenetworks.com>
-rw-r--r--net/asterisk16/Makefile28
-rw-r--r--net/asterisk16/files/patch-Makefile.rules27
2 files changed, 53 insertions, 2 deletions
diff --git a/net/asterisk16/Makefile b/net/asterisk16/Makefile
index c903cc3420fe..0bbe2850d433 100644
--- a/net/asterisk16/Makefile
+++ b/net/asterisk16/Makefile
@@ -62,8 +62,9 @@ OPTIONS_DEFAULT= CURL FREETDS GSM LUA MACRO MP3PLAYER NEWT ODBC OPUS MYSQL PGSQ
PJSIP PORTAUDIO RADIUS SNMP SPANDSP SPEEX SRTP URIPARSER \
VORBIS XMLDOC
-OPTIONS_DEFINE_i386= DAHDI
-OPTIONS_DEFINE_amd64= DAHDI
+OPTIONS_DEFINE_i386= DAHDI GEOLOCATION
+OPTIONS_DEFINE_amd64= DAHDI GEOLOCATION
+OPTIONS_DEFINE_aarch64= GEOLOCATION
OPTIONS_DEFINE_sparc64= DAHDI
OPTIONS_DEFINE_powerpc= DAHDI
OPTIONS_DEFINE_powerpc64= DAHDI
@@ -99,6 +100,7 @@ BACKTRACE_DESC?= Stack backtrace support via (lib)execinfo
DAHDI_DESC?= DAHDI support
EXCHANGE_DESC?= Exchange calendar support
G729_DESC?= Install G.729 format sounds for Music-on-Hold (MoH)
+GEOLOCATION_DESC?= Enable SIP Geolocation support
MACRO_DESC?= Enable app_macro (deprecated)
MP3PLAYER_DESC= Install MP3 Player for Music-On-Hold (mpg123)
NEWG711_DESC?= New G711 Codec
@@ -134,6 +136,8 @@ FREETDS_CONFIGURE_ON= --with-tds=${LOCALBASE}
FREETDS_CONFIGURE_OFF= --without-tds
FREETDS_LIB_DEPENDS= libsybdb.so:databases/freetds
+GEOLOCATION_USE= GNOME=libxslt
+
GSM_CONFIGURE_WITH= gsm
GSM_LIB_DEPENDS= libgsm.so:audio/gsm
@@ -212,6 +216,7 @@ ASTERISK_GROUP?= asterisk
USERS= ${ASTERISK_USER}
GROUPS= ${ASTERISK_GROUP} dahdi
+.include <bsd.port.options.mk>
.include <bsd.port.pre.mk>
.if empty(ICONV_LIB)
@@ -230,6 +235,16 @@ PLIST_SUB+= ASTERISK_USER=${ASTERISK_USER} \
ASTERISK_GROUP=${ASTERISK_GROUP} \
VARDIR=${VARDIR}
+.if ${PORT_OPTIONS:MGEOLOCATION}
+.if ${ARCH} == i386
+LLD_EMULATION= elf_i386
+.elif ${ARCH} == amd64
+LLD_EMULATION= elf_x86_64
+.elif ${ARCH} == aarch64
+LLD_EMULATION= aarch64elf
+.endif
+.endif
+
post-extract:
@${FIND} ${WRKSRC} -name '*.d' -delete
@@ -249,6 +264,9 @@ post-patch:
.if exists(${FILESDIR}/.asterisk.makeopts)
${CP} ${FILESDIR}/.asterisk.makeopts ${WRKSRC}/menuselect.makeopts
.endif
+
+post-patch-GEOLOCATION-on:
+ @${REINPLACE_CMD} -e 's/%%LLD_EMULATION%%/${LLD_EMULATION}/' ${WRKSRC}/Makefile.rules
post-patch-SYSINFO-on:
@${REINPLACE_CMD} -e 's/%%LIBSYSINFO%%/-lsysinfo/' ${WRKSRC}/main/Makefile
@@ -262,6 +280,12 @@ post-configure:
@cd ${WRKSRC} && ./menuselect/menuselect --disable res_timing_kqueue menuselect.makeopts
@cd ${WRKSRC} && ./menuselect/menuselect --enable chan_mgcp menuselect.makeopts
@cd ${WRKSRC} && ./menuselect/menuselect --enable res_pktccops menuselect.makeopts
+
+post-configure-GEOLOCATION-on:
+ @cd ${WRKSRC} && ./menuselect/menuselect --enable res_geolocation menuselect.makeopts
+
+post-configure-GEOLOCATION-off:
+ @cd ${WRKSRC} && ./menuselect/menuselect --disable res_geolocation menuselect.makeopts
post-configure-MACRO-on:
@cd ${WRKSRC} && ./menuselect/menuselect --enable app_macro menuselect.makeopts
diff --git a/net/asterisk16/files/patch-Makefile.rules b/net/asterisk16/files/patch-Makefile.rules
new file mode 100644
index 000000000000..9815b1524554
--- /dev/null
+++ b/net/asterisk16/files/patch-Makefile.rules
@@ -0,0 +1,27 @@
+--- Makefile.rules.orig 2022-08-18 15:13:55 UTC
++++ Makefile.rules
+@@ -107,6 +107,11 @@ ifeq ($(C_COMPILER_FAMILY),clang)
+ # Clang -Werror warning suppressions
+ ifeq ($(C_COMPILER_FAMILY),clang)
+ CC_CFLAGS+=-Wno-unused-value -Wno-parentheses-equality
++ BINARY_LLD_FLAGS= -z noexecstack
++ LLD_EMULATION=%%LLD_EMULATION%%
++else
++ BINARY_LLD_FLAGS=
++ LLD_EMULATION=
+ endif
+
+ ifeq ($(GNU_LD),1)
+@@ -213,10 +218,10 @@ endif
+ # extern const size_t _binary_abc_def_xml_size;
+ %.o: %.xml
+ $(ECHO_PREFIX) echo " [LD] $^ -> $@"
+- $(CMD_PREFIX) $(CC) -g -nostartfiles -nodefaultlibs -nostdlib -r -Wl,-b,binary -o $@ $^
++ $(CMD_PREFIX) $(CC) -g -nostartfiles -nodefaultlibs -nostdlib $(BINARY_LLD_FLAGS) -r -Wl,-b,binary,-m,$(LLD_EMULATION) -o $@ $^
+
+ %.o: %.xslt
+ $(ECHO_PREFIX) echo " [LD] $^ -> $@"
+- $(CMD_PREFIX) $(CC) -g -nostartfiles -nodefaultlibs -nostdlib -r -Wl,-b,binary -o $@ $^
++ $(CMD_PREFIX) $(CC) -g -nostartfiles -nodefaultlibs -nostdlib $(BINARY_LLD_FLAGS) -r -Wl,-b,binary,-m,$(LLD_EMULATION) -o $@ $^
+
+ dist-clean:: clean