39 withImagemagick ? false,
44 ctlpath = lib.makeBinPath [
54 provider_asn1 = beamPackages.buildRebar3 {
55 name = "provider_asn1";
58 pkg = "provider_asn1";
60 sha256 = "sha256-MuelWYZi01rBut8jM6a5alMZizPGZoBE/LveSRu/+wU=";
64 rebar3_hex = beamPackages.buildRebar3 {
70 sha256 = "sha256-1S2igSwiInATUgULZ1E6e2dK6YI5gvRffHRfF1Gg5Ok=";
75 allBeamDeps = import ./rebar-deps.nix {
76 inherit fetchHex fetchgit fetchFromGitHub;
77 builder = lib.makeOverridable beamPackages.buildRebar3;
79 overrides = final: prev: {
80 jiffy = prev.jiffy.override { buildPlugins = [ beamPackages.pc ]; };
81 cache_tab = prev.cache_tab.override { buildPlugins = [ beamPackages.pc ]; };
82 mqtree = prev.mqtree.override { buildPlugins = [ beamPackages.pc ]; };
83 stringprep = prev.stringprep.override { buildPlugins = [ beamPackages.pc ]; };
84 p1_acme = prev.p1_acme.override { buildPlugins = [ beamPackages.pc ]; };
85 eimp = prev.eimp.override {
92 buildPlugins = [ beamPackages.pc ];
94 fast_tls = prev.fast_tls.override {
95 buildInputs = [ openssl ];
96 buildPlugins = [ beamPackages.pc ];
98 fast_xml = prev.fast_xml.override {
99 buildInputs = [ expat ];
100 buildPlugins = [ beamPackages.pc ];
102 fast_yaml = prev.fast_yaml.override {
103 buildInputs = [ libyaml ];
104 buildPlugins = [ beamPackages.pc ];
106 xmpp = prev.xmpp.override {
113 sqlite3 = prev.sqlite3.override {
114 buildInputs = [ sqlite ];
115 buildPlugins = [ beamPackages.pc ];
117 p1_mysql = prev.p1_mysql.override { buildPlugins = [ beamPackages.pc ]; };
118 epam = prev.epam.override {
119 buildInputs = [ pam ];
120 buildPlugins = [ beamPackages.pc ];
122 esip = prev.esip.override { buildPlugins = [ beamPackages.pc ]; };
123 ezlib = prev.ezlib.override {
124 buildInputs = [ zlib ];
125 buildPlugins = [ beamPackages.pc ];
130 beamDeps = builtins.removeAttrs allBeamDeps [
142 stdenv.mkDerivation (finalAttrs:{
146 nativeBuildInputs = [
159 ++ builtins.attrValues beamDeps
160 ++ lib.optional withMysql allBeamDeps.p1_mysql
161 ++ lib.optional withPgsql allBeamDeps.p1_pgsql
162 ++ lib.optional withSqlite allBeamDeps.sqlite3
163 ++ lib.optional withPam allBeamDeps.epam
164 ++ lib.optional withZlib allBeamDeps.ezlib
165 ++ lib.optional withSip allBeamDeps.esip
166 ++ lib.optional withLua allBeamDeps.luerl
167 ++ lib.optional withRedis allBeamDeps.eredis;
169 src = fetchFromGitHub {
170 owner = "processone";
172 rev = "refs/tags/${finalAttrs.version}";
173 hash = "sha256-WQCFwhyaTVAX1bQURJkiCupgr3zc5yKrhQBiGyYsWZk=";
177 inherit (nixosTests) ejabberd;
181 (lib.enableFeature withMysql "mysql")
182 (lib.enableFeature withPgsql "pgsql")
183 (lib.enableFeature withSqlite "sqlite")
184 (lib.enableFeature withPam "pam")
185 (lib.enableFeature withZlib "zlib")
186 (lib.enableFeature withSip "sip")
187 (lib.enableFeature withLua "lua")
188 (lib.enableFeature withTools "tools")
189 (lib.enableFeature withRedis "redis")
190 ] ++ lib.optional withSqlite "--with-sqlite3=${sqlite.dev}";
192 enableParallelBuilding = true;
196 mkdir -p _build/default/lib
197 touch _build/default/lib/.got
198 touch _build/default/lib/.built
201 REBAR_IGNORE_DEPS = 1;
205 -e '2iexport PATH=${ctlpath}:$PATH' \
206 -e "s,\(^ *ERL_LIBS=.*\),\1:$ERL_LIBS," \
207 $out/sbin/ejabberdctl
208 ${lib.optionalString withImagemagick ''wrapProgram $out/lib/ejabberd-*/priv/bin/captcha.sh --prefix PATH : "${
209 lib.makeBinPath [ imagemagick ]
213 passthru.updateScript = ./update.sh;
216 description = "Open-source XMPP application server written in Erlang";
217 mainProgram = "ejabberdctl";
218 license = lib.licenses.gpl2Plus;
219 homepage = "https://www.ejabberd.im";
220 platforms = lib.platforms.linux;
221 maintainers = with lib.maintainers; [