diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/opendkim')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/opendkim/default.nix | 37 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/opendkim/openssl-1.1.patch | 81 |
2 files changed, 118 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/opendkim/default.nix b/nixpkgs/pkgs/development/libraries/opendkim/default.nix new file mode 100644 index 000000000000..7cbd85055ef6 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/opendkim/default.nix @@ -0,0 +1,37 @@ +{ stdenv, fetchurl, pkgconfig, libbsd, openssl, libmilter +, autoreconfHook, perl, makeWrapper }: + +stdenv.mkDerivation rec { + pname = "opendkim"; + version = "2.10.3"; + + src = fetchurl { + url = "mirror://sourceforge/opendkim/files/${pname}-${version}.tar.gz"; + sha256 = "06v8bqhh604sz9rh5bvw278issrwjgc4h1wx2pz9a84lpxbvm823"; + }; + + configureFlags= [ + "--with-milter=${libmilter}" + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ]; + + nativeBuildInputs = [ autoreconfHook pkgconfig makeWrapper ]; + + buildInputs = [ libbsd openssl libmilter perl ]; + + patches = [ ./openssl-1.1.patch ]; + + postInstall = '' + wrapProgram $out/sbin/opendkim-genkey \ + --prefix PATH : ${openssl.bin}/bin + ''; + + meta = with stdenv.lib; { + description = "C library for producing DKIM-aware applications and an open source milter for providing DKIM service"; + homepage = "http://www.opendkim.org/"; + maintainers = with maintainers; [ abbradar ]; + license = licenses.bsd3; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/opendkim/openssl-1.1.patch b/nixpkgs/pkgs/development/libraries/opendkim/openssl-1.1.patch new file mode 100644 index 000000000000..c36559cf16cd --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/opendkim/openssl-1.1.patch @@ -0,0 +1,81 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -864,26 +864,28 @@ + AC_SEARCH_LIBS([ERR_peek_error], [crypto], , + AC_MSG_ERROR([libcrypto not found])) + +- AC_SEARCH_LIBS([SSL_library_init], [ssl], , +- [ +- if test x"$enable_shared" = x"yes" +- then +- AC_MSG_ERROR([Cannot build shared opendkim +- against static openssl libraries. +- Configure with --disable-shared +- to get this working or obtain a +- shared libssl library for +- opendkim to use.]) +- fi +- +- # avoid caching issue - last result of SSL_library_init +- # shouldn't be cached for this next check +- unset ac_cv_search_SSL_library_init +- LIBCRYPTO_LIBS="$LIBCRYPTO_LIBS -ldl" +- AC_SEARCH_LIBS([SSL_library_init], [ssl], , +- AC_MSG_ERROR([libssl not found]), [-ldl]) +- ] +- ) ++ ++ AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM([[#include <openssl/ssl.h>]], ++ [[SSL_library_init();]])], ++ [od_have_ossl="yes";], ++ [od_have_ossl="no";]) ++ if test x"$od_have_ossl" = x"no" ++ then ++ if test x"$enable_shared" = x"yes" ++ then ++ AC_MSG_ERROR([Cannot build shared opendkim ++ against static openssl libraries. ++ Configure with --disable-shared ++ to get this working or obtain a ++ shared libssl library for ++ opendkim to use.]) ++ fi ++ ++ LIBCRYPTO_LIBS="$LIBCRYPTO_LIBS -ldl" ++ AC_SEARCH_LIBS([SSL_library_init], [ssl], , ++ AC_MSG_ERROR([libssl not found]), [-ldl]) ++ fi + + AC_CHECK_DECL([SHA256_DIGEST_LENGTH], + AC_DEFINE([HAVE_SHA256], 1, +--- a/opendkim/opendkim-crypto.c ++++ b/opendkim/opendkim-crypto.c +@@ -222,7 +222,11 @@ + { + assert(pthread_setspecific(id_key, ptr) == 0); + ++#if OPENSSL_VERSION_NUMBER >= 0x10100000 ++ OPENSSL_thread_stop(); ++#else + ERR_remove_state(0); ++#endif + + free(ptr); + +@@ -392,11 +396,15 @@ + { + if (crypto_init_done) + { ++#if OPENSSL_VERSION_NUMBER >= 0x10100000 ++ OPENSSL_thread_stop(); ++#else + CRYPTO_cleanup_all_ex_data(); + CONF_modules_free(); + EVP_cleanup(); + ERR_free_strings(); + ERR_remove_state(0); ++#endif + + if (nmutexes > 0) + { |