nixpkgs/pkgs/by-name/ba/baresip/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

171 lines
3.2 KiB
Nix
Raw Normal View History

{
SDL2,
alsa-lib,
cairo,
celt,
cmake,
fetchFromGitHub,
ffmpeg,
glib,
gsm,
gst_all_1,
gtk3,
lib,
libre,
librem,
libsndfile,
libuuid,
libv4l,
libvpx,
mpg123,
openssl,
2024-08-16 09:30:11 +00:00
pipewire,
pkg-config,
portaudio,
spandsp3,
speex,
srtp,
stdenv,
zlib,
dbusSupport ? true,
2012-09-24 17:02:19 +00:00
}:
stdenv.mkDerivation rec {
2024-03-15 17:37:44 +00:00
version = "3.10.1";
pname = "baresip";
2022-01-06 17:14:22 +00:00
src = fetchFromGitHub {
owner = "baresip";
repo = "baresip";
rev = "v${version}";
2024-03-15 17:37:44 +00:00
hash = "sha256-0huZP1hopHaN5R1Hki6YutpvoASfIHzHMl/Y4czHHMo=";
2012-09-24 17:02:19 +00:00
};
prePatch = ''
substituteInPlace cmake/FindGTK3.cmake --replace-fail GTK3_CFLAGS_OTHER ""
'' + lib.optionalString (!dbusSupport) ''
substituteInPlace cmake/modules.cmake --replace-fail 'list(APPEND MODULES ctrl_dbus)' ""
'';
nativeBuildInputs = [ cmake pkg-config ];
2022-01-06 17:14:22 +00:00
buildInputs = [
SDL2
alsa-lib
cairo
2022-01-06 17:14:22 +00:00
celt
ffmpeg
gsm
gtk3
libre
librem
libsndfile
2022-01-06 17:14:22 +00:00
libuuid
libv4l
libvpx
mpg123
openssl
2024-08-16 09:30:11 +00:00
pipewire
portaudio
spandsp3
speex
srtp
zlib
2018-05-04 22:29:01 +00:00
] ++ (with gst_all_1; [ gstreamer gst-libav gst-plugins-base gst-plugins-bad gst-plugins-good ]);
cmakeFlags = [
"-DCMAKE_SKIP_BUILD_RPATH=ON"
"-Dre_DIR=${libre}/include/re"
"-DGL_INCLUDE_DIRS=${lib.getDev glib}/include/glib-2.0"
"-DGLIB_INCLUDE_DIRS=${glib.out}/lib/glib-2.0/include"
"-DGST_INCLUDE_DIRS=${lib.getDev gst_all_1.gstreamer}/include/gstreamer-1.0"
];
2012-09-24 17:02:19 +00:00
makeFlags = [
"PREFIX=$(out)"
2016-09-25 22:23:04 +00:00
"CCACHE_DISABLE=1"
]
2021-01-15 05:42:41 +00:00
++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}"
++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.cc.libc}"
;
2017-03-31 20:33:44 +00:00
2023-02-26 23:05:55 +00:00
enableParallelBuilding = true;
env.NIX_CFLAGS_COMPILE = ''
-I${librem}/include/rem -I${gsm}/include/gsm
2017-03-31 20:33:44 +00:00
-DHAVE_INTTYPES_H -D__GLIBC__
-D__need_timeval -D__need_timespec -D__need_time_t
'';
2022-01-06 17:14:22 +00:00
doInstallCheck = true;
# CMake feature detection is prone to breakage between upgrades:
# spot-check that the optional modules we care about were compiled
postInstallCheck = lib.concatMapStringsSep "\n" (m: "test -x $out/lib/baresip/modules/${m}.so") [
"account"
"alsa"
"aubridge"
"auconv"
"aufile"
"auresamp"
"ausine"
"avcodec"
"avfilter"
"avformat"
"cons"
"contact"
"ctrl_dbus"
"ctrl_tcp"
"debug_cmd"
"dtls_srtp"
"ebuacip"
"echo"
"evdev"
"fakevideo"
"g711"
"g722"
"g726"
"gst"
"gtk"
"httpd"
"httpreq"
"ice"
"l16"
"menu"
"mixausrc"
"mixminus"
"multicast"
"mwi"
"natpmp"
"netroam"
"pcp"
2024-08-16 09:30:11 +00:00
"pipewire"
"plc"
"portaudio"
"presence"
"rtcpsummary"
"sdl"
"selfview"
"serreg"
"snapshot"
"sndfile"
"srtp"
"stdio"
"stun"
"swscale"
"syslog"
"turn"
"uuid"
"v4l2"
"vidbridge"
"vidinfo"
"vp8"
"vp9"
"vumeter"
"x11"
];
2012-09-24 17:02:19 +00:00
meta = {
2022-01-06 17:14:22 +00:00
description = "Modular SIP User-Agent with audio and video support";
homepage = "https://github.com/baresip/baresip";
maintainers = with lib.maintainers; [ raskin ehmry ];
2024-02-09 11:32:45 +00:00
mainProgram = "baresip";
2021-01-15 05:42:41 +00:00
license = lib.licenses.bsd3;
2022-09-04 15:06:21 +00:00
platforms = lib.platforms.unix;
2012-09-24 17:02:19 +00:00
};
}