2019-02-11 18:14:43 +01:00
|
|
|
let
|
|
|
|
|
2019-08-04 11:34:15 +02:00
|
|
|
# the default list from v1.8.7, except with applications/mod_signalwire also disabled
|
2019-02-11 18:14:43 +01:00
|
|
|
defaultModules = mods: with mods; [
|
|
|
|
applications.commands
|
|
|
|
applications.conference
|
|
|
|
applications.db
|
|
|
|
applications.dptools
|
|
|
|
applications.enum
|
|
|
|
applications.esf
|
|
|
|
applications.expr
|
|
|
|
applications.fifo
|
|
|
|
applications.fsv
|
|
|
|
applications.hash
|
|
|
|
applications.httapi
|
|
|
|
applications.sms
|
|
|
|
applications.spandsp
|
|
|
|
applications.valet_parking
|
|
|
|
applications.voicemail
|
|
|
|
|
|
|
|
applications.curl
|
|
|
|
|
|
|
|
codecs.amr
|
|
|
|
codecs.b64
|
|
|
|
codecs.g723_1
|
|
|
|
codecs.g729
|
|
|
|
codecs.h26x
|
|
|
|
codecs.opus
|
|
|
|
|
|
|
|
dialplans.asterisk
|
|
|
|
dialplans.xml
|
|
|
|
|
|
|
|
endpoints.loopback
|
|
|
|
endpoints.rtc
|
|
|
|
endpoints.skinny
|
|
|
|
endpoints.sofia
|
|
|
|
endpoints.verto
|
|
|
|
|
|
|
|
event_handlers.cdr_csv
|
|
|
|
event_handlers.cdr_sqlite
|
|
|
|
event_handlers.event_socket
|
|
|
|
|
|
|
|
formats.local_stream
|
|
|
|
formats.native_file
|
|
|
|
formats.png
|
|
|
|
formats.sndfile
|
|
|
|
formats.tone_stream
|
|
|
|
|
|
|
|
languages.lua
|
|
|
|
|
|
|
|
loggers.console
|
|
|
|
loggers.logfile
|
|
|
|
loggers.syslog
|
|
|
|
|
|
|
|
say.en
|
|
|
|
|
|
|
|
xml_int.cdr
|
|
|
|
xml_int.rpc
|
|
|
|
xml_int.scgi
|
|
|
|
];
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2019-02-01 23:39:15 +01:00
|
|
|
{ fetchurl, stdenv, lib, ncurses, curl, pkgconfig, gnutls, readline
|
2017-02-14 09:43:33 +01:00
|
|
|
, openssl, perl, sqlite, libjpeg, speex, pcre
|
2019-02-11 18:17:56 +01:00
|
|
|
, ldns, libedit, yasm, which, lua, libopus, libsndfile, libtiff
|
2018-12-10 23:49:26 +01:00
|
|
|
|
2019-02-11 18:14:43 +01:00
|
|
|
, modules ? defaultModules
|
2019-02-01 23:39:15 +01:00
|
|
|
, postgresql
|
|
|
|
, enablePostgres ? true
|
|
|
|
|
2018-12-10 23:49:26 +01:00
|
|
|
, SystemConfiguration
|
|
|
|
}:
|
2011-01-21 23:12:34 +01:00
|
|
|
|
2019-02-11 18:14:43 +01:00
|
|
|
let
|
|
|
|
|
|
|
|
availableModules = import ./modules.nix { inherit curl lua libopus; };
|
|
|
|
|
|
|
|
enabledModules = modules availableModules;
|
|
|
|
|
|
|
|
modulesConf = let
|
|
|
|
lst = builtins.map (mod: mod.path) enabledModules;
|
|
|
|
str = lib.strings.concatStringsSep "\n" lst;
|
|
|
|
in builtins.toFile "modules.conf" str;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2011-01-21 23:12:34 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-04 11:34:15 +02:00
|
|
|
name = "freeswitch-1.8.7";
|
2011-01-21 23:12:34 +01:00
|
|
|
|
2012-09-26 22:34:55 +02:00
|
|
|
src = fetchurl {
|
2018-06-28 20:43:35 +02:00
|
|
|
url = "https://files.freeswitch.org/freeswitch-releases/${name}.tar.bz2";
|
2019-08-04 11:34:15 +02:00
|
|
|
sha256 = "0k52mxdfc5w9fdnz8kvfjiwnnjjhnpkirnyrfkhq7bad84m731z4";
|
2011-01-21 23:12:34 +01:00
|
|
|
};
|
2017-09-16 12:08:08 +02:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs libs/libvpx/build/make/rtcd.pl
|
|
|
|
substituteInPlace libs/libvpx/build/make/configure.sh \
|
|
|
|
--replace AS=\''${AS} AS=yasm
|
|
|
|
'';
|
2011-01-21 23:12:34 +01:00
|
|
|
|
2017-09-14 21:24:37 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2016-08-25 01:23:03 +02:00
|
|
|
buildInputs = [
|
2019-02-11 18:17:56 +01:00
|
|
|
openssl ncurses gnutls readline perl libjpeg
|
|
|
|
sqlite pcre speex ldns libedit yasm which
|
|
|
|
libsndfile libtiff
|
2019-02-01 23:39:15 +01:00
|
|
|
]
|
2019-02-11 18:14:43 +01:00
|
|
|
++ lib.unique (lib.concatMap (mod: mod.inputs) enabledModules)
|
2019-02-01 23:39:15 +01:00
|
|
|
++ lib.optionals enablePostgres [ postgresql ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ SystemConfiguration ];
|
2011-01-21 23:12:34 +01:00
|
|
|
|
2016-03-29 12:58:19 +02:00
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-error";
|
2014-11-28 18:40:19 +01:00
|
|
|
|
2016-02-26 18:38:15 +01:00
|
|
|
hardeningDisable = [ "format" ];
|
2016-02-11 02:38:14 +01:00
|
|
|
|
2019-02-01 23:39:15 +01:00
|
|
|
configureFlags = lib.optionals enablePostgres [ "--enable-core-pgsql-support" ];
|
|
|
|
|
2019-02-11 18:14:43 +01:00
|
|
|
preConfigure = ''
|
|
|
|
cp "${modulesConf}" modules.conf
|
|
|
|
'';
|
|
|
|
|
2019-02-12 16:54:36 +01:00
|
|
|
postInstall = ''
|
|
|
|
# helper for compiling modules... not generally useful; also pulls in perl dependency
|
|
|
|
rm "$out"/bin/fsxs
|
|
|
|
'';
|
|
|
|
|
2011-01-21 23:12:34 +01:00
|
|
|
meta = {
|
|
|
|
description = "Cross-Platform Scalable FREE Multi-Protocol Soft Switch";
|
2017-08-02 23:50:51 +02:00
|
|
|
homepage = https://freeswitch.org/;
|
2014-11-06 01:44:33 +01:00
|
|
|
license = stdenv.lib.licenses.mpl11;
|
2018-07-22 21:50:19 +02:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ ];
|
2018-12-10 23:49:26 +01:00
|
|
|
platforms = with stdenv.lib.platforms; unix;
|
2011-01-21 23:12:34 +01:00
|
|
|
};
|
|
|
|
}
|