Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dovecot for aarch64-darwin #270754

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions pkgs/development/libraries/clucene-core/2.x.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{lib, stdenv, fetchurl, cmake, boost, zlib}:
{lib, stdenv, fetchurl, fetchpatch, cmake, boost, zlib}:

stdenv.mkDerivation rec {
pname = "clucene-core";
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions pkgs/servers/mail/dovecot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
fpletz marked this conversation as resolved.
Show resolved Hide resolved
];

configureFlags = [
Expand Down
15 changes: 15 additions & 0 deletions pkgs/servers/mail/dovecot/timespec.patch
Original file line number Diff line number Diff line change
@@ -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
4 changes: 1 addition & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down