diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-12-21 06:05:12 +0100 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-12-21 06:05:12 +0100 |
commit | f107be784e6d5da5f90735765a68fdff96acfbb4 (patch) | |
tree | 145573a598009fb6adbd5ef7fbce0a850681f5f0 /infra/libkookie/nixpkgs/pkgs/servers/sip | |
parent | 2e04b35e5ac3a9123cafffbc84494fa4d389cca0 (diff) | |
parent | e9158eca70ae59e73fae23be5d13d3fa0cfc78b4 (diff) |
Add 'infra/libkookie/nixpkgs/' from commit 'e9158eca70ae59e73fae23be5d13d3fa0cfc78b4'
git-subtree-dir: infra/libkookie/nixpkgs
git-subtree-mainline: 2e04b35e5ac3a9123cafffbc84494fa4d389cca0
git-subtree-split: e9158eca70ae59e73fae23be5d13d3fa0cfc78b4
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/servers/sip')
3 files changed, 424 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/servers/sip/freeswitch/default.nix b/infra/libkookie/nixpkgs/pkgs/servers/sip/freeswitch/default.nix new file mode 100644 index 000000000000..975ea9596b3f --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/servers/sip/freeswitch/default.nix @@ -0,0 +1,157 @@ +{ fetchFromGitHub, fetchpatch, stdenv, lib, pkgconfig, autoreconfHook +, ncurses, gnutls, readline +, openssl, perl, sqlite, libjpeg, speex, pcre, libuuid +, ldns, libedit, yasm, which, libsndfile, libtiff + +, callPackage + +, SystemConfiguration + +, modules ? null +, nixosTests +}: + +let + +availableModules = callPackage ./modules.nix { }; + +# the default list from v1.8.7, except with applications/mod_signalwire also disabled +defaultModules = mods: with mods; [ + applications.commands + applications.conference + applications.db + applications.dptools + applications.enum + applications.esf + applications.expr + applications.fifo + applications.fsv + applications.hash + applications.httapi + applications.sms + applications.spandsp + applications.valet_parking + applications.voicemail + + applications.curl + + codecs.amr + codecs.b64 + codecs.g723_1 + codecs.g729 + codecs.h26x + codecs.opus + + databases.mariadb + databases.pgsql + + dialplans.asterisk + dialplans.xml + + endpoints.loopback + endpoints.rtc + endpoints.skinny + endpoints.sofia + endpoints.verto + + event_handlers.cdr_csv + event_handlers.cdr_sqlite + event_handlers.event_socket + + formats.local_stream + formats.native_file + formats.png + formats.sndfile + formats.tone_stream + + languages.lua + + loggers.console + loggers.logfile + loggers.syslog + + say.en + + xml_int.cdr + xml_int.rpc + xml_int.scgi +] ++ lib.optionals stdenv.isLinux [ endpoints.gsmopen ]; + +enabledModules = (if modules != null then modules else defaultModules) availableModules; + +modulesConf = let + lst = builtins.map (mod: mod.path) enabledModules; + str = lib.strings.concatStringsSep "\n" lst; + in builtins.toFile "modules.conf" str; + +in + +stdenv.mkDerivation rec { + pname = "freeswitch"; + version = "1.10.5"; + src = fetchFromGitHub { + owner = "signalwire"; + repo = pname; + rev = "v${version}"; + sha256 = "18dhyb19k28dcm1i8mhqvvgm2phsrmrwyjmfn79glk8pdlalvcha"; + }; + + patches = [ + # https://github.com/signalwire/freeswitch/pull/812 fix mod_spandsp, mod_gsmopen build, drop when updating from 1.10.5 + (fetchpatch { + url = "https://github.com/signalwire/freeswitch/commit/51fba83ed3ed2d9753d8e6b13e13001aca50b493.patch"; + sha256 = "0h2bmifsyyasxjka3pczbmqym1chvz91fmb589njrdbwpkjyvqh3"; + }) + ]; + postPatch = '' + patchShebangs libs/libvpx/build/make/rtcd.pl + substituteInPlace libs/libvpx/build/make/configure.sh \ + --replace AS=\''${AS} AS=yasm + + # Disable advertisement banners + for f in src/include/cc.h libs/esl/src/include/cc.h; do + { + echo 'const char *cc = "";' + echo 'const char *cc_s = "";' + } > $f + done + ''; + + nativeBuildInputs = [ pkgconfig autoreconfHook ]; + buildInputs = [ + openssl ncurses gnutls readline perl libjpeg + sqlite pcre speex ldns libedit yasm which + libsndfile libtiff + libuuid + ] + ++ lib.unique (lib.concatMap (mod: mod.inputs) enabledModules) + ++ lib.optionals stdenv.isDarwin [ SystemConfiguration ]; + + enableParallelBuilding = true; + + NIX_CFLAGS_COMPILE = "-Wno-error"; + + hardeningDisable = [ "format" ]; + + preConfigure = '' + ./bootstrap.sh + cp "${modulesConf}" modules.conf + ''; + + postInstall = '' + # helper for compiling modules... not generally useful; also pulls in perl dependency + rm "$out"/bin/fsxs + # include configuration templates + cp -r conf $out/share/freeswitch/ + ''; + + passthru.tests.freeswitch = nixosTests.freeswitch; + + meta = { + description = "Cross-Platform Scalable FREE Multi-Protocol Soft Switch"; + homepage = "https://freeswitch.org/"; + license = stdenv.lib.licenses.mpl11; + maintainers = with stdenv.lib.maintainers; [ misuzu ]; + platforms = with stdenv.lib.platforms; unix; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/servers/sip/freeswitch/modules.nix b/infra/libkookie/nixpkgs/pkgs/servers/sip/freeswitch/modules.nix new file mode 100644 index 000000000000..202461d2cf9f --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/servers/sip/freeswitch/modules.nix @@ -0,0 +1,240 @@ +{ libopus +, opusfile +, libopusenc +, libogg +, libctb +, gsmlib +, lua +, curl +, ffmpeg +, libmysqlclient +, postgresql +, spandsp3 +, sofia_sip +}: + +let + +mk = path: inputs: { inherit path inputs; }; + +in + +# TODO: many of these are untested and missing required inputs +{ + applications = { + abstraction = mk "applications/mod_abstraction" []; + av = mk "applications/mod_av" [ ffmpeg ]; + avmd = mk "applications/mod_avmd" []; + bert = mk "applications/mod_bert" []; + blacklist = mk "applications/mod_blacklist" []; + callcenter = mk "applications/mod_callcenter" []; + cidlookup = mk "applications/mod_cidlookup" []; + cluechoo = mk "applications/mod_cluechoo" []; + commands = mk "applications/mod_commands" []; + conference = mk "applications/mod_conference" []; + curl = mk "applications/mod_curl" [ curl ]; + cv = mk "applications/mod_cv" []; + db = mk "applications/mod_db" []; + directory = mk "applications/mod_directory" []; + distributor = mk "applications/mod_distributor" []; + dptools = mk "applications/mod_dptools" []; + easyroute = mk "applications/mod_easyroute" []; + enum = mk "applications/mod_enum" []; + esf = mk "applications/mod_esf" []; + esl = mk "applications/mod_esl" []; + expr = mk "applications/mod_expr" []; + fifo = mk "applications/mod_fifo" []; + fsk = mk "applications/mod_fsk" []; + fsv = mk "applications/mod_fsv" []; + hash = mk "applications/mod_hash" []; + hiredis = mk "applications/mod_hiredis" []; + httapi = mk "applications/mod_httapi" []; + http_cache = mk "applications/mod_http_cache" []; + ladspa = mk "applications/mod_ladspa" []; + lcr = mk "applications/mod_lcr" []; + memcache = mk "applications/mod_memcache" []; + mongo = mk "applications/mod_mongo" []; + mp4 = mk "applications/mod_mp4" []; + mp4v2 = mk "applications/mod_mp4v2" []; + nibblebill = mk "applications/mod_nibblebill" []; + oreka = mk "applications/mod_oreka" []; + osp = mk "applications/mod_osp" []; + prefix = mk "applications/mod_prefix" []; + rad_auth = mk "applications/mod_rad_auth" []; + redis = mk "applications/mod_redis" []; + rss = mk "applications/mod_rss" []; + signalwire = mk "applications/mod_signalwire" []; + sms = mk "applications/mod_sms" []; + sms_flowroute = mk "applications/mod_sms_flowroute" []; + snapshot = mk "applications/mod_snapshot" []; + snom = mk "applications/mod_snom" []; + sonar = mk "applications/mod_sonar" []; + soundtouch = mk "applications/mod_soundtouch" []; + spandsp = mk "applications/mod_spandsp" [ spandsp3 ]; + spy = mk "applications/mod_spy" []; + stress = mk "applications/mod_stress" []; + translate = mk "applications/mod_translate" []; + valet_parking = mk "applications/mod_valet_parking" []; + video_filter = mk "applications/mod_video_filter" []; + vmd = mk "applications/mod_vmd" []; + voicemail = mk "applications/mod_voicemail" []; + voicemail_ivr = mk "applications/mod_voicemail_ivr" []; + }; + + ast_tts = { + cepstral = mk "ast_tts/mod_cepstral" []; + flite = mk "ast_tts/mod_flite" []; + pocketsphinx = mk "ast_tts/mod_pocketsphinx" []; + tts_commandline = mk "ast_tts/mod_tts_commandline" []; + unimrcp = mk "ast_tts/mod_unimrcp" []; + }; + + codecs = { + amr = mk "codecs/mod_amr" []; + amrwb = mk "codecs/mod_amrwb" []; + b64 = mk "codecs/mod_b64" []; + bv = mk "codecs/mod_bv" []; + clearmode = mk "codecs/mod_clearmode" []; + codec2 = mk "codecs/mod_codec2" []; + com_g729 = mk "codecs/mod_com_g729" []; + dahdi_codec = mk "codecs/mod_dahdi_codec" []; + g723_1 = mk "codecs/mod_g723_1" []; + g729 = mk "codecs/mod_g729" []; + h26x = mk "codecs/mod_h26x" []; + ilbc = mk "codecs/mod_ilbc" []; + isac = mk "codecs/mod_isac" []; + mp4v = mk "codecs/mod_mp4v" []; + opus = mk "codecs/mod_opus" [ libopus ]; + sangoma_codec = mk "codecs/mod_sangoma_codec" []; + silk = mk "codecs/mod_silk" []; + siren = mk "codecs/mod_siren" []; + 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" []; + xml = mk "dialplans/mod_dialplan_xml" []; + }; + + directories = { + ldap = mk "directories/mod_ldap" []; + }; + + endpoints = { + alsa = mk "endpoints/mod_alsa" []; + dingaling = mk "endpoints/mod_dingaling" []; + gsmopen = mk "endpoints/mod_gsmopen" [ gsmlib libctb ]; + h323 = mk "endpoints/mod_h323" []; + khomp = mk "endpoints/mod_khomp" []; + loopback = mk "endpoints/mod_loopback" []; + opal = mk "endpoints/mod_opal" []; + portaudio = mk "endpoints/mod_portaudio" []; + rtc = mk "endpoints/mod_rtc" []; + rtmp = mk "endpoints/mod_rtmp" []; + skinny = mk "endpoints/mod_skinny" []; + sofia = mk "endpoints/mod_sofia" [ sofia_sip ]; + verto = mk "endpoints/mod_verto" []; + }; + + event_handlers = { + amqp = mk "event_handlers/mod_amqp" []; + cdr_csv = mk "event_handlers/mod_cdr_csv" []; + cdr_mongodb = mk "event_handlers/mod_cdr_mongodb" []; + cdr_pg_csv = mk "event_handlers/mod_cdr_pg_csv" []; + cdr_sqlite = mk "event_handlers/mod_cdr_sqlite" []; + erlang_event = mk "event_handlers/mod_erlang_event" []; + event_multicast = mk "event_handlers/mod_event_multicast" []; + event_socket = mk "event_handlers/mod_event_socket" []; + fail2ban = mk "event_handlers/mod_fail2ban" []; + format_cdr = mk "event_handlers/mod_format_cdr" []; + json_cdr = mk "event_handlers/mod_json_cdr" []; + radius_cdr = mk "event_handlers/mod_radius_cdr" []; + odbc_cdr = mk "event_handlers/mod_odbc_cdr" []; + kazoo = mk "event_handlers/mod_kazoo" []; + rayo = mk "event_handlers/mod_rayo" []; + smpp = mk "event_handlers/mod_smpp" []; + snmp = mk "event_handlers/mod_snmp" []; + event_zmq = mk "event_handlers/mod_event_zmq" []; + }; + + formats = { + imagick = mk "formats/mod_imagick" []; + local_stream = mk "formats/mod_local_stream" []; + native_file = mk "formats/mod_native_file" []; + opusfile = mk "formats/mod_opusfile" [ libopus opusfile libopusenc libogg ]; + png = mk "formats/mod_png" []; + portaudio_stream = mk "formats/mod_portaudio_stream" []; + shell_stream = mk "formats/mod_shell_stream" []; + shout = mk "formats/mod_shout" []; + sndfile = mk "formats/mod_sndfile" []; + ssml = mk "formats/mod_ssml" []; + tone_stream = mk "formats/mod_tone_stream" []; + vlc = mk "formats/mod_vlc" []; + webm = mk "formats/mod_webm" []; + }; + + languages = { + basic = mk "languages/mod_basic" []; + java = mk "languages/mod_java" []; + lua = mk "languages/mod_lua" [ lua ]; + managed = mk "languages/mod_managed" []; + perl = mk "languages/mod_perl" []; + python = mk "languages/mod_python" []; + v8 = mk "languages/mod_v8" []; + yaml = mk "languages/mod_yaml" []; + }; + + loggers = { + console = mk "loggers/mod_console" []; + graylog2 = mk "loggers/mod_graylog2" []; + logfile = mk "loggers/mod_logfile" []; + syslog = mk "loggers/mod_syslog" []; + raven = mk "loggers/mod_raven" []; + }; + + say = { + de = mk "say/mod_say_de" []; + en = mk "say/mod_say_en" []; + es = mk "say/mod_say_es" []; + es_ar = mk "say/mod_say_es_ar" []; + fa = mk "say/mod_say_fa" []; + fr = mk "say/mod_say_fr" []; + he = mk "say/mod_say_he" []; + hr = mk "say/mod_say_hr" []; + hu = mk "say/mod_say_hu" []; + it = mk "say/mod_say_it" []; + ja = mk "say/mod_say_ja" []; + nl = mk "say/mod_say_nl" []; + pl = mk "say/mod_say_pl" []; + pt = mk "say/mod_say_pt" []; + ru = mk "say/mod_say_ru" []; + sv = mk "say/mod_say_sv" []; + th = mk "say/mod_say_th" []; + zh = mk "say/mod_say_zh" []; + }; + + timers = { + posix_timer = mk "timers/mod_posix_timer" []; + timerfd = mk "timers/mod_timerfd" []; + }; + + xml_int = { + cdr = mk "xml_int/mod_xml_cdr" []; + curl = mk "xml_int/mod_xml_curl" [ curl ]; + ldap = mk "xml_int/mod_xml_ldap" []; + radius = mk "xml_int/mod_xml_radius" []; + rpc = mk "xml_int/mod_xml_rpc" []; + scgi = mk "xml_int/mod_xml_scgi" []; + + # experimental + odbc = mk "../../contrib/mod/xml_int/mod_xml_odbc" []; + }; + + freetdm = mk "../../libs/freetdm/mod_freetdm" []; +} diff --git a/infra/libkookie/nixpkgs/pkgs/servers/sip/sipwitch/default.nix b/infra/libkookie/nixpkgs/pkgs/servers/sip/sipwitch/default.nix new file mode 100644 index 000000000000..33c888ba35ed --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/servers/sip/sipwitch/default.nix @@ -0,0 +1,27 @@ +{ fetchurl, stdenv, pkgconfig, ucommon, libosip, libexosip, gnutls, zlib }: + +stdenv.mkDerivation rec { + name = "sipwitch-1.9.15"; + + src = fetchurl { + url = "mirror://gnu/sipwitch/${name}.tar.gz"; + sha256 = "2a7aa86a653f6810b3cd9cce6c37b3f70e937e7d14b09fd5c2a70d70588a9482"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ ucommon libosip libexosip gnutls zlib ]; + + preConfigure = '' + export configureFlags="--sysconfdir=$out/etc" + ''; + + doCheck = true; + + meta = { + description = "Secure peer-to-peer VoIP server that uses the SIP protocol"; + homepage = "https://www.gnu.org/software/sipwitch/"; + license = stdenv.lib.licenses.gpl3Plus; + maintainers = with stdenv.lib.maintainers; [ ]; + platforms = with stdenv.lib.platforms; linux; + }; +} |