Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ejabberd.src: switch to github #350903

Merged
merged 3 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,27 +1,55 @@
{ stdenv, makeWrapper, lib, fetchurl, libpng, libjpeg, libwebp
, erlang, openssl, expat, libyaml, bash, gnused, gnugrep, coreutils, util-linux, procps, gd
, autoreconfHook
, gawk
, rebar3WithPlugins
, fetchFromGitHub
, fetchgit
, fetchHex
, beamPackages
, nixosTests
, withMysql ? false
, withPgsql ? false
, withSqlite ? false, sqlite
, withPam ? false, pam
, withZlib ? true, zlib
, withSip ? false
, withLua ? false
, withTools ? false
, withRedis ? false
, withImagemagick ? false, imagemagick
{
stdenv,
makeWrapper,
lib,
libpng,
libjpeg,
libwebp,
erlang,
openssl,
expat,
libyaml,
bash,
gnused,
gnugrep,
coreutils,
util-linux,
procps,
gd,
autoreconfHook,
gawk,
rebar3WithPlugins,
fetchFromGitHub,
fetchgit,
fetchHex,
beamPackages,
nixosTests,
withMysql ? false,
withPgsql ? false,
withSqlite ? false,
sqlite,
withPam ? false,
pam,
withZlib ? true,
zlib,
withSip ? false,
withLua ? false,
withTools ? false,
withRedis ? false,
withImagemagick ? false,
imagemagick,
}:

let
ctlpath = lib.makeBinPath [ bash gnused gnugrep gawk coreutils util-linux procps ];
ctlpath = lib.makeBinPath [
bash
gnused
gnugrep
gawk
coreutils
util-linux
procps
];

provider_asn1 = beamPackages.buildRebar3 {
name = "provider_asn1";
Expand All @@ -44,7 +72,8 @@ let
beamDeps = [ ];
};

allBeamDeps = import ./rebar-deps.nix { # TODO(@chuangzhu) add updateScript
allBeamDeps = import ./rebar-deps.nix {
# TODO(@chuangzhu) add updateScript
inherit fetchHex fetchgit fetchFromGitHub;
builder = lib.makeOverridable beamPackages.buildRebar3;

Expand All @@ -55,7 +84,12 @@ let
stringprep = prev.stringprep.override { buildPlugins = [ beamPackages.pc ]; };
p1_acme = prev.p1_acme.override { buildPlugins = [ beamPackages.pc ]; };
eimp = prev.eimp.override {
buildInputs = [ gd libwebp libpng libjpeg ];
buildInputs = [
gd
libwebp
libpng
libjpeg
];
buildPlugins = [ beamPackages.pc ];
};
fast_tls = prev.fast_tls.override {
Expand All @@ -71,7 +105,10 @@ let
buildPlugins = [ beamPackages.pc ];
};
xmpp = prev.xmpp.override {
buildPlugins = [ beamPackages.pc provider_asn1 ];
buildPlugins = [
beamPackages.pc
provider_asn1
];
};
# Optional deps
sqlite3 = prev.sqlite3.override {
Expand All @@ -91,19 +128,35 @@ let
};
};

beamDeps = builtins.removeAttrs allBeamDeps [ "sqlite3" "p1_pgsql" "p1_mysql" "luerl" "esip" "eredis" "epam" "ezlib" ];
beamDeps = builtins.removeAttrs allBeamDeps [
"sqlite3"
"p1_pgsql"
"p1_mysql"
"luerl"
"esip"
"eredis"
"epam"
"ezlib"
];

in stdenv.mkDerivation rec {
in
stdenv.mkDerivation (finalAttrs:{
pname = "ejabberd";
version = "24.07";

nativeBuildInputs = [
makeWrapper
autoreconfHook
(rebar3WithPlugins { plugins = [ provider_asn1 rebar3_hex ]; })
(rebar3WithPlugins {
plugins = [
provider_asn1
rebar3_hex
];
})
];

buildInputs = [ erlang ]
buildInputs =
[ erlang ]
++ builtins.attrValues beamDeps
++ lib.optional withMysql allBeamDeps.p1_mysql
++ lib.optional withPgsql allBeamDeps.p1_pgsql
Expand All @@ -112,13 +165,13 @@ in stdenv.mkDerivation rec {
++ lib.optional withZlib allBeamDeps.ezlib
++ lib.optional withSip allBeamDeps.esip
++ lib.optional withLua allBeamDeps.luerl
++ lib.optional withRedis allBeamDeps.eredis
;
++ lib.optional withRedis allBeamDeps.eredis;

src = fetchurl {
url = "https://www.process-one.net/downloads/downloads-action.php?file=/${version}/ejabberd-${version}.tar.gz";
hash = "sha256-wPt0asuoGl20Hel8A5aMH2gaE7G2waiVtxguM4IMGNk=";
# remember to update rebar-deps.nix
src = fetchFromGitHub {
owner = "processone";
repo = "ejabberd";
rev = "refs/tags/${finalAttrs.version}";
hash = "sha256-4wEQBumWrHqN2uNrDxAJhgv2ok7pgQlAEPpL96ZOsTQ=";
};

passthru.tests = {
Expand Down Expand Up @@ -153,15 +206,21 @@ in stdenv.mkDerivation rec {
-e '2iexport PATH=${ctlpath}:$PATH' \
-e "s,\(^ *ERL_LIBS=.*\),\1:$ERL_LIBS," \
$out/sbin/ejabberdctl
${lib.optionalString withImagemagick ''wrapProgram $out/lib/ejabberd-*/priv/bin/captcha.sh --prefix PATH : "${lib.makeBinPath [ imagemagick ]}"''}
${lib.optionalString withImagemagick ''wrapProgram $out/lib/ejabberd-*/priv/bin/captcha.sh --prefix PATH : "${
lib.makeBinPath [ imagemagick ]
}"''}
'';

meta = with lib; {
meta = {
description = "Open-source XMPP application server written in Erlang";
mainProgram = "ejabberdctl";
license = licenses.gpl2Plus;
license = lib.licenses.gpl2Plus;
homepage = "https://www.ejabberd.im";
platforms = platforms.linux;
maintainers = with maintainers; [ sander abbradar chuangzhu ];
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [
sander
abbradar
chuangzhu
];
};
}
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Generated by rebar3_nix
let fetchOnly = { src, ... }: src;
in { builder ? fetchOnly, fetchHex, fetchgit, fetchFromGitHub, overrides ? (x: y: { }) }:
let
fetchOnly = { src, ... }: src;
in
{
builder ? fetchOnly,
fetchHex,
fetchgit,
fetchFromGitHub,
overrides ? (x: y: { }),
}:
let
self = packages // (overrides self packages);
packages = with self; {
Expand Down Expand Up @@ -52,7 +60,14 @@ let
version = "1.8.3";
sha256 = "sha256-7XAGX5qJqBjc/0O3TAgMnn9PFBThBRvt23KA24Ca9xE=";
};
beamDeps = [ ezlib fast_tls fast_xml idna p1_utils stringprep ];
beamDeps = [
ezlib
fast_tls
fast_xml
idna
p1_utils
stringprep
];
};
stun = builder {
name = "stun";
Expand All @@ -62,7 +77,10 @@ let
version = "1.2.14";
sha256 = "sha256-4TSAext6jf/ZTmTu/uAOZce0BC89FOFvj0NWbSA3FYM=";
};
beamDeps = [ fast_tls p1_utils ];
beamDeps = [
fast_tls
p1_utils
];
};
stringprep = builder {
name = "stringprep";
Expand Down Expand Up @@ -142,7 +160,13 @@ let
version = "1.0.23";
sha256 = "sha256-jOGW8m49IuoQt4CRIpUEZYeMEn+Adn4yUgeu1+jQ3Vk=";
};
beamDeps = [ base64url idna jiffy jose yconf ];
beamDeps = [
base64url
idna
jiffy
jose
yconf
];
};
mqtree = builder {
name = "mqtree";
Expand Down Expand Up @@ -232,7 +256,11 @@ let
version = "1.0.54";
sha256 = "sha256-gYevgZ1yWc2t2vaXJsI572BMmwsCmKXy0+aHv14iN+4=";
};
beamDeps = [ fast_tls p1_utils stun ];
beamDeps = [
fast_tls
p1_utils
stun
];
};
eredis = builder {
name = "eredis";
Expand Down Expand Up @@ -275,4 +303,5 @@ let
beamDeps = [ p1_utils ];
};
};
in self
in
self
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24193,8 +24193,6 @@ with pkgs;
etcd_3_4 = callPackage ../servers/etcd/3.4.nix { };
etcd_3_5 = callPackage ../servers/etcd/3.5 { };

ejabberd = callPackage ../servers/xmpp/ejabberd { };

exhaustive = callPackage ../development/tools/exhaustive { };

hyp = callPackage ../servers/http/hyp { };
Expand Down