From ac7c745539126117900493a382d702931c44a94d Mon Sep 17 00:00:00 2001 From: Doro Rose Date: Tue, 28 Nov 2023 10:21:33 +0100 Subject: [PATCH 1/2] dovecot: fix build on aarch64-darwin --- pkgs/servers/mail/dovecot/default.nix | 3 +++ pkgs/servers/mail/dovecot/timespec.patch | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/servers/mail/dovecot/timespec.patch diff --git a/pkgs/servers/mail/dovecot/default.nix b/pkgs/servers/mail/dovecot/default.nix index 133411ffc737..04c1f7031bba 100644 --- a/pkgs/servers/mail/dovecot/default.nix +++ b/pkgs/servers/mail/dovecot/default.nix @@ -66,6 +66,9 @@ stdenv.mkDerivation rec { url = "https://salsa.debian.org/debian/dovecot/-/raw/debian/1%252.3.19.1+dfsg1-2/debian/patches/Support-openssl-3.0.patch"; hash = "sha256-PbBB1jIY3jIC8Js1NY93zkV0gISGUq7Nc67Ul5tN7sw="; }) + ] ++ lib.optionals stdenv.isDarwin [ + # fix timespec calls + ./timespec.patch ]; configureFlags = [ diff --git a/pkgs/servers/mail/dovecot/timespec.patch b/pkgs/servers/mail/dovecot/timespec.patch new file mode 100644 index 000000000000..50290a5a57de --- /dev/null +++ b/pkgs/servers/mail/dovecot/timespec.patch @@ -0,0 +1,15 @@ +diff --git a/src/lib-storage/index/dbox-common/dbox-storage.h b/src/lib-storage/index/dbox-common/dbox-storage.h +index 8e8aaa1..a3018a4 100644 +--- a/src/lib-storage/index/dbox-common/dbox-storage.h ++++ b/src/lib-storage/index/dbox-common/dbox-storage.h +@@ -86,4 +86,10 @@ int dbox_verify_alt_storage(struct mailbox_list *list); + bool dbox_header_have_flag(struct mailbox *box, uint32_t ext_id, + unsigned int flags_offset, uint8_t flag); + ++#if defined(__APPLE__) || defined(__NetBSD__) ++#define st_atim st_atimespec ++#define st_ctim st_ctimespec ++#define st_mtim st_mtimespec ++#endif ++ + #endif From fa2b3d0563b2052a152bf3525e566c5dfdc96980 Mon Sep 17 00:00:00 2001 From: Doro Rose Date: Tue, 28 Nov 2023 10:23:18 +0100 Subject: [PATCH 2/2] clucene-core: fix build on aarch64-darwin --- pkgs/development/libraries/clucene-core/2.x.nix | 17 +++++++++++++++-- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/clucene-core/2.x.nix b/pkgs/development/libraries/clucene-core/2.x.nix index 18d055a387ac..d6049d284513 100644 --- a/pkgs/development/libraries/clucene-core/2.x.nix +++ b/pkgs/development/libraries/clucene-core/2.x.nix @@ -1,4 +1,4 @@ -{lib, stdenv, fetchurl, cmake, boost, zlib}: +{lib, stdenv, fetchurl, fetchpatch, cmake, boost, zlib}: stdenv.mkDerivation rec { pname = "clucene-core"; @@ -40,8 +40,21 @@ stdenv.mkDerivation rec { # required for darwin and linux-musl ./pthread-include.patch + ] ++ lib.optionals stdenv.isDarwin [ + ./fix-darwin.patch - ] ++ lib.optionals stdenv.isDarwin [ ./fix-darwin.patch ]; + # see https://bugs.gentoo.org/869170 + (fetchpatch { + url = "https://869170.bugs.gentoo.org/attachment.cgi?id=858825"; + hash = "sha256-TbAfBKdXh+1HepZc8J6OhK1XGwhwBCMvO8QBDsad998="; + }) + ]; + + # see https://github.com/macports/macports-ports/commit/236d43f2450c6be52dc42fd3a2bbabbaa5136201 + postPatch = lib.optionalString stdenv.isDarwin '' + substituteInPlace src/shared/CMakeLists.txt --replace 'fstati64;_fstati64;fstat64;fstat;_fstat' 'fstat;_fstat' + substituteInPlace src/shared/CMakeLists.txt --replace 'stati64;_stati64;stat64;stat;_stat' 'stat;_stat' + ''; # fails with "Unable to find executable: # /build/clucene-core-2.3.3.4/build/bin/cl_test" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f3e63715b7d0..bd15d3b3238b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20848,9 +20848,7 @@ with pkgs; cln = callPackage ../development/libraries/cln { }; - clucene_core_2 = callPackage ../development/libraries/clucene-core/2.x.nix { - stdenv = if stdenv.cc.isClang then llvmPackages_6.stdenv else stdenv; - }; + clucene_core_2 = callPackage ../development/libraries/clucene-core/2.x.nix { }; clucene_core_1 = callPackage ../development/libraries/clucene-core { stdenv = if stdenv.cc.isClang then llvmPackages_6.stdenv else stdenv;