31 availableModules = callPackage ./modules.nix { };
33 # the default list from v1.8.7, except with applications/mod_signalwire also disabled
34 defaultModules = mods: with mods; [
36 applications.conference
48 applications.valet_parking
49 applications.voicemail
72 event_handlers.cdr_csv
73 event_handlers.cdr_sqlite
74 event_handlers.event_socket
93 ] ++ lib.optionals stdenv.hostPlatform.isLinux [ endpoints.gsmopen ];
95 enabledModules = (if modules != null then modules else defaultModules) availableModules;
98 lst = builtins.map (mod: mod.path) enabledModules;
99 str = lib.strings.concatStringsSep "\n" lst;
100 in builtins.toFile "modules.conf" str;
104 stdenv.mkDerivation rec {
105 pname = "freeswitch";
107 src = fetchFromGitHub {
108 owner = "signalwire";
111 hash = "sha256-uOO+TpKjJkdjEp4nHzxcHtZOXqXzpkIF3dno1AX17d8=";
115 patchShebangs libs/libvpx/build/make/rtcd.pl
116 substituteInPlace libs/libvpx/build/make/configure.sh \
117 --replace AS=\''${AS} AS=yasm
119 # Disable advertisement banners
120 for f in src/include/cc.h libs/esl/src/include/cc.h; do
122 echo 'const char *cc = "";'
123 echo 'const char *cc_s = "";'
129 nativeBuildInputs = [ pkg-config autoreconfHook perl which yasm ];
131 openssl ncurses gnutls readline libjpeg
132 sqlite pcre speex ldns libedit
136 ++ lib.unique (lib.concatMap (mod: mod.inputs) enabledModules)
137 ++ lib.optionals stdenv.hostPlatform.isDarwin [ SystemConfiguration ];
139 enableParallelBuilding = true;
141 env.NIX_CFLAGS_COMPILE = "-Wno-error";
143 # Using c++14 because of build error
144 # gsm_at.h:94:32: error: ISO C++17 does not allow dynamic exception specifications
145 CXXFLAGS = "-std=c++14";
147 CFLAGS = "-D_ANSI_SOURCE";
149 hardeningDisable = [ "format" ];
153 cp "${modulesConf}" modules.conf
157 # helper for compiling modules... not generally useful; also pulls in perl dependency
159 # include configuration templates
160 cp -r conf $out/share/freeswitch/
163 passthru.tests.freeswitch = nixosTests.freeswitch;
166 description = "Cross-Platform Scalable FREE Multi-Protocol Soft Switch";
167 homepage = "https://freeswitch.org/";
168 license = lib.licenses.mpl11;
169 maintainers = with lib.maintainers; [ mikaelfangel ];
170 platforms = with lib.platforms; unix;
171 broken = stdenv.hostPlatform.isDarwin;