1{ lib
2, stdenv
3, fetchFromGitHub
4, zlib
5, openssl
6, cmake
7, SystemConfiguration
8}:
9
10stdenv.mkDerivation rec {
11 version = "3.10.0";
12 pname = "libre";
13 src = fetchFromGitHub {
14 owner = "baresip";
15 repo = "re";
16 rev = "v${version}";
17 sha256 = "sha256-OWVDuKlF7YLipDURC46s14WOLWWagUqWg20sH0kSIA4=";
18 };
19
20 buildInputs = [
21 openssl
22 zlib
23 ] ++ lib.optionals stdenv.isDarwin [
24 SystemConfiguration
25 ];
26
27 nativeBuildInputs = [ cmake ];
28 makeFlags = [ "USE_ZLIB=1" "USE_OPENSSL=1" "PREFIX=$(out)" ]
29 ++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}"
30 ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${lib.getDev stdenv.cc.libc}"
31 ;
32 enableParallelBuilding = true;
33 meta = {
34 description = "Library for real-time communications with async IO support and a complete SIP stack";
35 homepage = "https://github.com/baresip/re";
36 maintainers = with lib.maintainers; [ raskin ];
37 license = lib.licenses.bsd3;
38 };
39}