aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/qmmp/Makefile
blob: 9e24ed6416a48ba536e795b13dac78d7ec5844b1 (plain) (blame)
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
# $FreeBSD$

PORTNAME=   qmmp
PORTVERSION=    0.7.2
CATEGORIES= multimedia
MASTER_SITES=   http://qmmp.ylsoftware.com/files/ \
        ${MASTER_SITE_GOOGLE_CODE}

MAINTAINER= liangtai.s16@gmail.com
COMMENT=    A Qt4-based multimedia player

LICENSE=    GPLv2

USE_BZIP2=  yes
USES=       cmake:outsource pkgconfig
USE_QT4=    corelib gui network xml \
        qmake_build rcc_build uic_build moc_build linguist_build
USE_LDCONFIG=   yes

OPTIONS_SINGLE_MPLAYER= MPLAYER1 MPLAYER2
OPTIONS_DEFINE= ALSA ANALYZER APIDOC BS2B CDIO CONVERTER COPYPASTE \
        COVER CROSSFADE CUE CURL DIR_ASSOC DOCS ENCA FAAD \
        FFMPEG FILEOPS FLAC GME HAL HOTKEY JACK KDENOTIFY \
        LADSPA LYRICS MAD MMS MODPLUG MPLAYER MPRIS MUSEPACK \
        NOTIFIER NULLOUT OSS OSS4 PROJECTM PULSEAUDIO QMMP_DIALOG \
        SB SCROBBLER SKINNEDUI SNDFILE SRCONV STATICON STEREO \
        TRACKCHANGE UDISKS UDISKS2 VORBIS WAVPACK WILDMIDI
OPTIONS_DEFAULT=    ALSA ANALYZER BS2B CDIO CONVERTER COPYPASTE COVER \
        CROSSFADE CUE CURL DIR_ASSOC ENCA FAAD \
        FFMPEG FILEOPS FLAC GME HAL HOTKEY JACK KDENOTIFY \
        LADSPA LYRICS MAD MMS MODPLUG MPRIS MPLAYER MPLAYER1 MUSEPACK \
        NOTIFIER NULLOUT OSS4 PROJECTM PULSEAUDIO QMMP_DIALOG \
        SB SCROBBLER SKINNEDUI SNDFILE SRCONV STATICON STEREO \
        TRACKCHANGE UDISKS2 VORBIS WAVPACK WILDMIDI
SKINNEDUI_DESC= Skinned GUI
DIR_ASSOC_DESC= inode/directory mime type association
APIDOC_DESC=    Doxygen generated doc (libqmmp libqmmpui)
OSS4_DESC=      Open Sound System (ver4) support
NULLOUT_DESC=   Support a null output
WILDMIDI_DESC=  Support to playback MIDI files
GME_DESC=       Support video game music files
CROSSFADE_DESC= Support cross-fade effect
BS2B_DESC=      Support the Bauer stereophonic2binaural effect
STEREO_DESC=    Support stereo effect
SRCONV_DESC=    Support the sample rate converter
PROJECTM_DESC=  Support the projectM music visualiser
ANALYZER_DESC=  Supoort spectrum analyzer visualization
COPYPASTE_DESC= Enable copy/paste track infos between playlists
ENCA_DESC=      Support automatic character set detection
#OPUS_DESC=     Enable reading opusfile tags
CONVERTER_DESC= Support file type converter
MPRIS_DESC= Support the Media Player Remote
SCROBBLER_DESC= Support Libre.fm/Last.fm scrobbler feature
STATICON_DESC=  Support to show status icon
SB_DESC=    Browser for IceCast stream directory
TRACKCHANGE_DESC=   Enable to run external command each track switching
NOTIFIER_DESC=  Support to popup notifier
LYRICS_DESC=    Support to show lyrics using lyrics.wikia.com
HOTKEY_DESC=    Support to set shortcut keys
FILEOPS_DESC=   Support file operation
COVER_DESC= Support to show cover images
KDENOTIFY_DESC= Support to popup notifier for KDE
UDISKS_DESC=    Support removable disc detection (obsolete)
UDISKS2_DESC=   Support removable disc detection using UDisks
QMMP_DIALOG_DESC=   An original dialog
MPLAYER1_DESC=  mplayer-1.1.x (multimedia/mplayer)
MPLAYER2_DESC=  mplayer-2.0.x (multimedia/mplayer2)

NO_STAGE=   yes
.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MAPIDOC}
BUILD_DEPENDS+= doxygen:${PORTSDIR}/devel/doxygen
.endif

.if ${PORT_OPTIONS:MSKINNEDUI}
PLIST_SUB+= SKINNEDUI=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_SKINNED:BOOL=TRUE
.else
PLIST_SUB+= SKINNEDUI="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_SKINNED:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MDIR_ASSOC}
PLIST_SUB+= DIR_ASSOC=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_DIR_ASSOC:BOOL=TRUE
.else
PLIST_SUB+= DIR_ASSOC="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_DIR_ASSOC:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MJACK}
PLIST_SUB+= JACK=""
LIB_DEPENDS+=   libjack.so:${PORTSDIR}/audio/jack
BUILD_DEPENDS+= jackit>=0.121.2:${PORTSDIR}/audio/jack
PLUGIN_OPTIONS_CMAKE+=  -DUSE_JACK:BOOL=TRUE
.else
PLIST_SUB+= JACK="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_JACK:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MALSA}
PLIST_SUB+= ALSA=""
LIB_DEPENDS+=   libasound.so:${PORTSDIR}/audio/alsa-lib
PLUGIN_OPTIONS_CMAKE+=  -DUSE_ALSA:BOOL=TRUE
.else
PLIST_SUB+= ALSA="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_ALSA:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MBS2B}
PLIST_SUB+= BS2B=""
LIB_DEPENDS+=   libbs2b.so:${PORTSDIR}/audio/libbs2b
PLUGIN_OPTIONS_CMAKE+=  -DUSE_BS2B:BOOL=TRUE
.else
PLIST_SUB+= BS2B="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_BS2B:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MPULSEAUDIO}
PLIST_SUB+= PULSE_AUDIO=""
LIB_DEPENDS+=   libpulse.so:${PORTSDIR}/audio/pulseaudio
PLUGIN_OPTIONS_CMAKE+=  -DUSE_PULSE:BOOL=TRUE
.else
PLIST_SUB+= PULSE_AUDIO="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_PULSE:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MFLAC}
PLIST_SUB+= FLAC=""
LIB_DEPENDS+=   libFLAC.so:${PORTSDIR}/audio/flac
PLUGIN_OPTIONS_CMAKE+=  -DUSE_FLAC:BOOL=TRUE
.else
PLIST_SUB+= FLAC="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_FLAC:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MMUSEPACK}
PLIST_SUB+= MUSEPACK=""
LIB_DEPENDS+=   libmpcdec.so:${PORTSDIR}/audio/musepack
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MPC:BOOL=TRUE
.else
PLIST_SUB+= MUSEPACK="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MPC:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MGME}
PLIST_SUB+= GME=""
LIB_DEPENDS+=   libgme.so:${PORTSDIR}/audio/libgme
PLUGIN_OPTIONS_CMAKE+=  -DUSE_GME:BOOL=TRUE
.else
PLIST_SUB+= GME="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_GME:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MFFMPEG}
LIB_DEPENDS+=   libavcodec.so:${PORTSDIR}/multimedia/ffmpeg
PLIST_SUB+= FFMPEG=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_FFMPEG:BOOL=TRUE
.else
PLIST_SUB+= FFMPEG="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_FFMPEG:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MMODPLUG}
PLIST_SUB+= MODPLUG=""
LIB_DEPENDS+=   libmodplug.so:${PORTSDIR}/audio/libmodplug
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MODPLUG:BOOL=TRUE
.else
PLIST_SUB+= MODPLUG="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MODPLUG:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MFAAD}
PLIST_SUB+= FAAD=""
LIB_DEPENDS+=   libfaad.so:${PORTSDIR}/audio/faad
PLUGIN_OPTIONS_CMAKE+=  -DUSE_AAC:BOOL=TRUE
.else
PLIST_SUB+= FAAD="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_AAC:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MCDIO}
PLIST_SUB+= CDIO=""
LIB_DEPENDS+=   libcdio.so:${PORTSDIR}/sysutils/libcdio
PLUGIN_OPTIONS_CMAKE+=  -DUSE_CDA:BOOL=TRUE
.else
PLIST_SUB+= CDIO="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_CDA:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MENCA} || \
    (exists(${LOCALBASE}/include/enca.h) && ${PORT_OPTIONS:MCUE})
PLIST_SUB+= ENCA=""
LIB_DEPENDS+=   libenca.so:${PORTSDIR}/converters/enca
PLUGIN_OPTIONS_CMAKE+=  -DUSE_ENCA:BOOL=TRUE
.else
PLIST_SUB+= ENCA="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_ENCA:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MMPLAYER}
. if ${PORT_OPTIONS:MMPLAYER2}
RUN_DEPENDS+=   mplayer:${PORTSDIR}/multimedia/mplayer2
. else
RUN_DEPENDS+=   mplayer:${PORTSDIR}/multimedia/mplayer
. endif
PLIST_SUB+= MPLAYER=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MPLAYER:BOOL=TRUE
.else
PLIST_SUB+= MPLAYER="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MPLAYER:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MPROJECTM}
PLIST_SUB+= PROJECTM=""
LIB_DEPENDS+=   libprojectM.so.2:${PORTSDIR}/graphics/libprojectm
USE_QT4+=   opengl
PLUGIN_OPTIONS_CMAKE+=  -DUSE_PROJECTM:BOOL=TRUE
.else
PLIST_SUB+= PROJECTM="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_PROJECTM:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MOSS}
PLIST_SUB+= OSS=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_OSS:BOOL=TRUE
.else
PLIST_SUB+= OSS="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_OSS:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MOSS4}
PLIST_SUB+= OSS4=""
BUILD_DEPENDS+= ${LOCALBASE}/lib/oss/include/sys/soundcard.h:${PORTSDIR}/audio/oss
PLUGIN_OPTIONS_CMAKE+=  -DUSE_OSS4:BOOL=TRUE
.else
PLIST_SUB+= OSS4="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_OSS4:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MLADSPA}
PLIST_SUB+= LADSPA=""
RUN_DEPENDS+=   analyseplugin:${PORTSDIR}/audio/ladspa
PLUGIN_OPTIONS_CMAKE+=  -DUSE_LADSPA:BOOL=TRUE
.else
PLIST_SUB+= LADSPA="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_LADSPA:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MWILDMIDI}
PLIST_SUB+= WILDMIDI=""
LIB_DEPENDS+=   libWildMidi.so:${PORTSDIR}/audio/wildmidi
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MIDI:BOOL=TRUE
.else
PLIST_SUB+= WILDMIDI="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MIDI:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MMAD}
PLIST_SUB+= MAD=""
LIB_DEPENDS+=   libmad.so:${PORTSDIR}/audio/libmad
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MAD:BOOL=TRUE
.else
PLIST_SUB+= MAD="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MAD:BOOL=FALSE
.endif

#.if ${PORT_OPTIONS:MOPUS}
#PLIST_SUB+=    OPUS=""
#LIB_DEPENDS+=  libopusfile.so:${PORTSDIR}/audio/opusfile
#PLUGIN_OPTIONS_CMAKE+= -DUSE_OPUS:BOOL=TRUE
#.else
PLIST_SUB+= OPUS="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_OPUS:BOOL=FALSE
#.endif

.if ${PORT_OPTIONS:MSNDFILE}
PLIST_SUB+= SNDFILE=""
LIB_DEPENDS+=   libsndfile.so:${PORTSDIR}/audio/libsndfile
PLUGIN_OPTIONS_CMAKE+=  -DUSE_SNDFILE:BOOL=TRUE
.else
PLIST_SUB+= SNDFILE="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_SNDFILE:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MVORBIS}
PLIST_SUB+= VORBIS=""
LIB_DEPENDS+=   libvorbis.so:${PORTSDIR}/audio/libvorbis
PLUGIN_OPTIONS_CMAKE+=  -DUSE_VORBIS:BOOL=TRUE
.else
PLIST_SUB+= VORBIS="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_VORBIS:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MWAVPACK}
PLIST_SUB+= WAVPACK=""
LIB_DEPENDS+=   libwavpack.so:${PORTSDIR}/audio/wavpack
PLUGIN_OPTIONS_CMAKE+=  -DUSE_WAVPACK:BOOL=TRUE
.else
PLIST_SUB+= WAVPACK="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_WAVPACK:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MCURL}
PLIST_SUB+= CURL=""
LIB_DEPENDS+=   libcurl.so:${PORTSDIR}/ftp/curl
PLUGIN_OPTIONS_CMAKE+=  -DUSE_CURL:BOOL=TRUE
.else
PLIST_SUB+= CURL="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_CURL:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MMMS}
PLIST_SUB+= MMS=""
LIB_DEPENDS+=   libmms.so:${PORTSDIR}/net/libmms
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MMS:BOOL=TRUE
.else
PLIST_SUB+= MMS="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MMS:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MCUE}
PLIST_SUB+= CUE=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_CUE:BOOL=TRUE
.else
PLIST_SUB+= CUE="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_CUE:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MNULLOUT}
PLIST_SUB+= NULLOUT=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_NULL:BOOL=TRUE
.else
PLIST_SUB+= NULLOUT="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_NULL:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MSRCONV}
PLIST_SUB+= SRCONV=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_SRC:BOOL=TRUE
.else
PLIST_SUB+= SRCONV="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_SRC:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MCROSSFADE}
PLIST_SUB+= CROSSFADE=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_CROSSFADE:BOOL=TRUE
.else
PLIST_SUB+= CROSSFADE="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_CROSSFADE:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MSTEREO}
PLIST_SUB+= STEREO=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_STEREO:BOOL=TRUE
.else
PLIST_SUB+= STEREO="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_STEREO:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MANALYZER}
PLIST_SUB+= ANALYZER=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_ANALYZER:BOOL=TRUE
.else
PLIST_SUB+= ANALYZER="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_ANALYZER:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MCONVERTER}
PLIST_SUB+= CONVERTER=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_CONVERTER:BOOL=TRUE
.else
PLIST_SUB+= CONVERTER="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_CONVERTER:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MCOPYPASTE}
PLIST_SUB+= COPYPASTE=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_COPYPASTE:BOOL=TRUE
.else
PLIST_SUB+= COPYPASTE="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_COPYPASTE:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MMPRIS}
PLIST_SUB+= MPRIS=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MPRIS:BOOL=TRUE
.else
PLIST_SUB+= MPRIS="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_MPRIS:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MSCROBBLER}
PLIST_SUB+= SCROBBLER=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_SCROBBLER:BOOL=TRUE
.else
PLIST_SUB+= SCROBBLER="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_SCROBBLER:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MSTATICON}
PLIST_SUB+= STATICON=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_STATICON:BOOL=TRUE
.else
PLIST_SUB+= STATICON="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_STATICON:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MSB}
PLIST_SUB+= SB=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_SB:BOOL=TRUE
.else
PLIST_SUB+= SB="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_SB:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MNOTIFIER}
PLIST_SUB+= NOTIFIER=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_NOTIFIER:BOOL=TRUE
.else
PLIST_SUB+= NOTIFIER="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_NOTIFIER:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MLYRICS}
PLIST_SUB+= LYRICS=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_LYRICS:BOOL=TRUE
.else
PLIST_SUB+= LYRICS="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_LYRICS:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MHAL}
PLIST_SUB+= HAL=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_HAL:BOOL=TRUE
.else
PLIST_SUB+= HAL="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_HAL:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MHOTKEY}
PLIST_SUB+= HOTKEY=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_HOTKEY:BOOL=TRUE
.else
PLIST_SUB+= HOTKEY="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_HOTKEY:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MFILEOPS}
PLIST_SUB+= FILEOPS=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_FILEOPS:BOOL=TRUE
.else
PLIST_SUB+= FILEOPS="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_FILEOPS:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MCOVER}
PLIST_SUB+= COVER=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_COVER:BOOL=TRUE
.else
PLIST_SUB+= COVER="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_COVER:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MKDENOTIFY}
PLIST_SUB+= KDENOTIFY=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_KDENOTIFY:BOOL=TRUE
.else
PLIST_SUB+= KDENOTIFY="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_KDENOTIFY:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MTRACKCHANGE}
PLIST_SUB+= TRACKCHANGE=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_TRACKCHANGE:BOOL=TRUE
.else
PLIST_SUB+= TRACKCHANGE="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_TRACKCHANGE:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MUDISKS}
PLIST_SUB+= UDISKS=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_UDISKS:BOOL=TRUE
.else
PLIST_SUB+= UDISKS="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_UDISKS:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MUDISKS2}
PLIST_SUB+= UDISKS2=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_UDISKS2:BOOL=TRUE
.else
PLIST_SUB+= UDISKS2="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_UDISKS2:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MQMMP_DIALOG}
PLIST_SUB+= QMMP_DIALOG=""
PLUGIN_OPTIONS_CMAKE+=  -DUSE_QMMP_DIALOG:BOOL=TRUE
.else
PLIST_SUB+= QMMP_DIALOG="@comment "
PLUGIN_OPTIONS_CMAKE+=  -DUSE_QMMP_DIALOG:BOOL=FALSE
.endif

.if ${PORT_OPTIONS:MFAAD} || ${PORT_OPTIONS:MMAD} \
    || ${PORT_OPTIONS:MMUSEPACK} || ${PORT_OPTIONS:MFLAC} \
    || ${PORT_OPTIONS:MVORBIS} || ${PORT_OPTIONS:MCONVERTER}
LIB_DEPENDS+=   libtag.so:${PORTSDIR}/audio/taglib
.endif
.if ${PORT_OPTIONS:MKDENOTIFY} \
    || ${PORT_OPTIONS:MUDISKS} || ${PORT_OPTIONS:MUDISKS2} \
    || ${PORT_OPTIONS:MHAL}  || ${PORT_OPTIONS:MMPRIS}
USE_QT4+=   dbus
.endif

PLIST_SUB+= SHLIB_VER=${PORTVERSION:C/-.*//}

PORTDOCS=   README README.RUS AUTHORS
INSTALLS_ICONS= yes

CMAKE_ARGS+=    ${PLUGIN_OPTIONS_CMAKE} -DUSE_RPATH:BOOL=TRUE \
    -DCMAKE_REQUIRED_INCLUDES:PATH=${LOCALBASE}/include
CFLAGS+=    -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib

post-patch:
    @${REINPLACE_CMD} -e 's|/usr/local/|${LOCALBASE}/|' \
        ${WRKSRC}/src/plugins/Output/oss4/CMakeLists.txt
    @${REINPLACE_CMD} -e '/pkgconfig/s|$${LIB_DIR}|libdata|' \
        ${WRKSRC}/src/qmmp/CMakeLists.txt \
        ${WRKSRC}/src/qmmpui/CMakeLists.txt

pre-configure:
    ${RM} -f ${BUILD_WRKSRC}/CMakeCache.txt

post-build:
.if ${PORT_OPTIONS:MAPIDOC}
    cd ${WRKSRC}/doc && doxygen Doxyfile
.endif

post-install:
    @${MKDIR} ${STAGEDIR}/${DOCSDIR}
    cd ${WRKSRC} && ${INSTALL_MAN} ${PORTDOCS} ${STAGEDIR}/${DOCSDIR}
.if ${PORT_OPTIONS:MAPIDOC}
    @${MKDIR} ${STAGEDIR}/${DOCSDIR}/html/search ; \
    cd ${WRKSRC}/doc/html && \
        ${INSTALL_MAN} *.html *.png *.css ${STAGEDIR}/${DOCSDIR}/html ; \
    cd ${WRKSRC}/doc/html/search && \
        ${INSTALL_MAN} *.html *.png *.css *.js ${STAGEDIR}/${DOCSDIR}/html/search ; \
    ${RM} -f ${WRKDIR}/PLIST.doc ; \
    ${FIND} ${STAGEDIR}/${DOCSDIR}/html -type f | \
        ${SED} 's|${STAGEDIR}/${PREFIX}/||' \
        >> ${WRKDIR}/PLIST.doc ; \
    ${FIND} ${STAGEDIR}/${DOCSDIR}/html -type d | \
        ${SED} 's|${STAGEDIR}/${PREFIX}/|@dirrm |' \
        | ${SORT} -r >> ${WRKDIR}/PLIST.doc ; \
    cd ${WRKDIR} ; ${SED} -i -e '/PLIST.doc/ r PLIST.doc' ${TMPPLIST}
.endif

.include <bsd.port.mk>