Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / ba / baresip / package.nix
blob866958347f192ca43a4980e931478666dcb7cc78
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , zlib
5 , openssl
6 , libre
7 , librem
8 , pkg-config
9 , gst_all_1
10 , cairo
11 , gtk3
12 , mpg123
13 , alsa-lib
14 , SDL2
15 , libv4l
16 , celt
17 , libsndfile
18 , srtp
19 , ffmpeg
20 , gsm
21 , speex
22 , portaudio
23 , spandsp3
24 , libuuid
25 , libvpx
26 , cmake
27 , dbusSupport ? true
29 stdenv.mkDerivation rec {
30   version = "3.10.1";
31   pname = "baresip";
32   src = fetchFromGitHub {
33     owner = "baresip";
34     repo = "baresip";
35     rev = "v${version}";
36     hash = "sha256-0huZP1hopHaN5R1Hki6YutpvoASfIHzHMl/Y4czHHMo=";
37   };
38   prePatch = lib.optionalString (!dbusSupport) ''
39     substituteInPlace cmake/modules.cmake --replace 'list(APPEND MODULES ctrl_dbus)' ""
40   '';
41   nativeBuildInputs = [ pkg-config cmake ];
42   buildInputs = [
43     zlib
44     openssl
45     libre
46     librem
47     cairo
48     gtk3
49     mpg123
50     alsa-lib
51     SDL2
52     libv4l
53     celt
54     libsndfile
55     srtp
56     ffmpeg
57     gsm
58     speex
59     portaudio
60     spandsp3
61     libuuid
62     libvpx
63   ] ++ (with gst_all_1; [ gstreamer gst-libav gst-plugins-base gst-plugins-bad gst-plugins-good ]);
65   cmakeFlags = [
66     "-DCMAKE_SKIP_BUILD_RPATH=ON"
67     "-Dre_DIR=${libre}/include/re"
68   ];
70   makeFlags = [
71     "LIBRE_MK=${libre}/share/re/re.mk"
72     "LIBRE_SO=${libre}/lib"
73     "LIBREM_PATH=${librem}"
74     "PREFIX=$(out)"
75     "USE_VIDEO=1"
76     "CCACHE_DISABLE=1"
78     "USE_ALSA=1"
79     "USE_AMR=1"
80     "USE_CAIRO=1"
81     "USE_CELT=1"
82     "USE_CONS=1"
83     "USE_EVDEV=1"
84     "USE_FFMPEG=1"
85     "USE_GSM=1"
86     "USE_GST1=1"
87     "USE_GTK=1"
88     "USE_L16=1"
89     "USE_MPG123=1"
90     "USE_OSS=1"
91     "USE_PLC=1"
92     "USE_VPX=1"
93     "USE_PORTAUDIO=1"
94     "USE_SDL=1"
95     "USE_SNDFILE=1"
96     "USE_SPEEX=1"
97     "USE_SPEEX_AEC=1"
98     "USE_SPEEX_PP=1"
99     "USE_SPEEX_RESAMP=1"
100     "USE_SRTP=1"
101     "USE_STDIO=1"
102     "USE_SYSLOG=1"
103     "USE_UUID=1"
104     "USE_V4L2=1"
105     "USE_X11=1"
107     "USE_BV32="
108     "USE_COREAUDIO="
109     "USE_G711=1"
110     "USE_G722=1"
111     "USE_G722_1="
112     "USE_ILBC="
113     "USE_OPUS="
114     "USE_SILK="
115   ]
116   ++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}"
117   ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.cc.libc}"
118   ;
120   enableParallelBuilding = true;
122   env.NIX_CFLAGS_COMPILE = '' -I${librem}/include/rem -I${gsm}/include/gsm
123     -DHAVE_INTTYPES_H -D__GLIBC__
124     -D__need_timeval -D__need_timespec -D__need_time_t '';
126   meta = {
127     description = "Modular SIP User-Agent with audio and video support";
128     homepage = "https://github.com/baresip/baresip";
129     maintainers = with lib.maintainers; [ raskin ehmry ];
130     mainProgram = "baresip";
131     license = lib.licenses.bsd3;
132     platforms = lib.platforms.unix;
133   };