Update audio/soundkonverter to use new options macros and to always build plugins.

The plugins are disabled at run-time if the required programs are not available, so
always including them:
 a) does not result in a broken port
 b) provides greater flexability to the user (if the ports are installed later)
 c) increases the build time, although it is a small port in any case.

The above two changes reduces the Makefile line count by 160.

Approved by:	eadler,bdrewery (mentors, implicit)
This commit is contained in:
David Naylor 2013-06-17 13:04:08 +00:00
parent 49a4b5f74d
commit d50f08da73
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=321105
2 changed files with 131 additions and 291 deletions

View file

@ -23,250 +23,90 @@ INSTALLS_ICONS= yes
MAKE_JOBS_SAFE= yes
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
OPTIONS_DEFAULT= VORBISTOOLS FLAC NORMALIZE VORBISGAIN
OPTIONS_DEFINE= NLS
OPTIONS_MULTI= CODEC FILTER REPLAYGAIN
OPTIONS_MULTI_CODEC= AFTEN FAAC FFMPEG FLAC FLAKE FLUIDSYNTH LAME MAC MPLAYER \
MUSEPACK NEROAAC OPUSTOOLS SHORTEN SPEEX TIMIDITY TTA \
TWOLAME VORBIS WAVPACK
OPTIONS_MULTI_CODEC= AFTEN FAAC FFMPEG FLAC FLAKE FLUIDSYNTH LAME MAC \
MPLAYER MUSEPACK NEROAAC OPUSTOOLS SHORTEN SPEEX \
TIMIDITY TTA TWOLAME VORBIS WAVPACK #LIBAV
OPTIONS_MULTI_FILTER= NORMALIZE SOX
OPTIONS_MULTI_REPLAYGAIN= AACGAIN FLAC MP3GAIN MUSEPACK NORMALIZE \
VORBISGAIN WAVPACK
OPTIONS_DEFAULT= VORBISTOOLS FLAC NORMALIZE VORBISGAIN
CODEC_DESC= Audio codec formats
FILTER_DESC= Audio filter tools
VORBISGAIN WAVPACK
OPTIONS_SUB= yes
CODEC_DESC= Audio codec formats
FILTER_DESC= Audio filter tools
REPLAYGAIN_DESC= Replaygain tools for codecs
AFTEN_DESC= ATSC A/52 audio encoder
AACGAIN_DESC= AAC audio replaygain
FLAKE_DESC= FLAC audio codec
AFTEN_DESC= ATSC A/52 audio encoder
AFTEN_RUN_DEPENDS= aften:${PORTSDIR}/audio/aften
AACGAIN_DESC= AAC audio replaygain
AACGAIN_RUN_DEPENDS= aacgain:${PORTSDIR}/audio/aacgain
FAAC_RUN_DEPENDS= faac:${PORTSDIR}/audio/faac \
faad:${PORTSDIR}/audio/faad
FFMPEG_RUN_DEPENDS= ffmpeg:${PORTSDIR}/multimedia/ffmpeg
FLAC_RUN_DEPENDS= flac:${PORTSDIR}/audio/flac
FLAKE_DESC= FLAC audio codec
FLAKE_RUN_DEPENDS= flake:${PORTSDIR}/audio/flake
FLUIDSYNTH_DESC= SoundFont 2 audio codec
MAC_DESC= Monkey's Audio lossless codec
MP3GAIN_DESC= MP3 audio replaygain
NEROAAC_DESC= Nero AAC MPEG-3 and 3GPP audio codec
NORMALIZE_DESC= MP3/Ogg Vorbis audio filter and replaygain
OPUSTOOLS_DESC= Opus audio codec
SHORTEN_DESC= Shorten (lossless) audio codec
SOX_DESC= Universal sound sample translator
TIMIDITY_DESC= MIDI audio decoder
TTA_DESC= True Audio lossless audio codec
# TWOLAME_DESC
FLUIDSYNTH_RUN_DEPENDS= fluidsynth:${PORTSDIR}/audio/fluidsynth
LAME_RUN_DEPENDS= lame:${PORTSDIR}/audio/lame
.if defined(NOT_IMPLEMENTED)
LIBAV_DESCR= LibAV support (WMA, AIFF, AC3, APE...)
LIBAV_RUN_DEPENDS= avconv:${PORTSDIR}/audio/libav
.endif
MAC_DESC= Monkey's Audio lossless codec
MAC_RUN_DEPENDS= mac:${PORTSDIR}/audio/mac
MP3GAIN_DESC= MP3 audio replaygain
MP3GAIN_RUN_DEPENDS= mp3gain:${PORTSDIR}/audio/mp3gain
MPLAYER_RUN_DEPENDS= mplayer:${PORTSDIR}/multimedia/mplayer
MUSEPACK_RUN_DEPENDS= mpcenc:${PORTSDIR}/audio/musepack
NEROAAC_DESC= Nero AAC MPEG-3 and 3GPP audio codec
NEROAAC_RUN_DEPENDS= neroAacEnc:${PORTSDIR}/audio/linux-neroaaccodec
NORMALIZE_DESC= MP3/Ogg Vorbis audio filter and replaygain
NORMALIZE_RUN_DEPENDS= normalize:${PORTSDIR}/audio/normalize
OPUSTOOLS_DESC= Opus audio codec
OPUSTOOLS_RUN_DEPENDS= opusenc:${PORTSDIR}/audio/opus-tools
SHORTEN_DESC= Shorten (lossless) audio codec
SHORTEN_RUN_DEPENDS= shorten:${PORTSDIR}/audio/shorten
SOX_DESC= Universal sound sample translator
SOX_RUN_DEPENDS= sox:${PORTSDIR}/audio/sox
SPEEX_RUN_DEPENDS= speexenc:${PORTSDIR}/audio/speex
TIMIDITY_DESC= MIDI audio decoder
TIMIDITY_RUN_DEPENDS= timidity:${PORTSDIR}/audio/timidity
TTA_DESC= True Audio lossless audio codec
TTA_RUN_DEPENDS= ttaenv:${PORTSDIR}/audio/tta
TWOLAME_RUN_DEPENDS= twolame:${PORTSDIR}/audio/twolame
VORBISGAIN_DESC= Ogg Vorbis audio replaygain
VORBISGAIN_RUN_DEPENDS= vorbisgain:${PORTSDIR}/audio/vorbisgain
.include <bsd.port.options.mk>
VORBIS_RUN_DEPENDS= oggenc:${PORTSDIR}/audio/vorbis-tools
.if ${PORT_OPTIONS:MAFTEN}
RUN_DEPENDS+= aften:${PORTSDIR}/audio/aften
PLIST_SUB+= AFTEN=""
.else
SK_CMAKE_RM+= codec_aften
PLIST_SUB+= AFTEN="@comment "
.endif
WAVPACK_RUN_DEPENDS= wavpack:${PORTSDIR}/audio/wavpack
.if ${PORT_OPTIONS:MAACGAIN}
RUN_DEPENDS+= aacgain:${PORTSDIR}/audio/aacgain
PLIST_SUB+= AACGAIN=""
.else
SK_CMAKE_RM+= replaygain_aacgain
PLIST_SUB+= AACGAIN="@comment "
.endif
.if ${PORT_OPTIONS:MFAAC}
RUN_DEPENDS+= faac:${PORTSDIR}/audio/faac \
faad:${PORTSDIR}/audio/faad
PLIST_SUB+= FAAC=""
.else
SK_CMAKE_RM+= codec_faac
PLIST_SUB+= FAAC="@comment "
.endif
.if ${PORT_OPTIONS:MFFMPEG}
RUN_DEPENDS+= ffmpeg:${PORTSDIR}/multimedia/ffmpeg
PLIST_SUB+= FFMPEG=""
.else
SK_CMAKE_RM+= codec_ffmpeg
PLIST_SUB+= FFMPEG="@comment "
.endif
.if ${PORT_OPTIONS:MFLAC}
RUN_DEPENDS+= flac:${PORTSDIR}/audio/flac
PLIST_SUB+= FLAC=""
.else
SK_CMAKE_RM+= codec_flac replaygain_metaflac
PLIST_SUB+= FLAC="@comment "
.endif
.if ${PORT_OPTIONS:MFLAKE}
RUN_DEPENDS+= flake:${PORTSDIR}/audio/flake
PLIST_SUB+= FLAKE=""
.else
SK_CMAKE_RM+= codec_flake
PLIST_SUB+= FLAKE="@comment "
.endif
.if ${PORT_OPTIONS:MFLUIDSYNTH}
RUN_DEPENDS+= fluidsynth:${PORTSDIR}/audio/fluidsynth
PLIST_SUB+= FLUIDSYNTH=""
.else
SK_CMAKE_RM+= codec_fluidsynth
PLIST_SUB+= FLUIDSYNTH="@comment "
.endif
.if ${PORT_OPTIONS:MLAME}
RUN_DEPENDS+= lame:${PORTSDIR}/audio/lame
PLIST_SUB+= LAME=""
.else
SK_CMAKE_RM+= codec_lame
PLIST_SUB+= LAME="@comment "
.endif
.if ${PORT_OPTIONS:MLIBAV} && defined(NOT_IMPLEMENTED)
RUN_DEPENDS+= avconv:${PORTSDIR}/audio/libav
PLIST_SUB+= LIBAV=""
.else
SK_CMAKE_RM+= codec_libav
PLIST_SUB+= LIBAV="@comment "
.endif
.if ${PORT_OPTIONS:MMAC}
RUN_DEPENDS+= mac:${PORTSDIR}/audio/mac
PLIST_SUB+= MAC=""
.else
SK_CMAKE_RM+= codec_mac
PLIST_SUB+= MAC="@comment "
.endif
.if ${PORT_OPTIONS:MMP3GAIN}
RUN_DEPENDS+= mp3gain:${PORTSDIR}/audio/mp3gain
PLIST_SUB+= MP3GAIN=""
.else
SK_CMAKE_RM+= replaygain_mp3gain
PLIST_SUB+= MP3GAIN="@comment "
.endif
.if ${PORT_OPTIONS:MMPLAYER}
RUN_DEPENDS+= mplayer:${PORTSDIR}/multimedia/mplayer
PLIST_SUB+= MPLAYER=""
.else
SK_CMAKE_RM+= codec_mplayer
PLIST_SUB+= MPLAYER="@comment "
.endif
.if ${PORT_OPTIONS:MMUSEPACK}
RUN_DEPENDS+= mpcenc:${PORTSDIR}/audio/musepack
PLIST_SUB+= MUSEPACK=""
.else
SK_CMAKE_RM+= codec_musepack replaygain_musepack
PLIST_SUB+= MUSEPACK="@comment "
.endif
.if ${PORT_OPTIONS:MNEROAAC}
RUN_DEPENDS+= neroAacEnc:${PORTSDIR}/audio/linux-neroaaccodec
PLIST_SUB+= NEROAAC=""
.else
SK_CMAKE_RM+= codec_neroaac
PLIST_SUB+= NEROAAC="@comment "
.endif
.if ${PORT_OPTIONS:MNORMALIZE}
RUN_DEPENDS+= normalize:${PORTSDIR}/audio/normalize
PLIST_SUB+= NORMALIZE=""
.else
SK_CMAKE_RM+= filter_normalize
PLIST_SUB+= NORMALIZE="@comment "
.endif
.if ${PORT_OPTIONS:MOPUSTOOLS}
RUN_DEPENDS+= opusenc:${PORTSDIR}/audio/opus-tools
PLIST_SUB+= OPUSTOOLS=""
.else
SK_CMAKE_RM+= codec_opustools
PLIST_SUB+= OPUSTOOLS="@comment "
.endif
.if ${PORT_OPTIONS:MSHORTEN}
RUN_DEPENDS+= shorten:${PORTSDIR}/audio/shorten
PLIST_SUB+= SHORTEN=""
.else
SK_CMAKE_RM+= codec_shorten
PLIST_SUB+= SHORTEN="@comment "
.endif
.if ${PORT_OPTIONS:MSOX}
RUN_DEPENDS+= sox:${PORTSDIR}/audio/sox
PLIST_SUB+= SOX=""
.else
SK_CMAKE_RM+= filter_sox
PLIST_SUB+= SOX="@comment "
.endif
.if ${PORT_OPTIONS:MSPEEX}
RUN_DEPENDS+= speexenc:${PORTSDIR}/audio/speex
PLIST_SUB+= SPEEX=""
.else
SK_CMAKE_RM+= codec_speex
PLIST_SUB+= SPEEX="@comment "
.endif
.if ${PORT_OPTIONS:MTIMIDITY}
RUN_DEPENDS+= timidity:${PORTSDIR}/audio/timidity
PLIST_SUB+= TIMIDITY=""
.else
SK_CMAKE_RM+= codec_timidity
PLIST_SUB+= TIMIDITY="@comment "
.endif
.if ${PORT_OPTIONS:MTTA}
RUN_DEPENDS+= ttaenv:${PORTSDIR}/audio/tta
PLIST_SUB+= TTA=""
.else
SK_CMAKE_RM+= codec_ttaenc
PLIST_SUB+= TTA="@comment "
.endif
.if ${PORT_OPTIONS:MTWOLAME}
RUN_DEPENDS+= twolame:${PORTSDIR}/audio/twolame
PLIST_SUB+= TWOLAME=""
.else
SK_CMAKE_RM+= codec_twolame
PLIST_SUB+= TWOLAME="@comment "
.endif
.if ${PORT_OPTIONS:MVORBISGAIN}
RUN_DEPENDS+= vorbisgain:${PORTSDIR}/audio/vorbisgain
PLIST_SUB+= VORBISGAIN=""
.else
SK_CMAKE_RM+= replaygain_vorbisgain
PLIST_SUB+= VORBISGAIN="@comment "
.endif
.if ${PORT_OPTIONS:MVORBIS}
RUN_DEPENDS+= oggenc:${PORTSDIR}/audio/vorbis-tools
PLIST_SUB+= VORBIS=""
.else
SK_CMAKE_RM+= codec_vorbistools
PLIST_SUB+= VORBIS="@comment "
.endif
.if ${PORT_OPTIONS:MWAVPACK}
RUN_DEPENDS+= wavpack:${PORTSDIR}/audio/wavpack
PLIST_SUB+= WAVPACK=""
.else
SK_CMAKE_RM+= codec_wavpack replaygain_wvgain
PLIST_SUB+= WAVPACK="@comment "
.endif
.if ${PORT_OPTIONS:MNLS}
USES+= gettext
PLIST_SUB+= NLS=""
.else
PLIST_SUB+= NLS="@comment "
CMAKE_ARGS+= -DBUILD_po=FALSE
.endif
post-patch:
${MKDIR} ${WRKSRC}/plugins_nobuild
.for plugin in ${SK_CMAKE_RM}
${MV} ${WRKSRC}/plugins/soundkonverter_${plugin} \
${WRKSRC}/plugins_nobuild/
.endfor
NLS_USES= gettext
NLS_CMAKE_OFF= -DBUILD_po=FALSE
.include <bsd.port.mk>

View file

@ -1,32 +1,32 @@
bin/soundkonverter
%%AFTEN%%lib/kde4/soundkonverter_codec_aften.so
%%FAAC%%lib/kde4/soundkonverter_codec_faac.so
%%FFMPEG%%lib/kde4/soundkonverter_codec_ffmpeg.so
%%FLAC%%lib/kde4/soundkonverter_codec_flac.so
%%FLAKE%%lib/kde4/soundkonverter_codec_flake.so
%%FLUIDSYNTH%%lib/kde4/soundkonverter_codec_fluidsynth.so
%%LAME%%lib/kde4/soundkonverter_codec_lame.so
%%LIBAV%%lib/kde4/soundkonverter_codec_libav.so
%%MAC%%lib/kde4/soundkonverter_codec_mac.so
%%MPLAYER%%lib/kde4/soundkonverter_codec_mplayer.so
%%MUSEPACK%%lib/kde4/soundkonverter_codec_musepack.so
%%NEROAAC%%lib/kde4/soundkonverter_codec_neroaac.so
%%OPUSTOOLS%%lib/kde4/soundkonverter_codec_opustools.so
%%SHORTEN%%lib/kde4/soundkonverter_codec_shorten.so
%%SPEEX%%lib/kde4/soundkonverter_codec_speex.so
%%TIMIDITY%%lib/kde4/soundkonverter_codec_timidity.so
%%TTA%%lib/kde4/soundkonverter_codec_ttaenc.so
%%TWOLAME%%lib/kde4/soundkonverter_codec_twolame.so
%%VORBIS%%lib/kde4/soundkonverter_codec_vorbistools.so
%%WAVPACK%%lib/kde4/soundkonverter_codec_wavpack.so
%%NORMALIZE%%lib/kde4/soundkonverter_filter_normalize.so
%%SOX%%lib/kde4/soundkonverter_filter_sox.so
%%AACGAIN%%lib/kde4/soundkonverter_replaygain_aacgain.so
%%FLAC%%lib/kde4/soundkonverter_replaygain_metaflac.so
%%MP3GAIN%%lib/kde4/soundkonverter_replaygain_mp3gain.so
%%MUSEPACK%%lib/kde4/soundkonverter_replaygain_musepackgain.so
%%VORBISGAIN%%lib/kde4/soundkonverter_replaygain_vorbisgain.so
%%WAVPACK%%lib/kde4/soundkonverter_replaygain_wvgain.so
lib/kde4/soundkonverter_codec_aften.so
lib/kde4/soundkonverter_codec_faac.so
lib/kde4/soundkonverter_codec_ffmpeg.so
lib/kde4/soundkonverter_codec_flac.so
lib/kde4/soundkonverter_codec_flake.so
lib/kde4/soundkonverter_codec_fluidsynth.so
lib/kde4/soundkonverter_codec_lame.so
lib/kde4/soundkonverter_codec_libav.so
lib/kde4/soundkonverter_codec_mac.so
lib/kde4/soundkonverter_codec_mplayer.so
lib/kde4/soundkonverter_codec_musepack.so
lib/kde4/soundkonverter_codec_neroaac.so
lib/kde4/soundkonverter_codec_opustools.so
lib/kde4/soundkonverter_codec_shorten.so
lib/kde4/soundkonverter_codec_speex.so
lib/kde4/soundkonverter_codec_timidity.so
lib/kde4/soundkonverter_codec_ttaenc.so
lib/kde4/soundkonverter_codec_twolame.so
lib/kde4/soundkonverter_codec_vorbistools.so
lib/kde4/soundkonverter_codec_wavpack.so
lib/kde4/soundkonverter_filter_normalize.so
lib/kde4/soundkonverter_filter_sox.so
lib/kde4/soundkonverter_replaygain_aacgain.so
lib/kde4/soundkonverter_replaygain_metaflac.so
lib/kde4/soundkonverter_replaygain_mp3gain.so
lib/kde4/soundkonverter_replaygain_musepackgain.so
lib/kde4/soundkonverter_replaygain_vorbisgain.so
lib/kde4/soundkonverter_replaygain_wvgain.so
lib/kde4/soundkonverter_ripper_cdparanoia.so
lib/libsoundkonvertercore.so
share/applications/kde4/soundkonverter.desktop
@ -53,34 +53,34 @@ share/icons/hicolor/64x64/apps/soundkonverter.png
%%NLS%%share/locale/pt/LC_MESSAGES/soundkonverter.mo
%%NLS%%share/locale/pt_BR/LC_MESSAGES/soundkonverter.mo
%%NLS%%share/locale/ru/LC_MESSAGES/soundkonverter.mo
%%AFTEN%%share/kde4/services/soundkonverter_codec_aften.desktop
%%FAAC%%share/kde4/services/soundkonverter_codec_faac.desktop
%%FFMPEG%%share/kde4/services/soundkonverter_codec_ffmpeg.desktop
%%FLAC%%share/kde4/services/soundkonverter_codec_flac.desktop
%%FLAKE%%share/kde4/services/soundkonverter_codec_flake.desktop
%%FLUIDSYNTH%%share/kde4/services/soundkonverter_codec_fluidsynth.desktop
%%LAME%%share/kde4/services/soundkonverter_codec_lame.desktop
%%LIBAV%%share/kde4/services/soundkonverter_codec_libav.desktop
%%MAC%%share/kde4/services/soundkonverter_codec_mac.desktop
%%MPLAYER%%share/kde4/services/soundkonverter_codec_mplayer.desktop
%%MUSEPACK%%share/kde4/services/soundkonverter_codec_musepack.desktop
%%NEROAAC%%share/kde4/services/soundkonverter_codec_neroaac.desktop
%%OPUSTOOLS%%share/kde4/services/soundkonverter_codec_opustools.desktop
%%SHORTEN%%share/kde4/services/soundkonverter_codec_shorten.desktop
%%SPEEX%%share/kde4/services/soundkonverter_codec_speex.desktop
%%TIMIDITY%%share/kde4/services/soundkonverter_codec_timidity.desktop
%%TTA%%share/kde4/services/soundkonverter_codec_ttaenc.desktop
%%TWOLAME%%share/kde4/services/soundkonverter_codec_twolame.desktop
%%VORBIS%%share/kde4/services/soundkonverter_codec_vorbistools.desktop
%%WAVPACK%%share/kde4/services/soundkonverter_codec_wavpack.desktop
%%NORMALIZE%%share/kde4/services/soundkonverter_filter_normalize.desktop
%%SOX%%share/kde4/services/soundkonverter_filter_sox.desktop
%%AACGAIN%%share/kde4/services/soundkonverter_replaygain_aacgain.desktop
%%FLAC%%share/kde4/services/soundkonverter_replaygain_metaflac.desktop
%%MP3GAIN%%share/kde4/services/soundkonverter_replaygain_mp3gain.desktop
%%MUSEPACK%%share/kde4/services/soundkonverter_replaygain_musepackgain.desktop
%%VORBISGAIN%%share/kde4/services/soundkonverter_replaygain_vorbisgain.desktop
%%WAVPACK%%share/kde4/services/soundkonverter_replaygain_wvgain.desktop
share/kde4/services/soundkonverter_codec_aften.desktop
share/kde4/services/soundkonverter_codec_faac.desktop
share/kde4/services/soundkonverter_codec_ffmpeg.desktop
share/kde4/services/soundkonverter_codec_flac.desktop
share/kde4/services/soundkonverter_codec_flake.desktop
share/kde4/services/soundkonverter_codec_fluidsynth.desktop
share/kde4/services/soundkonverter_codec_lame.desktop
share/kde4/services/soundkonverter_codec_libav.desktop
share/kde4/services/soundkonverter_codec_mac.desktop
share/kde4/services/soundkonverter_codec_mplayer.desktop
share/kde4/services/soundkonverter_codec_musepack.desktop
share/kde4/services/soundkonverter_codec_neroaac.desktop
share/kde4/services/soundkonverter_codec_opustools.desktop
share/kde4/services/soundkonverter_codec_shorten.desktop
share/kde4/services/soundkonverter_codec_speex.desktop
share/kde4/services/soundkonverter_codec_timidity.desktop
share/kde4/services/soundkonverter_codec_ttaenc.desktop
share/kde4/services/soundkonverter_codec_twolame.desktop
share/kde4/services/soundkonverter_codec_vorbistools.desktop
share/kde4/services/soundkonverter_codec_wavpack.desktop
share/kde4/services/soundkonverter_filter_normalize.desktop
share/kde4/services/soundkonverter_filter_sox.desktop
share/kde4/services/soundkonverter_replaygain_aacgain.desktop
share/kde4/services/soundkonverter_replaygain_metaflac.desktop
share/kde4/services/soundkonverter_replaygain_mp3gain.desktop
share/kde4/services/soundkonverter_replaygain_musepackgain.desktop
share/kde4/services/soundkonverter_replaygain_vorbisgain.desktop
share/kde4/services/soundkonverter_replaygain_wvgain.desktop
share/kde4/services/soundkonverter_ripper_cdparanoia.desktop
share/kde4/servicetypes/soundkonverter_codecplugin.desktop
share/kde4/servicetypes/soundkonverter_filterplugin.desktop