nixpkgs/pkgs/servers/coturn/default.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

61 lines
1.4 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, openssl
, libevent
, pkg-config
, libprom
, libpromhttp
, libmicrohttpd
, sqlite
, nixosTests
}:
stdenv.mkDerivation rec {
pname = "coturn";
version = "4.6.2";
src = fetchFromGitHub {
owner = "coturn";
repo = "coturn";
rev = "refs/tags/${version}";
hash = "sha256-BKIto762W7UkKjzIm3eVU18oiHpYUMQYJihebYxBOZs=";
};
nativeBuildInputs = [
pkg-config
];
buildInputs = [
openssl
(libevent.override { inherit openssl; })
libprom
libpromhttp
libmicrohttpd
sqlite.dev
];
patches = [
./pure-configure.patch
];
# 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
env.NIX_CFLAGS_COMPILE = "-fcommon";
passthru.tests.coturn = nixosTests.coturn;
meta = with lib; {
description = "TURN server";
homepage = "https://coturn.net/";
changelog = "https://github.com/coturn/coturn/blob/${version}/ChangeLog";
license = with licenses; [ bsd3 ];
platforms = platforms.all;
maintainers = with maintainers; [ _0x4A6F ];
broken = stdenv.hostPlatform.isDarwin; # 2018-10-21
};
}