2023-07-01 22:22:15 +00:00
|
|
|
{ callPackage
|
|
|
|
, fetchurl
|
|
|
|
, lib
|
|
|
|
, stdenv
|
2023-11-23 15:21:30 +00:00
|
|
|
, pkg-config
|
|
|
|
, which
|
|
|
|
, bison
|
|
|
|
, flex
|
|
|
|
, json_c
|
|
|
|
, libevent
|
|
|
|
, libxml2
|
|
|
|
, mariadb-connector-c
|
|
|
|
, pcre
|
|
|
|
, gnugrep
|
|
|
|
, gawk
|
|
|
|
, coreutils
|
|
|
|
, gdb
|
|
|
|
, gnused
|
2023-11-26 12:35:47 +00:00
|
|
|
, openssl
|
2023-07-01 22:22:15 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "kamailio";
|
2024-01-24 05:13:22 +00:00
|
|
|
version = "5.7.4";
|
2023-07-01 22:22:15 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-11-23 15:21:30 +00:00
|
|
|
url = "https://www.kamailio.org/pub/kamailio/${finalAttrs.version}/src/kamailio-${finalAttrs.version}_src.tar.gz";
|
2024-01-24 05:13:22 +00:00
|
|
|
hash = "sha256-AP9zgGFuoM+gsVmoepfedFTwDOM3RpsRpO6gS/4AMfM=";
|
2023-07-01 22:22:15 +00:00
|
|
|
};
|
|
|
|
|
2023-11-23 15:21:30 +00:00
|
|
|
buildInputs = [
|
|
|
|
json_c
|
|
|
|
libevent
|
|
|
|
libxml2
|
|
|
|
mariadb-connector-c
|
|
|
|
pcre
|
2023-11-26 12:35:47 +00:00
|
|
|
openssl
|
2023-07-01 22:22:15 +00:00
|
|
|
];
|
|
|
|
|
2023-11-23 15:21:30 +00:00
|
|
|
nativeBuildInputs = [
|
2023-07-01 22:22:15 +00:00
|
|
|
pkg-config
|
|
|
|
which
|
2023-11-23 15:21:30 +00:00
|
|
|
bison
|
|
|
|
flex
|
2023-07-01 22:22:15 +00:00
|
|
|
];
|
|
|
|
|
2023-11-23 15:36:56 +00:00
|
|
|
modules = [
|
|
|
|
"db_mysql"
|
|
|
|
"dialplan"
|
|
|
|
"jsonrpcc"
|
|
|
|
"json"
|
|
|
|
"lcr"
|
|
|
|
"presence"
|
|
|
|
"presence_conference"
|
|
|
|
"presence_dialoginfo"
|
|
|
|
"presence_mwi"
|
|
|
|
"presence_profile"
|
|
|
|
"presence_reginfo"
|
|
|
|
"presence_xml"
|
|
|
|
"pua"
|
|
|
|
"pua_bla"
|
|
|
|
"pua_dialoginfo"
|
|
|
|
"pua_json"
|
|
|
|
"pua_reginfo"
|
|
|
|
"pua_rpc"
|
|
|
|
"pua_usrloc"
|
|
|
|
"pua_xmpp"
|
|
|
|
"regex"
|
|
|
|
"rls"
|
2023-11-26 12:35:47 +00:00
|
|
|
"tls"
|
2023-11-23 15:36:56 +00:00
|
|
|
"xcap_client"
|
|
|
|
"xcap_server"
|
|
|
|
];
|
|
|
|
|
|
|
|
configurePhase = ''
|
2023-07-01 22:22:15 +00:00
|
|
|
runHook preConfigure
|
|
|
|
|
2023-11-23 15:36:56 +00:00
|
|
|
make PREFIX="$out" include_modules="${lib.concatStringsSep " " finalAttrs.modules}" cfg
|
2023-07-01 22:22:15 +00:00
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
2023-11-23 15:21:30 +00:00
|
|
|
preInstall = ''
|
|
|
|
makeFlagsArray+=(PREFIX="$out" "MYSQLCFG=${lib.getDev mariadb-connector-c}/bin/mariadb_config")
|
2023-07-01 22:22:15 +00:00
|
|
|
'';
|
|
|
|
|
2023-11-23 15:21:30 +00:00
|
|
|
postInstall = ''
|
|
|
|
echo 'MD5="${coreutils}/bin/md5sum"' >> $out/etc/kamailio/kamctlrc
|
|
|
|
echo 'AWK="${gawk}/bin/awk"' >> $out/etc/kamailio/kamctlrc
|
|
|
|
echo 'GDB="${gdb}/bin/gdb"' >> $out/etc/kamailio/kamctlrc
|
|
|
|
echo 'GREP="${gnugrep}/bin/grep "' >> $out/etc/kamailio/kamctlrc
|
|
|
|
echo 'EGREP="${gnugrep}/bin/grep -E"' >> $out/etc/kamailio/kamctlrc
|
|
|
|
echo 'SED="${gnused}/bin/sed"' >> $out/etc/kamailio/kamctlrc
|
|
|
|
echo 'LAST_LINE="${coreutils}/bin/tail -n 1"' >> $out/etc/kamailio/kamctlrc
|
|
|
|
echo 'EXPR="${gnugrep}/bin/expr"' >> $out/etc/kamailio/kamctlrc
|
2023-07-01 22:22:15 +00:00
|
|
|
'';
|
|
|
|
|
2023-11-23 15:21:30 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2023-07-01 22:22:15 +00:00
|
|
|
passthru.tests = {
|
2023-11-23 15:21:30 +00:00
|
|
|
kamailio-bin = callPackage ./test-kamailio-bin { };
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Fast and flexible SIP server, proxy, SBC, and load balancer";
|
|
|
|
homepage = "https://www.kamailio.org/";
|
|
|
|
license = lib.licenses.gpl2Only;
|
|
|
|
maintainers = with lib.maintainers; [ mawis ];
|
|
|
|
platforms = lib.platforms.linux;
|
2023-07-01 22:22:15 +00:00
|
|
|
};
|
|
|
|
})
|