summary refs log tree commit diff
path: root/pkgs/servers/sip
diff options
context:
space:
mode:
authormisuzu <bakalolka@gmail.com>2020-01-01 23:07:45 +0200
committermisuzu <bakalolka@gmail.com>2020-01-01 23:07:45 +0200
commit6d66795575e6e6dcdc7bc5fa15dae789a918e0b6 (patch)
treeb773ff1bb2d22c8f4f6aefdd85bbf9ee5e2d6f67 /pkgs/servers/sip
parent96f4563f1e6eb7f773c50f413afdbea737355db9 (diff)
downloadnixpkgs-6d66795575e6e6dcdc7bc5fa15dae789a918e0b6.tar
nixpkgs-6d66795575e6e6dcdc7bc5fa15dae789a918e0b6.tar.gz
nixpkgs-6d66795575e6e6dcdc7bc5fa15dae789a918e0b6.tar.bz2
nixpkgs-6d66795575e6e6dcdc7bc5fa15dae789a918e0b6.tar.lz
nixpkgs-6d66795575e6e6dcdc7bc5fa15dae789a918e0b6.tar.xz
nixpkgs-6d66795575e6e6dcdc7bc5fa15dae789a918e0b6.tar.zst
nixpkgs-6d66795575e6e6dcdc7bc5fa15dae789a918e0b6.zip
freeswitch: 1.8.7 -> 1.10.2
Diffstat (limited to 'pkgs/servers/sip')
-rw-r--r--pkgs/servers/sip/freeswitch/default.nix37
-rw-r--r--pkgs/servers/sip/freeswitch/modules.nix7
2 files changed, 28 insertions, 16 deletions
diff --git a/pkgs/servers/sip/freeswitch/default.nix b/pkgs/servers/sip/freeswitch/default.nix
index 5f066adcccc..aeedf8b30ae 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 2d8f541a3c2..be80fe56dda 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" [];