about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gsasl
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gsasl')
-rw-r--r--nixpkgs/pkgs/development/libraries/gsasl/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/gsasl/gsasl.patch21
2 files changed, 64 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gsasl/default.nix b/nixpkgs/pkgs/development/libraries/gsasl/default.nix
new file mode 100644
index 000000000000..c1003a6e33f6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsasl/default.nix
@@ -0,0 +1,43 @@
+{ fetchurl, lib, stdenv, libidn, libkrb5 }:
+
+stdenv.mkDerivation rec {
+  pname = "gsasl";
+  version = "2.2.0";
+
+  src = fetchurl {
+    url = "mirror://gnu/gsasl/${pname}-${version}.tar.gz";
+    sha256 = "sha256-ebho47mXbcSE1ZspygroiXvpbOTTbTKu1dk1p6Mwd1k=";
+  };
+
+  # This is actually bug in musl. It is already fixed in trunc and
+  # this patch won't be necessary with musl > 1.2.3.
+  #
+  # https://git.musl-libc.org/cgit/musl/commit/?id=b50eb8c36c20f967bd0ed70c0b0db38a450886ba
+  patches = lib.optional stdenv.hostPlatform.isMusl ./gsasl.patch;
+
+  buildInputs = [ libidn libkrb5 ];
+
+  configureFlags = [ "--with-gssapi-impl=mit" ];
+
+  preCheck = ''
+    export LOCALDOMAIN="dummydomain"
+  '';
+  doCheck = !stdenv.hostPlatform.isDarwin;
+
+  meta = {
+    description = "GNU SASL, Simple Authentication and Security Layer library";
+
+    longDescription =
+      '' GNU SASL is a library that implements the IETF Simple
+         Authentication and Security Layer (SASL) framework and
+         some SASL mechanisms. SASL is used in network servers
+         (e.g. IMAP, SMTP, etc.) to authenticate peers.
+       '';
+
+    homepage = "https://www.gnu.org/software/gsasl/";
+    license = lib.licenses.gpl3Plus;
+
+    maintainers = with lib.maintainers; [ shlevy ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsasl/gsasl.patch b/nixpkgs/pkgs/development/libraries/gsasl/gsasl.patch
new file mode 100644
index 000000000000..572d3034967e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsasl/gsasl.patch
@@ -0,0 +1,21 @@
+GNU libc and Musl libc have different ideas what
+
+    strverscmp("UNKNOWN", "2.2.0")
+
+should return. Hopefully nobody depend on this particular behaviour in
+practice.
+
+--- a/tests/version.c	1970-01-01 00:00:00.000000000 -0000
++++ b/tests/version.c	1970-01-01 00:00:00.000000000 -0000
+@@ -111,11 +111,5 @@
+       exit_code = EXIT_FAILURE;
+     }
+ 
+-  if (gsasl_check_version ("UNKNOWN"))
+-    {
+-      printf ("FAIL: gsasl_check_version (UNKNOWN)\n");
+-      exit_code = EXIT_FAILURE;
+-    }
+-
+   return exit_code;
+ }