2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, lib, fetchurl, fetchsvn,
|
2018-11-21 09:57:31 +00:00
|
|
|
jansson, libedit, libxml2, libxslt, ncurses, openssl, sqlite,
|
2017-10-11 00:01:42 +01:00
|
|
|
utillinux, dmidecode, libuuid, newt,
|
2017-02-09 07:26:57 +00:00
|
|
|
lua, speex,
|
2018-11-21 09:57:31 +00:00
|
|
|
srtp, wget, curl, iksemel, pkgconfig
|
2016-12-28 22:04:58 +00:00
|
|
|
}:
|
2015-04-16 18:42:17 +01:00
|
|
|
|
2017-02-02 14:11:54 +00:00
|
|
|
let
|
|
|
|
common = {version, sha256, externals}: stdenv.mkDerivation rec {
|
|
|
|
inherit version;
|
|
|
|
name = "asterisk-${version}";
|
|
|
|
|
2018-11-21 09:57:31 +00:00
|
|
|
buildInputs = [ jansson libedit libxml2 libxslt ncurses openssl sqlite
|
|
|
|
dmidecode libuuid newt
|
|
|
|
lua speex
|
|
|
|
srtp wget curl iksemel ];
|
|
|
|
nativeBuildInputs = [ utillinux pkgconfig ];
|
2017-02-02 14:11:54 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
# We want the Makefile to install the default /var skeleton
|
|
|
|
# under ${out}/var but we also want to use /var at runtime.
|
|
|
|
# This patch changes the runtime behavior to look for state
|
|
|
|
# directories in /var rather than ${out}/var.
|
|
|
|
./runtime-vardirs.patch
|
|
|
|
];
|
|
|
|
|
2017-04-26 11:31:56 +01:00
|
|
|
# Disable MD5 verification for pjsip
|
|
|
|
postPatch = ''
|
|
|
|
sed -i 's|$(verify_tarball)|true|' third-party/pjproject/Makefile
|
|
|
|
'';
|
|
|
|
|
2017-02-02 14:11:54 +00:00
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-${version}.tar.gz";
|
2017-02-02 14:11:54 +00:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
# The default libdir is $PREFIX/usr/lib, which causes problems when paths
|
|
|
|
# compiled into Asterisk expect ${out}/usr/lib rather than ${out}/lib.
|
|
|
|
|
|
|
|
# Copy in externals to avoid them being downloaded;
|
|
|
|
# they have to be copied, because the modification date is checked.
|
|
|
|
# If you are getting a permission denied error on this dir,
|
|
|
|
# you're likely missing an automatically downloaded dependency
|
|
|
|
preConfigure = ''
|
|
|
|
mkdir externals_cache
|
2018-11-21 09:57:31 +00:00
|
|
|
|
|
|
|
${lib.concatStringsSep "\n"
|
|
|
|
(lib.mapAttrsToList (dst: src: "cp -r --no-preserve=mode ${src} ${dst}") externals)}
|
|
|
|
|
|
|
|
${lib.optionalString (externals ? "addons/mp3") "bash contrib/scripts/get_mp3_source.sh || true"}
|
2017-02-02 14:11:54 +00:00
|
|
|
|
|
|
|
chmod -w externals_cache
|
|
|
|
'';
|
|
|
|
configureFlags = [
|
|
|
|
"--libdir=\${out}/lib"
|
|
|
|
"--with-lua=${lua}/lib"
|
|
|
|
"--with-pjproject-bundled"
|
|
|
|
"--with-externals-cache=$(PWD)/externals_cache"
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
make menuselect.makeopts
|
2018-11-21 09:57:31 +00:00
|
|
|
${lib.optionalString (externals ? "addons/mp3") ''
|
|
|
|
substituteInPlace menuselect.makeopts --replace 'format_mp3 ' ""
|
|
|
|
''}
|
2017-02-02 14:11:54 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Install sample configuration files for this version of Asterisk
|
|
|
|
make samples
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Software implementation of a telephone private branch exchange (PBX)";
|
|
|
|
homepage = http://www.asterisk.org/;
|
|
|
|
license = licenses.gpl2;
|
2017-02-02 14:12:33 +00:00
|
|
|
maintainers = with maintainers; [ auntie DerTim1 yorickvp ];
|
2017-02-02 14:11:54 +00:00
|
|
|
};
|
2015-04-16 18:42:17 +01:00
|
|
|
};
|
|
|
|
|
2018-11-21 09:57:31 +00:00
|
|
|
pjproject_2_7_1 = fetchurl {
|
2018-04-13 06:56:04 +01:00
|
|
|
url = http://www.pjsip.org/release/2.7.1/pjproject-2.7.1.tar.bz2;
|
|
|
|
sha256 = "09ii5hgl5s7grx4fiimcl3s77i385h7b3kwpfa2q0arbl1ibryjr";
|
2017-04-26 11:31:56 +01:00
|
|
|
};
|
|
|
|
|
2018-11-21 09:57:31 +00:00
|
|
|
pjproject_2_8 = fetchurl {
|
|
|
|
url = http://www.pjsip.org/release/2.8/pjproject-2.8.tar.bz2;
|
|
|
|
sha256 = "0ybg0113rp3fk49rm2v0pcgqb28h3dv1pdy9594w2ggiz7bhngah";
|
|
|
|
};
|
|
|
|
|
2017-02-23 20:40:37 +00:00
|
|
|
mp3-202 = fetchsvn {
|
|
|
|
url = http://svn.digium.com/svn/thirdparty/mp3/trunk;
|
2018-11-07 08:41:55 +00:00
|
|
|
rev = "202";
|
2017-02-23 20:40:37 +00:00
|
|
|
sha256 = "1s9idx2miwk178sa731ig9r4fzx4gy1q8xazfqyd7q4lfd70s1cy";
|
|
|
|
};
|
|
|
|
|
2018-11-21 09:57:31 +00:00
|
|
|
in rec {
|
|
|
|
# Supported releases (as of 2018-11-20).
|
|
|
|
#
|
|
|
|
# Series Type Rel. Date Sec. Fixes EOL
|
|
|
|
# 13.x LTS 2014-10-24 2020-10-24 2021-10-24
|
|
|
|
# 15.x Standard 2017-10-03 2018-10-03 2019-10-03
|
|
|
|
asterisk-stable = asterisk_15;
|
|
|
|
# 16.x LTS 2018-10-09 2022-10-09 2023-10-09
|
|
|
|
asterisk-lts = asterisk_16;
|
|
|
|
asterisk = asterisk_16;
|
|
|
|
|
|
|
|
asterisk_13 = common {
|
|
|
|
version = "13.24.1";
|
|
|
|
sha256 = "1mclpk7knqjl6jr6mpvhb17wsjah4bk2xqhb3shpx1j4z19xkmm3";
|
|
|
|
externals = {
|
|
|
|
"externals_cache/pjproject-2.7.1.tar.bz2" = pjproject_2_7_1;
|
|
|
|
"addons/mp3" = mp3-202;
|
|
|
|
};
|
|
|
|
};
|
2017-02-02 14:11:54 +00:00
|
|
|
|
2018-11-21 09:57:31 +00:00
|
|
|
asterisk_15 = common {
|
|
|
|
version = "15.7.0";
|
|
|
|
sha256 = "1ngs73h4lz94b4f3shy1yb5laqy0z03zf451xa1nihrgp1h3ilyv";
|
2017-02-02 14:11:54 +00:00
|
|
|
externals = {
|
2018-11-21 09:57:31 +00:00
|
|
|
"externals_cache/pjproject-2.8.tar.bz2" = pjproject_2_8;
|
2017-02-23 20:40:37 +00:00
|
|
|
"addons/mp3" = mp3-202;
|
2017-02-02 14:11:54 +00:00
|
|
|
};
|
2015-04-16 18:42:17 +01:00
|
|
|
};
|
2017-02-02 14:11:54 +00:00
|
|
|
|
2018-11-21 09:57:31 +00:00
|
|
|
asterisk_16 = common {
|
|
|
|
version = "16.1.1";
|
|
|
|
sha256 = "19bfvqmxphk2608jx7jghfy7rdbj1qj5vw2fyb0fq4xjvx919wmv";
|
2017-02-02 14:11:54 +00:00
|
|
|
externals = {
|
2018-11-21 09:57:31 +00:00
|
|
|
"externals_cache/pjproject-2.8.tar.bz2" = pjproject_2_8;
|
2017-02-23 20:40:37 +00:00
|
|
|
"addons/mp3" = mp3-202;
|
2017-02-02 14:11:54 +00:00
|
|
|
};
|
2015-04-16 18:42:17 +01:00
|
|
|
};
|
2017-02-02 14:11:54 +00:00
|
|
|
|
2018-11-21 09:57:31 +00:00
|
|
|
#asterisk-git = common {
|
|
|
|
# version = "15-pre";
|
|
|
|
# sha256 = "...";
|
|
|
|
# externals = {
|
2017-02-02 14:11:54 +00:00
|
|
|
# "externals_cache/pjproject-2.5.5.tar.bz2" = pjproject-255;
|
2018-11-21 09:57:31 +00:00
|
|
|
# # Note that these sounds are included with the release tarball. They are
|
|
|
|
# # provided here verbatim for the convenience of anyone wanting to build
|
|
|
|
# # Asterisk from other sources. Include in externals.
|
|
|
|
# "sounds/asterisk-core-sounds-en-gsm-1.5.tar.gz" = fetchurl {
|
|
|
|
# url = http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en-gsm-1.5.tar.gz;
|
|
|
|
# sha256 = "01xzbg7xy0c5zg7sixjw5025pvr4z64kfzi9zvx19im0w331h4cd";
|
|
|
|
# };
|
|
|
|
# "sounds/asterisk-moh-opsound-wav-2.03.tar.gz" = fetchurl {
|
|
|
|
# url = http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-moh-opsound-wav-2.03.tar.gz;
|
|
|
|
# sha256 = "449fb810d16502c3052fedf02f7e77b36206ac5a145f3dacf4177843a2fcb538";
|
|
|
|
# };
|
|
|
|
# # TODO: Sounds for other languages could be added here
|
|
|
|
# }
|
|
|
|
#}.overrideDerivation (_: {src = fetchgit {...}})
|
2017-02-02 14:11:54 +00:00
|
|
|
|
2015-04-16 18:42:17 +01:00
|
|
|
}
|