pkg: Add eturnal

This commit is contained in:
PapaTutuWawa 2022-05-31 13:59:44 +02:00
parent 279a091b90
commit 247decf8b0
4 changed files with 127 additions and 0 deletions

View File

@ -12,6 +12,12 @@ Blacklist stored at `$out/blacklist.txt`.
[Source link.](https://github.com/JabberSPAM/blacklist) [Source link.](https://github.com/JabberSPAM/blacklist)
### eturnal
STUN / TURN standalone server by processone.
[Source link.](https://github.com/processone/eturnal)
## License ## License
See `LICENSE`. See `LICENSE`.

View File

@ -16,6 +16,7 @@
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
in { in {
jabberSpam = pkgs.callPackage ./pkgs/jabberSpam.nix {}; jabberSpam = pkgs.callPackage ./pkgs/jabberSpam.nix {};
eturnal = pkgs.callPackage ./pkgs/eturnal {};
}); });
}; };
} }

46
pkgs/eturnal/default.nix Normal file
View File

@ -0,0 +1,46 @@
{
stdenv, lib
, fetchFromGitHub, fetchHex
, beam, autoPatchelfHook
, erlang, libyaml, openssl, gnutar, rebar3
}:
let
deps = import ./deps.nix {
inherit fetchFromGitHub fetchHex;
};
in stdenv.mkDerivation rec {
name = "eturnal";
version = "1.8.3";
buildInputs = [
rebar3 openssl gnutar libyaml erlang
];
postPatch = ''
sed --in-place -e "s|/opt/eturnal|$out|g" build.config
# Otherwise the script won't find tr and sed
sed --in-place -e "s|export PATH='/usr/local/bin:/usr/bin:/bin'||g" scripts/get-version
cat build.config
'';
buildPhase = ''
mkdir -p _checkouts
${toString (lib.mapAttrsToList (k: v: ''
cp -R --no-preserve=mode ${v} _checkouts/${k}
'') deps)}
HOME=. rebar3 as prod tar
'';
installPhase = ''
mkdir -p $out
tar -xzf _build/prod/rel/*/*.tar.gz -C $out/
'';
src = fetchFromGitHub {
owner = "processone";
repo = "eturnal";
rev = version;
sha256 = "sha256-mIQOVS1nB+DEpwDRX7xoCFqkEHpWYcKnP1KVUxfrVCA=";
};
}

74
pkgs/eturnal/deps.nix Normal file
View File

@ -0,0 +1,74 @@
# Generated by rebar3_nix
{ fetchHex, fetchFromGitHub }:
{
yval = fetchHex {
pkg = "yval";
version = "1.0.10";
sha256 = "sha256-D37/UMsk9fbMNUn8VL/kr1iz/EVTsIKTJbqhmcSLonY=";
};
ulitos = fetchHex {
pkg = "ulitos";
version = "0.4.0";
sha256 = "sha256-r9zlCncIHrjZMXmabgFUWEguq/m6ivNnxQzYZgp0m4g=";
};
poolboy = fetchHex {
pkg = "poolboy";
version = "1.5.2";
sha256 = "sha256-2teXBM5UQPPVo2gchZC53CXRpWHo9anJlSgQEoYJAeM=";
};
p1_utils = fetchHex {
pkg = "p1_utils";
version = "1.0.25";
sha256 = "sha256-khkhRCjyxuXTGH/465qHg2lcJCdCC+miWYQOB62jKEc=";
};
fast_yaml = fetchHex {
pkg = "fast_yaml";
version = "1.0.33";
sha256 = "sha256-76YKKsvNLC5y614W8UdXJrnYivyjrW27S8VJJmhj58g=";
};
fast_tls = fetchHex {
pkg = "fast_tls";
version = "1.1.15";
sha256 = "sha256-71FqoibemkYFcEwYSZKEzU/BFac71ySQNBlyzgwrTTA=";
};
stun = fetchHex {
pkg = "stun";
version = "1.2.2";
sha256 = "sha256-T1THuG4qpBP67DWp+2mQSEceHAanIcU+asRLQF/So7k=";
};
recon = fetchHex {
pkg = "recon";
version = "2.5.2";
sha256 = "sha256-LHUjyN7pHf9B9rPWPLor1J620v5b8e7A33+H614jDhw=";
};
influx_udp = fetchHex {
pkg = "influx_udp";
version = "1.1.2";
sha256 = "sha256-dA3Maw8PN2uSmpJw5fT27v1QYWNedsj8wFCPizNvGoI=";
};
conf = fetchHex {
pkg = "conf";
version = "0.2.6";
sha256 = "sha256-wVOa00IOGKV+kq6hb15Doh4+Eg9FuTcBGVJjTdyxMoc=";
};
pc = fetchHex {
pkg = "pc";
version = "1.14.0";
sha256 = "fc597e5356af714615e6baeefaa8262be09de7849bf92aa57672db5e409a3553";
};
rebar3_hex = fetchHex {
pkg = "rebar3_hex";
version = "7.0.1";
sha256 = "f899f4e93727a5860eb66a299a4a3871a84ce06e97db4c564ff0b2108669fa56";
};
hex_core = fetchHex {
pkg = "hex_core";
version = "0.8.4";
sha256 = "4b8c21fa049515d778395e38b0d0e5d48b7ecdc703bba1f7007e2651292ce61a";
};
verl = fetchHex {
pkg = "verl";
version = "1.1.1";
sha256 = "0925e51cd92a0a8be271765b02430b2e2cff8ac30ef24d123bd0d58511e8fb18";
};
}