Parent: [303321] (diff)

Download this file

recoll.rb    582 lines (537 with data), 18.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
require 'formula'
# Notes:
# - This formula is missing python-libxml2 and python-libxslt deps
# which recoll needs for indexing many formats (e.g. libreoffice,
# openxml). Homebrew does not include these packages.
# So the user needs to install them with pip because I don't understand how
# the "Resource" homebrew thing works.
# Still a bit of work then, but I did not investigate, because the macports
# version was an easier target.
class Recoll < Formula
desc "Desktop search tool"
homepage 'http://www.recoll.org'
url 'http://www.recoll.org/recoll-1.24.4.tar.gz'
sha256 "989c1ecdce36082020c0d404a6223005cd166011f9c9b28ac762af978ef9392c"
depends_on "xapian"
depends_on "qt"
depends_on "antiword"
depends_on "poppler"
depends_on "unrtf"
patch :p0, :DATA
def install
# homebrew has webengine, not webkit and we're not ready for this yet
system "./configure", "--disable-python-module",
"--disable-webkit",
"QMAKE=/usr/local/opt/qt/bin/qmake",
"--prefix=#{prefix}"
system "make", "install"
bin.install "#{buildpath}/qtgui/recoll.app/Contents/MacOS/recoll"
end
test do
system "#{bin}/recollindex", "-h"
end
end
__END__
--- Makefile.in 2018-11-15 19:07:37.000000000 +0100
+++ Makefile.in.new 2018-11-29 17:08:19.000000000 +0100
@@ -720,8 +720,7 @@
# We use -release: the lib is only shared
# between recoll programs from the same release.
# -version-info $(VERSION_INFO)
-librecoll_la_LDFLAGS = -release $(VERSION) \
- -Wl,--no-undefined -Wl,--warn-unresolved-symbols
+librecoll_la_LDFLAGS = -release $(VERSION)
librecoll_la_LIBADD = $(LIBXAPIAN) $(LIBICONV) $(LIBTHREADS)
recollindex_SOURCES = \
diff --git filters/ppt-dump.py filters/ppt-dump.py
index f41a9f39..dc3085a4 100755
--- filters/ppt-dump.py
+++ filters/ppt-dump.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
diff --git filters/rcl7z filters/rcl7z
index c68c8bcb..ac50c4ec 100755
--- filters/rcl7z
+++ filters/rcl7z
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# 7-Zip file filter for Recoll
diff --git filters/rclaudio filters/rclaudio
index 94ca0be7..08d6375a 100755
--- filters/rclaudio
+++ filters/rclaudio
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Audio tag filter for Recoll, using mutagen
diff --git filters/rclchm filters/rclchm
index f9811c37..3bc9b16d 100755
--- filters/rclchm
+++ filters/rclchm
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
"""Extract Html files from a Microsoft Compiled Html Help file (.chm)
Needs at least python 2.2 for HTMLParser (chmlib needs 2.2 too)"""
diff --git filters/rcldia filters/rcldia
index 282148eb..a480294b 100755
--- filters/rcldia
+++ filters/rcldia
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from __future__ import print_function
diff --git filters/rcldjvu.py filters/rcldjvu.py
index c5397195..0be01452 100755
--- filters/rcldjvu.py
+++ filters/rcldjvu.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Copyright (C) 2016 J.F.Dockes
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git filters/rcldoc.py filters/rcldoc.py
index e8fa1831..b92b185d 100755
--- filters/rcldoc.py
+++ filters/rcldoc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
from __future__ import print_function
import rclexecm
diff --git filters/rclepub filters/rclepub
index 8042d7f9..51786af1 100755
--- filters/rclepub
+++ filters/rclepub
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
"""Extract Html content from an EPUB file (.epub)"""
from __future__ import print_function
diff --git filters/rclepub1 filters/rclepub1
index bd44f635..a7ea6c06 100755
--- filters/rclepub1
+++ filters/rclepub1
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
"""Extract Html content from an EPUB file (.chm), concatenating all sections"""
from __future__ import print_function
diff --git filters/rclics filters/rclics
index 0ef04f2d..de177024 100755
--- filters/rclics
+++ filters/rclics
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
from __future__ import print_function
# Read an ICS file, break it into "documents" which are events, todos,
diff --git filters/rclimg.py filters/rclimg.py
index 7eb1da91..4eb6c9b0 100755
--- filters/rclimg.py
+++ filters/rclimg.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Python-based Image Tag extractor for Recoll. This is less thorough
# than the Perl-based rclimg script, but useful if you don't want to
diff --git filters/rclinfo filters/rclinfo
index f353d19e..36cf34e0 100755
--- filters/rclinfo
+++ filters/rclinfo
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Read a file in GNU info format and output its nodes as subdocs,
# interfacing with recoll execm
diff --git filters/rclkar filters/rclkar
index d6570dd5..34b8d2a2 100755
--- filters/rclkar
+++ filters/rclkar
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Read a .kar midi karaoke file and translate to recoll indexable format
# This does not work with Python3 yet because python:midi doesn't
diff --git filters/rcllatinclass.py filters/rcllatinclass.py
index 3f8b8634..e6b0fbee 100755
--- filters/rcllatinclass.py
+++ filters/rcllatinclass.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
"""Try to guess a text's language and character set by checking how it matches lists of
common words. This is not a primary method of detection because it's slow and unreliable, but it
may be a help in discrimating, for exemple, before european languages using relatively close
diff --git filters/rclopxml.py filters/rclopxml.py
index b7f7fe83..4f1803c1 100755
--- filters/rclopxml.py
+++ filters/rclopxml.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Copyright (C) 2015 J.F.Dockes
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git filters/rclpdf.py filters/rclpdf.py
index 1e6852ea..47b09534 100755
--- filters/rclpdf.py
+++ filters/rclpdf.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Copyright (C) 2014 J.F.Dockes
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git filters/rclppt.py filters/rclppt.py
index a4e50265..993bc56c 100755
--- filters/rclppt.py
+++ filters/rclppt.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Recoll PPT text extractor
# Mso-dumper is not compatible with Python3. We use sys.executable to
diff --git filters/rclpython filters/rclpython
index 615455b3..1e411890 100755
--- filters/rclpython
+++ filters/rclpython
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - Python source parser and colorizer
diff --git filters/rclrar filters/rclrar
index 8f723fa5..5f6adfb0 100755
--- filters/rclrar
+++ filters/rclrar
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Rar file filter for Recoll
# Adapted from the Zip archive filter by mroark.
diff --git filters/rclrtf.py filters/rclrtf.py
index e4b56d54..ffd0560e 100755
--- filters/rclrtf.py
+++ filters/rclrtf.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
from __future__ import print_function
import rclexecm
diff --git filters/rclsoff-flat.py filters/rclsoff-flat.py
index 337a5f94..65bfa73a 100755
--- filters/rclsoff-flat.py
+++ filters/rclsoff-flat.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Copyright (C) 2014 J.F.Dockes
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git filters/rclsoff.py filters/rclsoff.py
index 5730d97c..4404a14b 100755
--- filters/rclsoff.py
+++ filters/rclsoff.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Copyright (C) 2014 J.F.Dockes
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git filters/rclsvg.py filters/rclsvg.py
index 8c1b8aea..cee17324 100755
--- filters/rclsvg.py
+++ filters/rclsvg.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Copyright (C) 2014 J.F.Dockes
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git filters/rcltar filters/rcltar
index d8bf100d..ab4b306e 100755
--- filters/rcltar
+++ filters/rcltar
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Tar-file filter for Recoll
# Thanks to Recoll user Martin Ziegler
diff --git filters/rcltext.py filters/rcltext.py
index 77359ff6..be410984 100755
--- filters/rcltext.py
+++ filters/rcltext.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Wrapping a text file. Recoll does it internally in most cases, but
# this is for use by another filter.
diff --git filters/rcltxtlines.py filters/rcltxtlines.py
index 220151fd..b2907364 100755
--- filters/rcltxtlines.py
+++ filters/rcltxtlines.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
"""Index text lines as document (execm handler sample). This exists
to demonstrate the execm interface and is not meant to be useful or
efficient"""
diff --git filters/rcluncomp.py filters/rcluncomp.py
index 32a11c1a..eab3b257 100644
--- filters/rcluncomp.py
+++ filters/rcluncomp.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
from __future__ import print_function
import rclexecm
diff --git filters/rclwar filters/rclwar
index b654f3b3..301e28e9 100755
--- filters/rclwar
+++ filters/rclwar
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# WAR web archive filter for recoll. War file are gzipped tar files
diff --git filters/rclxls.py filters/rclxls.py
index c7b2343a..f8f10f8b 100755
--- filters/rclxls.py
+++ filters/rclxls.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Extractor for Excel files.
# Mso-dumper is not compatible with Python3. We use sys.executable to
diff --git filters/rclxml.py filters/rclxml.py
index 33ae8e3e..507851db 100755
--- filters/rclxml.py
+++ filters/rclxml.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Copyright (C) 2014 J.F.Dockes
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git filters/rclxmp.py filters/rclxmp.py
index 158e1222..602769af 100755
--- filters/rclxmp.py
+++ filters/rclxmp.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Copyright (C) 2016 J.F.Dockes
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git filters/rclzip filters/rclzip
index 35739625..0c597fbd 100755
--- filters/rclzip
+++ filters/rclzip
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Copyright (C) 2014 J.F.Dockes
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git filters/xls-dump.py filters/xls-dump.py
index abffa330..57a8f113 100755
--- filters/xls-dump.py
+++ filters/xls-dump.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
diff --git filters/xlsxmltocsv.py filters/xlsxmltocsv.py
index 0c9a5047..90ab06f2 100755
--- filters/xlsxmltocsv.py
+++ filters/xlsxmltocsv.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python2.7
# Copyright (C) 2015 J.F.Dockes
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git aspell/rclaspell.cpp aspell/rclaspell.cpp-new
index 698832df..4fd8b6b8 100644
--- aspell/rclaspell.cpp
+++ aspell/rclaspell.cpp-new
@@ -71,12 +71,16 @@ static std::mutex o_aapi_mutex;
badnames += #NM + string(" "); \
}
-static const char *aspell_lib_suffixes[] = {
- ".so",
- ".so.15",
- ".so.16"
+static const vector<string> aspell_lib_suffixes {
+#if defined(__APPLE__)
+ ".15.dylib",
+ ".dylib",
+#else
+ ".so",
+ ".so.15",
+ ".so.16",
+#endif
};
-static const unsigned int nlibsuffs = sizeof(aspell_lib_suffixes) / sizeof(char *);
// Stuff that we don't wish to see in the .h (possible sysdeps, etc.)
class AspellData {
@@ -160,16 +164,39 @@ bool Aspell::init(string &reason)
return false;
}
+
+ // Don't know what with Apple and (DY)LD_LIBRARY_PATH. Does not work
+ // So we look in all ../lib in the PATH...
+#if defined(__APPLE__)
+ vector<string> path;
+ const char *pp = getenv("PATH");
+ if (pp) {
+ stringToTokens(pp, path, ":");
+ }
+#endif
+
reason = "Could not open shared library ";
string libbase("libaspell");
string lib;
- for (unsigned int i = 0; i < nlibsuffs; i++) {
- lib = libbase + aspell_lib_suffixes[i];
+ for (const auto& suff : aspell_lib_suffixes) {
+ lib = libbase + suff;
reason += string("[") + lib + "] ";
if ((m_data->m_handle = dlopen(lib.c_str(), RTLD_LAZY)) != 0) {
reason.erase();
goto found;
}
+#if defined(__APPLE__)
+ // Above was the normal lookup: let dlopen search the directories.
+ // Here is for Apple. Also look at all ../lib along the PATH
+ for (const auto& dir : path) {
+ string lib1 = path_canon(dir + "/../lib/" + lib);
+ if ((m_data->m_handle = dlopen(lib1.c_str(), RTLD_LAZY)) != 0) {
+ reason.erase();
+ lib=lib1;
+ goto found;
+ }
+ }
+#endif
}
found:
--- sampleconf/mimeview 2018-11-29 13:33:09.000000000 +0100
+++ sampleconf/mimeview.mac 2018-11-29 16:38:52.000000000 +0100
@@ -2,7 +2,8 @@
## ##########################################
# External viewers, launched by the recoll GUI when you click on a result
-# 'edit' link
+# 'Open' link - MAC version
+# On the MAC, we use "open" for everything...
# Mime types which we should not uncompress if they are found gzipped or
# bzipped because the native viewer knows how to handle. These would be
@@ -16,22 +17,17 @@
# search string
# - For pages of CHM and EPUB documents where we can choose to open the
# parent document instead of a temporary html file.
-# Use xallexcepts- and xallexcepts+ in a user file to add or remove from
-# the default xallexcepts list
-
-xallexcepts = application/pdf application/postscript application/x-dvi \
- text/html|gnuinfo text/html|chm text/html|epub \
- application/x-fsdirectory|parentopen inode/directory|parentopen
-
+#xallexcepts = application/pdf application/postscript application/x-dvi \
+# text/html|gnuinfo text/html|chm text/html|epub
[view]
# Pseudo entry used if the 'use desktop' preference is set in the GUI
-application/x-all = xdg-open %u
+application/x-all = open %f
application/epub+zip = ebook-viewer %f
-# Open the parent epub document for epub parts instead of opening them as
-# html documents. This is almost always what we want.
-text/html|epub = ebook-viewer %F;ignoreipath=1
+# If you want to open the parent epub document for epub parts instead of
+# opening them as html documents:
+#text/html|epub = ebook-viewer %F;ignoreipath=1
application/x-gnote = gnote %f
@@ -146,12 +142,11 @@
application/zip = ark %f
application/x-7z-compressed = ark %f
-application/x-awk = emacsclient --no-wait %f
-application/x-perl = emacsclient --no-wait %f
-text/x-perl = emacsclient --no-wait %f
-application/x-shellscript = emacsclient --no-wait %f
-text/x-shellscript = emacsclient --no-wait %f
-text/x-srt = emacsclient --no-wait %f
+application/x-awk = emacsclient %f
+application/x-perl = emacsclient %f
+text/x-perl = emacsclient %f
+application/x-shellscript = emacsclient %f
+text/x-shellscript = emacsclient %f
# Or firefox -remote "openFile(%u)"
text/html = firefox %u
@@ -163,16 +158,15 @@
application/x-webarchive = konqueror %f
text/x-fictionbook = ebook-viewer %f
-application/x-tex = emacsclient --no-wait %f
-application/xml = emacsclient --no-wait %f
-text/xml = emacsclient --no-wait %f
-text/x-tex = emacsclient --no-wait %f
-text/plain = emacsclient --no-wait %f
-text/x-awk = emacsclient --no-wait %f
-text/x-c = emacsclient --no-wait %f
-text/x-lua = emacsclient --no-wait %f
-text/x-c+ = emacsclient --no-wait %f
-text/x-c++ = emacsclient --no-wait %f
+application/x-tex = emacsclient %f
+application/xml = emacsclient %f
+text/xml = emacsclient %f
+text/x-tex = emacsclient %f
+text/plain = emacsclient %f
+text/x-awk = emacsclient %f
+text/x-c = emacsclient %f
+text/x-c+ = emacsclient %f
+text/x-c++ = emacsclient %f
text/x-csv = libreoffice %f
text/x-html-sidux-man = konqueror %f
text/x-html-aptosid-man = iceweasel %f
@@ -183,22 +177,21 @@
# file at the right place
text/html|chm = kchmviewer --url %i %F
-text/x-ini = emacsclient --no-wait %f
+text/x-ini = emacsclient %f
text/x-man = xterm -u8 -e "groff -T ascii -man %f | more"
text/x-python = idle %f
-text/x-gaim-log = emacsclient --no-wait %f
-text/x-purple-html-log = emacsclient --no-wait %f
-text/x-purple-log = emacsclient --no-wait %f
+text/x-gaim-log = emacsclient %f
+text/x-purple-html-log = emacsclient %f
+text/x-purple-log = emacsclient %f
# The video types will usually be handled by the desktop default, but they
# need entries here to get an "Open" link
-video/3gpp = vlc %f
-video/mp2p = vlc %f
-video/mp2t = vlc %f
-video/mp4 = vlc %f
-video/mpeg = vlc %f
-video/quicktime = vlc %f
-video/x-matroska = vlc %f
-video/x-ms-asf = vlc %f
-video/x-msvideo = vlc %f
-
+video/3gpp = open %f
+video/mp2p = open %f
+video/mp2t = open %f
+video/mp4 = open %f
+video/mpeg = open %f
+video/quicktime = open %f
+video/x-matroska = open %f
+video/x-ms-asf = open %f
+video/x-msvideo = open %f