Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mail/dovecot-fts-xapian: Update version 1.4.1.14
- Fix runtime - Add USE_LDCONFIG PR: 259616 Reported by: bas@area536.com Approved by: otis (maintainer)
- Loading branch information
Showing
5 changed files
with
90 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
TIMESTAMP = 1633297573 | ||
SHA256 (dovecot-fts-xapian-1.4.13.tar.gz) = a25a5ce4a70f1332408cd006ce1f326031eba5cdd3185ad467314a377af08ed4 | ||
SIZE (dovecot-fts-xapian-1.4.13.tar.gz) = 2318781 | ||
TIMESTAMP = 1636548959 | ||
SHA256 (dovecot-fts-xapian-1.4.14.tar.gz) = 1f46f319f5b1c59f6359d1c1a55a7fa0988bfb3c3e8cdacec792961331ddb780 | ||
SIZE (dovecot-fts-xapian-1.4.14.tar.gz) = 2563251 |
30 changes: 30 additions & 0 deletions
30
mail/dovecot-fts-xapian/files/patch-src_fts-backend-xapian-functions.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- src/fts-backend-xapian-functions.cpp.orig 2021-11-10 13:09:44 UTC | ||
+++ src/fts-backend-xapian-functions.cpp | ||
@@ -505,7 +505,17 @@ static long fts_backend_xapian_current_time() | ||
|
||
static long fts_backend_xapian_get_free_memory() // KB | ||
{ | ||
- return long(sysconf(_SC_AVPHYS_PAGES)*sysconf(_SC_PAGE_SIZE) / 1024.0); | ||
+#ifdef __FreeBSD__ | ||
+ uint32_t m; | ||
+ size_t len = sizeof(m); | ||
+ sysctlbyname("vm.stats.vm.v_free_count", &m, &len, NULL, 0); | ||
+ if(fts_xapian_settings.verbose>1) i_info("FTS Xapian: (BSD) Free pages %ld",long(m)); | ||
+ m = m * fts_xapian_settings.pagesize / 1024.0; | ||
+ if(fts_xapian_settings.verbose>1) i_info("FTS Xapian: (BSD) Free memory %ld kB",long(m)); | ||
+ return long(m); | ||
+#else | ||
+ return long(sysconf(_SC_AVPHYS_PAGES) * fts_xapian_settings.pagesize / 1024.0); | ||
+#endif | ||
} | ||
|
||
static bool fts_backend_xapian_test_memory() | ||
@@ -1100,7 +1110,7 @@ bool fts_backend_xapian_index_text(struct xapian_fts_b | ||
|
||
XResultSet * result=fts_backend_xapian_query(dbx,xq,1); | ||
|
||
- Xapian::docid docid; | ||
+ Xapian::docid docid = 0; | ||
Xapian::Document * doc = NULL; | ||
|
||
try |
26 changes: 26 additions & 0 deletions
26
mail/dovecot-fts-xapian/files/patch-src_fts-xapian-plugin.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- src/fts-xapian-plugin.c.orig 2021-11-10 13:11:59 UTC | ||
+++ src/fts-xapian-plugin.c | ||
@@ -30,7 +30,14 @@ static void fts_xapian_mail_user_created(struct mail_u | ||
fuser->set.lowmemory = XAPIAN_MIN_RAM; | ||
fuser->set.partial = XAPIAN_DEFAULT_PARTIAL; | ||
fuser->set.full = XAPIAN_DEFAULT_FULL; | ||
- | ||
+ | ||
+#ifdef __FreeBSD__ | ||
+ size_t len = sizeof(fuser->set.pagesize); | ||
+ sysctlbyname("hw.pagesize", &(fuser->set.pagesize), &len, NULL, 0); | ||
+#else | ||
+ fuser->set.pagesize = sysconf(_SC_PAGE_SIZE); | ||
+#endif | ||
+ | ||
const char * env = mail_user_plugin_getenv(user, "fts_xapian"); | ||
if (env == NULL) | ||
{ | ||
@@ -93,7 +100,6 @@ static void fts_xapian_mail_user_created(struct mail_u | ||
fuser->set.partial = XAPIAN_DEFAULT_PARTIAL; | ||
fuser->set.full = XAPIAN_DEFAULT_FULL; | ||
} | ||
- | ||
|
||
if (fts_mail_user_init(user, FALSE, &error) < 0) i_error("FTS Xapian: %s", error); | ||
|
29 changes: 29 additions & 0 deletions
29
mail/dovecot-fts-xapian/files/patch-src_fts-xapian-plugin.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- src/fts-xapian-plugin.h.orig 2021-11-10 13:06:54 UTC | ||
+++ src/fts-xapian-plugin.h | ||
@@ -15,6 +15,12 @@ | ||
#include "module-context.h" | ||
#include "fts-api-private.h" | ||
|
||
+#ifdef __FreeBSD__ | ||
+#include <sys/types.h> | ||
+#include <sys/sysctl.h> | ||
+#include <vm/vm_param.h> | ||
+#endif | ||
+ | ||
#define XAPIAN_FILE_PREFIX "xapian-indexes" | ||
#define XAPIAN_TERM_SIZELIMIT 245L | ||
#define XAPIAN_COMMIT_ENTRIES 1000000L | ||
@@ -27,9 +33,10 @@ | ||
|
||
struct fts_xapian_settings | ||
{ | ||
- int verbose; | ||
- long lowmemory; | ||
- long partial,full; | ||
+ int verbose; | ||
+ unsigned long pagesize; | ||
+ long lowmemory; | ||
+ long partial,full; | ||
}; | ||
|
||
struct fts_xapian_user { |