about summary refs log tree commit diff
path: root/pkgs/servers/xmpp
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2023-04-08 21:09:45 +0200
committerJörg Thalheim <joerg@thalheim.io>2023-04-19 09:13:19 +0200
commitfb689e03288cdf363623c9ac405d11f04659605c (patch)
treebe50310a7e6b9ca052f4f3277c0262d3737e2503 /pkgs/servers/xmpp
parent8ef336e870e3795a112bd9ea28a5cb945a981c1d (diff)
ejabberd: 21.04 -> 23.01
Diffstat (limited to 'pkgs/servers/xmpp')
-rw-r--r--pkgs/servers/xmpp/ejabberd/default.nix67
1 files changed, 34 insertions, 33 deletions
diff --git a/pkgs/servers/xmpp/ejabberd/default.nix b/pkgs/servers/xmpp/ejabberd/default.nix
index bec5940410374..671e88c52810f 100644
--- a/pkgs/servers/xmpp/ejabberd/default.nix
+++ b/pkgs/servers/xmpp/ejabberd/default.nix
@@ -1,36 +1,23 @@
 { stdenv, writeScriptBin, makeWrapper, lib, fetchurl, git, cacert, libpng, libjpeg, libwebp
 , erlang, openssl, expat, libyaml, bash, gnused, gnugrep, coreutils, util-linux, procps, gd
-, flock
+, flock, autoreconfHook
+, nixosTests
 , withMysql ? false
 , withPgsql ? false
 , withSqlite ? false, sqlite
 , withPam ? false, pam
 , withZlib ? true, zlib
-, 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 util-linux procps ];
-
 in stdenv.mkDerivation rec {
-  version = "21.04";
   pname = "ejabberd";
+  version = "23.01";
 
-  src = fetchurl {
-    url = "https://www.process-one.net/downloads/downloads-action.php?file=/${version}/${pname}-${version}.tgz";
-    sha256 = "09s8mj0dkvp9mxazsqxqqmnl5n2xyi8avx0rzgvqrbl3byanzfzr";
-  };
-
-  nativeBuildInputs = [ fakegit makeWrapper ];
+  nativeBuildInputs = [ makeWrapper autoreconfHook ];
 
   buildInputs = [ erlang openssl expat libyaml gd ]
     ++ lib.optional withSqlite sqlite
@@ -38,15 +25,25 @@ in stdenv.mkDerivation rec {
     ++ lib.optional withZlib zlib
   ;
 
+  src = fetchurl {
+    url = "https://www.process-one.net/downloads/downloads-action.php?file=/${version}/ejabberd-${version}.tar.gz";
+    sha256 = "sha256-K4P+A2u/Hbina4b3GP8T3wmPoQxiv88GuB4KZOb2+cA=";
+  };
+
+  passthru.tests = {
+    inherit (nixosTests) ejabberd;
+  };
+
   deps = stdenv.mkDerivation {
     pname = "ejabberd-deps";
-    inherit version;
 
-    inherit src;
+    inherit src version;
 
     configureFlags = [ "--enable-all" "--with-sqlite3=${sqlite.dev}" ];
 
-    nativeBuildInputs = [ git erlang openssl expat libyaml sqlite pam zlib ];
+    nativeBuildInputs = [
+      git erlang openssl expat libyaml sqlite pam zlib autoreconfHook
+    ];
 
     GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
 
@@ -66,25 +63,29 @@ in stdenv.mkDerivation rec {
       cp -r deps $out
     '';
 
-    outputHashMode = "recursive";
+    dontPatchELF = true;
+    dontStrip = true;
+    # avoid /nix/store references in the source
+    dontPatchShebangs = true;
+
     outputHashAlgo = "sha256";
-    outputHash = "1mvixgb46ss35abjwz3lw38c69bii1xyj557a92bvrxc1gc6gx31";
+    outputHashMode = "recursive";
+    outputHash = "sha256-Lj4YSPOiiJQ6uN4cAR+1s/eVSfoIsuvWR7gGkVYrOfc=";
   };
 
-  configureFlags =
-    [ (lib.enableFeature withMysql "mysql")
-      (lib.enableFeature withPgsql "pgsql")
-      (lib.enableFeature withSqlite "sqlite")
-      (lib.enableFeature withPam "pam")
-      (lib.enableFeature withZlib "zlib")
-      (lib.enableFeature withIconv "iconv")
-      (lib.enableFeature withTools "tools")
-      (lib.enableFeature withRedis "redis")
-    ] ++ lib.optional withSqlite "--with-sqlite3=${sqlite.dev}";
+  configureFlags = [
+    (lib.enableFeature withMysql "mysql")
+    (lib.enableFeature withPgsql "pgsql")
+    (lib.enableFeature withSqlite "sqlite")
+    (lib.enableFeature withPam "pam")
+    (lib.enableFeature withZlib "zlib")
+    (lib.enableFeature withTools "tools")
+    (lib.enableFeature withRedis "redis")
+  ] ++ lib.optional withSqlite "--with-sqlite3=${sqlite.dev}";
 
   enableParallelBuilding = true;
 
-  preBuild = ''
+  postPatch = ''
     cp -r $deps deps
     chmod -R +w deps
     patchShebangs .