nixpkgs/pkgs/by-name/ka/kamailio/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

113 lines
2.3 KiB
Nix

{
callPackage,
fetchurl,
lib,
stdenv,
pkg-config,
which,
bison,
flex,
json_c,
libevent,
libxml2,
mariadb-connector-c,
pcre,
gnugrep,
gawk,
coreutils,
gdb,
gnused,
openssl,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "kamailio";
version = "5.7.4";
src = fetchurl {
url = "https://www.kamailio.org/pub/kamailio/${finalAttrs.version}/src/kamailio-${finalAttrs.version}_src.tar.gz";
hash = "sha256-AP9zgGFuoM+gsVmoepfedFTwDOM3RpsRpO6gS/4AMfM=";
};
buildInputs = [
json_c
libevent
libxml2
mariadb-connector-c
pcre
openssl
];
nativeBuildInputs = [
pkg-config
which
bison
flex
];
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"
"tls"
"xcap_client"
"xcap_server"
];
configurePhase = ''
runHook preConfigure
make PREFIX="$out" include_modules="${lib.concatStringsSep " " finalAttrs.modules}" cfg
runHook postConfigure
'';
preInstall = ''
makeFlagsArray+=(PREFIX="$out" "MYSQLCFG=${lib.getDev mariadb-connector-c}/bin/mariadb_config")
'';
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
'';
enableParallelBuilding = true;
passthru.tests = {
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;
};
})