2021-01-11 11:27:59 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, openssl
|
|
|
|
, libevent
|
|
|
|
, pkg-config
|
|
|
|
, libprom
|
|
|
|
, libpromhttp
|
|
|
|
, libmicrohttpd
|
2022-08-30 05:51:38 +02:00
|
|
|
, sqlite
|
2021-07-03 09:33:39 +02:00
|
|
|
, nixosTests
|
2021-01-11 11:27:59 +01:00
|
|
|
}:
|
2016-06-21 12:59:29 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "coturn";
|
2022-12-05 08:13:25 +01:00
|
|
|
version = "4.6.1";
|
2016-06-21 12:59:29 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "coturn";
|
|
|
|
repo = "coturn";
|
2022-12-05 09:17:34 +01:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-ckqPxG3ieqA0H9g1GfE8hYs6tUsZfzt6/yYR1qlgoxE=";
|
2016-06-21 12:59:29 +02:00
|
|
|
};
|
|
|
|
|
2022-12-05 09:17:34 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2021-01-11 11:27:59 +01:00
|
|
|
buildInputs = [
|
|
|
|
openssl
|
2022-12-14 22:30:55 +01:00
|
|
|
(libevent.override { inherit openssl; })
|
2021-01-11 11:27:59 +01:00
|
|
|
libprom
|
|
|
|
libpromhttp
|
|
|
|
libmicrohttpd
|
2022-08-30 05:51:38 +02:00
|
|
|
sqlite.dev
|
2021-01-11 11:27:59 +01:00
|
|
|
];
|
2016-06-21 12:59:29 +02:00
|
|
|
|
2020-04-29 01:11:43 +02:00
|
|
|
patches = [
|
|
|
|
./pure-configure.patch
|
2022-12-14 22:31:17 +01:00
|
|
|
|
|
|
|
# fix build against openssl 3.x
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/coturn/coturn/commit/4ce784a8781ab086c150e2b9f5641b1a37fd9b31.patch";
|
|
|
|
hash = "sha256-Jx8XNXrgq0ockm1zjwRzfvSS3fVrVyVvQY1l0CpcR3Q=";
|
|
|
|
})
|
2020-04-29 01:11:43 +02:00
|
|
|
];
|
2016-06-21 12:59:29 +02:00
|
|
|
|
2022-06-05 19:51:08 +02:00
|
|
|
# Workaround build failure on -fno-common toolchains like upstream
|
|
|
|
# gcc-10. Otherwise build fails as:
|
|
|
|
# ld: ...-libprom-0.1.1/include/prom_collector_registry.h:37: multiple definition of
|
|
|
|
# `PROM_COLLECTOR_REGISTRY_DEFAULT'; ...-libprom-0.1.1/include/prom_collector_registry.h:37: first defined here
|
|
|
|
# Should be fixed in libprom-1.2.0 and later: https://github.com/digitalocean/prometheus-client-c/pull/25
|
2023-02-19 20:23:32 +01:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2022-06-05 19:51:08 +02:00
|
|
|
|
2021-07-03 09:33:39 +02:00
|
|
|
passthru.tests.coturn = nixosTests.coturn;
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2022-12-05 09:17:34 +01:00
|
|
|
description = "A TURN server";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://coturn.net/";
|
2022-12-05 09:18:14 +01:00
|
|
|
changelog = "https://github.com/coturn/coturn/blob/${version}/ChangeLog";
|
2016-06-21 12:59:29 +02:00
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
platforms = platforms.all;
|
2021-01-11 11:27:59 +01:00
|
|
|
maintainers = with maintainers; [ ralith _0x4A6F ];
|
2022-12-05 09:17:34 +01:00
|
|
|
broken = stdenv.isDarwin; # 2018-10-21
|
2016-06-21 12:59:29 +02:00
|
|
|
};
|
|
|
|
}
|