mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 23:43:30 +00:00
2e6bf42a22
There ver very many conflicts, basically all due to name -> pname+version. Fortunately, almost everything was auto-resolved by kdiff3, and for now I just fixed up a couple evaluation problems, as verified by the tarball job. There might be some fallback to these conflicts, but I believe it should be minimal. Hydra nixpkgs: ?compare=1538299
122 lines
3.3 KiB
Nix
122 lines
3.3 KiB
Nix
{ stdenv, writeScriptBin, makeWrapper, lib, fetchurl, git, cacert, libpng, libjpeg, libwebp
|
|
, erlang, openssl, expat, libyaml, bash, gnused, gnugrep, coreutils, utillinux, procps, gd
|
|
, flock
|
|
, withMysql ? false
|
|
, withPgsql ? false
|
|
, withSqlite ? false, sqlite
|
|
, withPam ? false, pam
|
|
, withZlib ? true, zlib
|
|
, withRiak ? false
|
|
, withElixir ? false, elixir
|
|
, withIconv ? true
|
|
, withTools ? false
|
|
, withRedis ? false
|
|
}:
|
|
|
|
let
|
|
fakegit = writeScriptBin "git" ''
|
|
#! ${stdenv.shell} -e
|
|
if [ "$1" = "describe" ]; then
|
|
[ -r .rev ] && cat .rev || true
|
|
fi
|
|
'';
|
|
|
|
ctlpath = lib.makeBinPath [ bash gnused gnugrep coreutils utillinux procps ];
|
|
|
|
in stdenv.mkDerivation rec {
|
|
version = "19.08";
|
|
pname = "ejabberd";
|
|
|
|
src = fetchurl {
|
|
url = "https://www.process-one.net/downloads/ejabberd/${version}/${pname}-${version}.tgz";
|
|
sha256 = "0ivkw31civcznv9k645hvrzn1yc6a4qsrsywjrakniwaaxlsnj8w";
|
|
};
|
|
|
|
nativeBuildInputs = [ fakegit ];
|
|
|
|
buildInputs = [ erlang openssl expat libyaml gd makeWrapper ]
|
|
++ lib.optional withSqlite sqlite
|
|
++ lib.optional withPam pam
|
|
++ lib.optional withZlib zlib
|
|
++ lib.optional withElixir elixir
|
|
;
|
|
|
|
# Apparently needed for Elixir
|
|
LANG = "en_US.UTF-8";
|
|
|
|
deps = stdenv.mkDerivation {
|
|
pname = "ejabberd-deps";
|
|
inherit version;
|
|
|
|
inherit src;
|
|
|
|
configureFlags = [ "--enable-all" "--with-sqlite3=${sqlite.dev}" ];
|
|
|
|
nativeBuildInputs = [ git erlang openssl expat libyaml sqlite pam zlib elixir ];
|
|
|
|
GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
|
|
|
makeFlags = [ "deps" ];
|
|
|
|
phases = [ "unpackPhase" "configurePhase" "buildPhase" "installPhase" ];
|
|
|
|
installPhase = ''
|
|
for i in deps/*; do
|
|
( cd $i
|
|
git reset --hard
|
|
git clean -ffdx
|
|
git describe --always --tags > .rev
|
|
rm -rf .git
|
|
)
|
|
done
|
|
rm deps/.got
|
|
|
|
cp -r deps $out
|
|
'';
|
|
|
|
outputHashMode = "recursive";
|
|
outputHashAlgo = "sha256";
|
|
outputHash = "0h1amqp2x6ir29bdh9x8bm0abj67k81nmkqi8gidwccsa5z94s2c";
|
|
};
|
|
|
|
configureFlags =
|
|
[ (lib.enableFeature withMysql "mysql")
|
|
(lib.enableFeature withPgsql "pgsql")
|
|
(lib.enableFeature withSqlite "sqlite")
|
|
(lib.enableFeature withPam "pam")
|
|
(lib.enableFeature withZlib "zlib")
|
|
(lib.enableFeature withRiak "riak")
|
|
(lib.enableFeature withElixir "elixir")
|
|
(lib.enableFeature withIconv "iconv")
|
|
(lib.enableFeature withTools "tools")
|
|
(lib.enableFeature withRedis "redis")
|
|
] ++ lib.optional withSqlite "--with-sqlite3=${sqlite.dev}";
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
preBuild = ''
|
|
cp -r $deps deps
|
|
chmod -R +w deps
|
|
patchShebangs deps
|
|
'';
|
|
|
|
postInstall = ''
|
|
sed -i \
|
|
-e '2iexport PATH=${ctlpath}:$PATH' \
|
|
-e 's,\(^ *FLOCK=\).*,\1${flock}/bin/flock,' \
|
|
-e 's,\(^ *JOT=\).*,\1,' \
|
|
-e 's,\(^ *CONNLOCKDIR=\).*,\1/var/lock/ejabberdctl,' \
|
|
$out/sbin/ejabberdctl
|
|
wrapProgram $out/lib/eimp-*/priv/bin/eimp --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ libpng libjpeg libwebp ]}"
|
|
'';
|
|
|
|
meta = with stdenv.lib; {
|
|
description = "Open-source XMPP application server written in Erlang";
|
|
license = licenses.gpl2;
|
|
homepage = https://www.ejabberd.im;
|
|
platforms = platforms.linux;
|
|
maintainers = with maintainers; [ sander abbradar ];
|
|
broken = withElixir;
|
|
};
|
|
}
|