From 6d66795575e6e6dcdc7bc5fa15dae789a918e0b6 Mon Sep 17 00:00:00 2001 From: misuzu Date: Wed, 1 Jan 2020 23:07:45 +0200 Subject: freeswitch: 1.8.7 -> 1.10.2 --- pkgs/servers/sip/freeswitch/default.nix | 37 +++++++++++++++++++-------------- pkgs/servers/sip/freeswitch/modules.nix | 7 +++++++ 2 files changed, 28 insertions(+), 16 deletions(-) (limited to 'pkgs/servers') diff --git a/pkgs/servers/sip/freeswitch/default.nix b/pkgs/servers/sip/freeswitch/default.nix index 5f066adccccd..aeedf8b30aee 100644 --- a/pkgs/servers/sip/freeswitch/default.nix +++ b/pkgs/servers/sip/freeswitch/default.nix @@ -1,18 +1,20 @@ -{ fetchurl, stdenv, lib, ncurses, curl, pkgconfig, gnutls, readline +{ fetchFromGitHub, stdenv, lib, pkgconfig, autoreconfHook +, ncurses, gnutls, readline , openssl, perl, sqlite, libjpeg, speex, pcre -, ldns, libedit, yasm, which, lua, libopus, libsndfile, libtiff -, libctb, gsmlib +, ldns, libedit, yasm, which, libsndfile, libtiff -, modules ? null -, postgresql -, enablePostgres ? true +, curl, lua, libmysqlclient, postgresql, libopus, libctb, gsmlib , SystemConfiguration + +, modules ? null }: let -availableModules = import ./modules.nix { inherit curl lua libopus libctb gsmlib; }; +availableModules = import ./modules.nix { + inherit curl lua libmysqlclient postgresql libopus libctb gsmlib; +}; # the default list from v1.8.7, except with applications/mod_signalwire also disabled defaultModules = mods: with mods; [ @@ -41,6 +43,9 @@ defaultModules = mods: with mods; [ codecs.h26x codecs.opus + databases.mariadb + databases.pgsql + dialplans.asterisk dialplans.xml @@ -83,11 +88,13 @@ modulesConf = let in stdenv.mkDerivation rec { - name = "freeswitch-1.8.7"; - - src = fetchurl { - url = "https://files.freeswitch.org/freeswitch-releases/${name}.tar.bz2"; - sha256 = "0k52mxdfc5w9fdnz8kvfjiwnnjjhnpkirnyrfkhq7bad84m731z4"; + pname = "freeswitch"; + version = "1.10.2"; + src = fetchFromGitHub { + owner = "signalwire"; + repo = pname; + rev = "v${version}"; + sha256 = "1fmrm51zgrasjbmhs0pzb1lyca3ddx0wd35shvxnkjnifi8qd1h7"; }; postPatch = '' patchShebangs libs/libvpx/build/make/rtcd.pl @@ -95,23 +102,21 @@ stdenv.mkDerivation rec { --replace AS=\''${AS} AS=yasm ''; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ pkgconfig autoreconfHook ]; buildInputs = [ openssl ncurses gnutls readline perl libjpeg sqlite pcre speex ldns libedit yasm which libsndfile libtiff ] ++ lib.unique (lib.concatMap (mod: mod.inputs) enabledModules) - ++ lib.optionals enablePostgres [ postgresql ] ++ lib.optionals stdenv.isDarwin [ SystemConfiguration ]; NIX_CFLAGS_COMPILE = "-Wno-error"; hardeningDisable = [ "format" ]; - configureFlags = lib.optionals enablePostgres [ "--enable-core-pgsql-support" ]; - preConfigure = '' + ./bootstrap.sh cp "${modulesConf}" modules.conf ''; diff --git a/pkgs/servers/sip/freeswitch/modules.nix b/pkgs/servers/sip/freeswitch/modules.nix index 2d8f541a3c29..be80fe56dda6 100644 --- a/pkgs/servers/sip/freeswitch/modules.nix +++ b/pkgs/servers/sip/freeswitch/modules.nix @@ -3,6 +3,8 @@ , gsmlib , lua , curl +, libmysqlclient +, postgresql }: let @@ -103,6 +105,11 @@ in theora = mk "codecs/mod_theora" []; }; + databases = { + mariadb = mk "databases/mod_mariadb" [ libmysqlclient ]; + pgsql = mk "databases/mod_pgsql" [ postgresql ]; + }; + dialplans = { asterisk = mk "dialplans/mod_dialplan_asterisk" []; directory = mk "dialplans/mod_dialplan_directory" []; -- cgit 1.4.1