-
Notifications
You must be signed in to change notification settings - Fork 0
/
Configfile
514 lines (446 loc) · 14.8 KB
/
Configfile
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
##############################################################################
# Global Build Options #
##############################################################################
# I'm going to mandate c++11 support for this code because it makes
# life a whole bunch easier for me to develop with.
LANGUAGES += c++
COMPILEOPTS += -Wall
COMPILEOPTS += -Werror
COMPILEOPTS += -Wextra
COMPILEOPTS += -std=c++17
COMPILEOPTS += -pedantic
# One of the downsides of C++ is that it appears to define a public
# interface for libraries. This header compiler simply copies headers
# over.
LANGUAGES += h
# Some commands are actually just scripts.
LANGUAGES += bash
# The best way I've found for building internal C++ library
# dependencies is to just let everything staticly link.
LANGUAGES += c++
COMPILEOPTS += -Isrc
# Add git's version number to the pkg-config files
LANGUAGES += pkgconfig
LINKOPTS += -Sobj/proc/version-pc.sed
# This is my global library list. I'm putting pretty much everything
# here because there's a bunch of binaries below and I don't want to
# add every external dependency to every binary.
LANGUAGES += c++
COMPILEOPTS += `ppkg-config gnutls --cflags`
LINKOPTS += `ppkg-config gnutls --libs`
LINKOPTS += -lgnutlsxx
COMPILEOPTS += `ppkg-config libputil-chrono --cflags`
LINKOPTS += `ppkg-config libputil-chrono --libs`
COMPILEOPTS += `ppkg-config uuid --optional --have UUID --cflags`
LINKOPTS += `ppkg-config uuid --optional --have UUID --libs`
COMPILEOPTS += `ppkg-config ncurses --cflags`
LINKOPTS += `ppkg-config ncurses --libs`
COMPILEOPTS += `ppkg-config psqlite --cflags`
LINKOPTS += `ppkg-config psqlite --libs`
COMPILEOPTS += `ppkg-config libnotify --optional --have LIBNOTIFY --cflags`
LINKOPTS += `ppkg-config libnotify --optional --have LIBNOTIFY --libs`
COMPILEOPTS += `ppkg-config libbase64-1 --cflags`
LINKOPTS += `ppkg-config libbase64-1 --libs`
COMPILEOPTS += `ppkg-config libcurl --cflags`
LINKOPTS += `ppkg-config libcurl --libs`
COMPILEOPTS += `ppkg-config libuv --cflags`
LINKOPTS += `ppkg-config libuv --libs`
COMPILEOPTS += `ppkg-config pson --cflags`
LINKOPTS += `ppkg-config pson --libs`
COMPILEOPTS += -pthread
LINKOPTS += -pthread
# Try to match this with git's version number
GENERATE += version.h
GENERATE += version-pc.sed
# OSX doesn't build this because of missing pkg-config files, so just
# force it to build here.
CONFIG += fixme_osx
##############################################################################
# Libraries #
##############################################################################
# The MHNG IMAP client library, which is split out in the hope that it
# can be used by other applications.
LIBRARIES += libmhimap.so
CONFIG += libmhimap_sources
CONFIG += libmhimap_headers
LIBRARIES += pkgconfig/mhimap.pc
SOURCES += libmhimap/mhimap.pc
# The MHNG OAUTH client library, which is also hopefully usable by other
# applications.
LIBRARIES += libmhoauth.so
CONFIG += libmhoauth_sources
CONFIG += libmhoauth_headers
LIBRARIES += pkgconfig/mhoauth.pc
SOURCES += libmhoauth/mhoauth.pc
# The MHNG library, which handles messing around within MH folders on
# disk.
LIBRARIES += libmhng.so
CONFIG += libmhng_sources
CONFIG += libmhng_headers
LIBRARIES += pkgconfig/mhng.pc
SOURCES += libmhng/mhng.pc
##############################################################################
# Local-Access Binaries #
##############################################################################
# Lists the messages in the given folder, defaulting to the currently
# selected folder.
BINARIES += mhng-scan
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-scan.c++
COMPILEOPTS += -DSCAN_PRETTY
TESTSRC += utf.bash
# Writes some (or by default, many) messages out to SMTP and then
# removes them.
BINARIES += mhng-post
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-post.c++
TESTSRC += post-2-all.bash
TESTSRC += post-2-only.bash
# Removes the current message.
BINARIES += mhng-rmm
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-rmm.c++
# Shows the current message (or a passed in message), optionally
# moving to the next/previous message in the list.
BINARIES += mhng-show
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-show.c++
COMPILEOPTS += -DSHOW
TESTSRC += utf8-in-ascii.bash
TESTSRC += email-with-plus.bash
TESTSRC += law-repl.bash
TESTSRC += break-single-line.bash
TESTSRC += linus-address.bash
TESTSRC += cilk-plus.bash
TESTSRC += email-upper.bash
BINARIES += mhng-next
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-show.c++
COMPILEOPTS += -DNEXT
TESTSRC += nocur.bash
BINARIES += mhng-prev
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-show.c++
COMPILEOPTS += -DPREV
BINARIES += mhng-body
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-show.c++
COMPILEOPTS += -DBODY
# This one is really just a mhng-rmm && mhng-{next,prev}, but it's all
# put in a single binary for ease of use.
BINARIES += mhng-mtn
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-show.c++
COMPILEOPTS += -DNEXT
COMPILEOPTS += -DRMM
TESTSRC += two-messages.bash
BINARIES += mhng-mtp
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-show.c++
COMPILEOPTS += -DPREV
COMPILEOPTS += -DRMM
# Lists the MIME parts of a given message and allows printing them
BINARIES += mhng-mime
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-mime.c++
COMPILEOPTS += -DMIME
TESTSRC += nine_parts.bash
TESTSRC += ten_parts.bash
# Lists the MIME parts of a given message and allows saving them
BINARIES += mhng-detach
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-mime.c++
COMPILEOPTS += -DDETACH
TESTSRC += attachment_7bit.bash
TESTSRC += attachment_base64.bash
TESTSRC += attachment_base64_newline.bash
TESTSRC += attachment_base64_nonewline.bash
# Lists every folder known to the system
BINARIES += mhng-folders
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-folders.c++
# Lists all the URLs found in a message
BINARIES += mhng-urls
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-urls.c++
# An installation helper script
BINARIES += mhng-install
SOURCES += mhng-install.bash
# Re-packs messages into folders. This modifies the sequence numbers
# such that the messages all stay in order but no longer have any
# gaps.
BINARIES += mhng-pack
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pack.c++
# Allows me to compose a message, with a set of different default
# templates: blank, a reply, or a forward.
BINARIES += mhng-comp
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-comp.c++
COMPILEOPTS += -DCOMP
TESTSRC += two-cc.bash
TESTSRC += multi-cc.bash
TESTSRC += multi-to.bash
TESTSRC += linux-cc.bash
TESTSRC += eating_date.bash
TESTSRC += format_flowed.bash
TESTSRC += format_flowed_nowrap.bash
TESTSRC += name-lookup.bash
TESTSRC += linux-reorg.bash
TESTSRC += bcc.bash
TESTSRC += name-lookup-2.bash
BINARIES += mhng-repl
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-comp.c++
COMPILEOPTS += -DREPL
BINARIES += mhng-forw
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-comp.c++
COMPILEOPTS += -DFORW
# Forces a sync right now, and blocks until everything has fully
# synced.
BINARIES += mhng-sync
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-sync.c++
# Shows a _tiny_ HUD for your BASH prompt
BINARIES += mhng-bud
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-bud.c++
# Displays new message notifications in a libnotify window
BINARIES += mhng-notify
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-notify.c++
# Shows a report on the fullness of my inbox
BINARIES += mhng-hfipip
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-hfipip.c++
TESTSRC += outside-inbox.bash
# Displays a real-time HUD
BINARIES += mhng-hud
SOURCES += mhng-hud.bash
# A helper script to launch the deamons that should be running during a GUI
# session.
BINARIES += mhng-launch-gui-daemons
SOURCES += mhng-launch-gui-daemons.bash
##############################################################################
# Remote-Access Binaries #
##############################################################################
LIBEXECS += mhng/mhimap-fetch
AUTODEPS = false
DEPLIBS += mhng
DEPLIBS += mhimap
SOURCES += mhimap-fetch.c++
COMPILEOPTS += -DFETCH
LIBEXECS += mhng/mhimap-purge
AUTODEPS = false
DEPLIBS += mhng
DEPLIBS += mhimap
SOURCES += mhimap-fetch.c++
COMPILEOPTS += -DPURGE
LIBEXECS += mhng/mhimap-drop
AUTODEPS = false
DEPLIBS += mhng
DEPLIBS += mhimap
SOURCES += mhimap-fetch.c++
COMPILEOPTS += -DDROP
LIBEXECS += mhng/mhimap-flags
AUTODEPS = false
DEPLIBS += mhng
DEPLIBS += mhimap
SOURCES += mhimap-fetch.c++
COMPILEOPTS += -DFLAGS
LIBEXECS += mhng/mhimap-sync
AUTODEPS = false
DEPLIBS += mhng
DEPLIBS += mhimap
SOURCES += mhimap-fetch.c++
COMPILEOPTS += -DFETCH
COMPILEOPTS += -DPURGE
COMPILEOPTS += -DDROP
COMPILEOPTS += -DFLAGS
LIBEXECS += mhng/mhimap-idle
AUTODEPS = false
DEPLIBS += mhng
DEPLIBS += mhimap
SOURCES += mhimap-idle.c++
# OAUTH2-related activities
LIBEXECS += mhng/mhoauth-refresh
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhoauth-refresh.c++
BINARIES += mhng-add-account-oauth2
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-add-account.c++
COMPILEOPTS += -DOAUTH2
BINARIES += mhng-add-account-userpass
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-add-account.c++
COMPILEOPTS += -DUSERPASS
BINARIES += mhng-redo-login
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-redo-login.c++
# This allows local connection to kick off remote connections
BINARIES += mhng-daemon
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-daemon.c++
##############################################################################
# Scripting Binaries #
##############################################################################
# Lists all the folder names on stdout
BINARIES += mhng-pipe-folder_names
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-folder_names.c++
# Lists all the sequence numbers on stdout
BINARIES += mhng-pipe-sequence_numbers
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-sequence_numbers.c++
# Takes a single message as stdin and places it into the drafts
# folder.
BINARIES += mhng-pipe-comp_stdin
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-comp_stdin.c++
COMPILEOPTS += -DFOLDER=\"drafts\"
TESTSRC += attachment_base64.bash
TESTSRC += eating_date.bash
# Takes a single message as stdin and places it into the inbox.
BINARIES += mhng-pipe-fetch_stdin
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-comp_stdin.c++
COMPILEOPTS += -DFOLDER=\"inbox\"
# Produces the raw contents of the given set of messages on stdout.
# This is pretty similar to "mhng-show", but it has two important
# differences: it doesn't change anything about the mailbox
# (importantly the current message pointer or any status bits), and it
# doesn't attempt to do any formatting at all.
BINARIES += mhng-pipe-show_stdout
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-show_stdout.c++
# Sends a network up/down message to the server
BINARIES += mhng-pipe-network_up
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-network_up.c++
COMPILEOPTS += -DUP
BINARIES += mhng-pipe-network_down
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-network_up.c++
COMPILEOPTS += -DDOWN
# Shows the headers for the given message set
BINARIES += mhng-pipe-headers
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-headers.c++
COMPILEOPTS += -DHEADERS
BINARIES += mhng-pipe-header
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-headers.c++
COMPILEOPTS += -DHEADER
BINARIES += mhng-pipe-from
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-headers.c++
COMPILEOPTS += -DFROM
# Looks up an address in the current mailrc
BINARIES += mhng-pipe-lookup_address
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-lookup_address.c++
# Finds all the messages in this folder that have the given header value.
BINARIES += mhng-pipe-find_with_header
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-find_with_header.c++
# Prints the sequence number of every message in the current thread.
BINARIES += mhng-pipe-show_seq_for_thread
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-show_seq_for_thread.c++
# Like "scan" but more suitable for parsing with a script
BINARIES += mhng-pipe-scan
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-scan.c++
COMPILEOPTS += -DPIPE_SCAN
# Like "scan" but avoids changing state
BINARIES += mhng-pipe-scan_pretty
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-scan.c++
COMPILEOPTS += -DPIPE_SCAN
COMPILEOPTS += -DSCAN_PRETTY
# Like "mhng-notify", but just prints out the UID of each message as it goes so
# scripts can then consume that stream.
BINARIES += mhng-pipe-watch
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-watch.c++
# Displays every message in every folder.
BINARIES += mhng-pipe-hud_one
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-hud_one.c++
# Exactly the same as show, but it doesn't modify the current context
BINARIES += mhng-pipe-show_pretty
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-show.c++
COMPILEOPTS += -DSHOW
COMPILEOPTS += -DPIPE
# Prints the IMAP account name for the given messages
BINARIES += mhng-pipe-imap_account_name
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-pipe-imap_account_name.c++
# Prints out OAUTH2 tokens in a few formats.
BINARIES += mhoauth-pipe-bearer
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhoauth-pipe-bearer.c++
# Refreshes a single OAUTH2 token, in batch mode.
LIBEXECS += mhng/mhoauth-refresh_loop
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhoauth-refresh_loop.c++
# Prints out passwords.
BINARIES += mhimap-pipe-plain
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhimap-pipe-plain.c++
# Prints URLs, but doesn't change state.
BINARIES += mhng-pipe-urls
AUTODEPS = false
DEPLIBS += mhng
SOURCES += mhng-urls.c++
COMPILEOPTS += -DPIPE