source: trunk/dports/audio/mpd/Portfile

Last change on this file was 153111, checked in by ryandesign@…, 10 months ago

mpd: use cxx11 1.0 portgroup

Resolves #43417

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.9 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 153111 2016-09-24 23:34:07Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           compiler_blacklist_versions 1.0
6PortGroup           cxx11 1.0
7
8name                mpd
9version             0.19.19
10set branch          [join [lrange [split ${version} .] 0 1] .]
11categories          audio
12maintainers         nomaintainer
13description         Music Player Daemon
14long_description    Music Player Daemon (MPD) allows remote access for playing music \
15    (MP3, Ogg Vorbis, FLAC, AAC, Mod, and wave files) and managing \
16    playlists. MPD is designed for integrating a computer into a stereo \
17    system that provides control for music playback over a local network. \
18    It also makes a great desktop music player, especially if you are a \
19    console junkie, like frontend options, or restart X often.
20homepage            http://www.musicpd.org/
21platforms           darwin
22master_sites        http://www.musicpd.org/download/${name}/${branch}/
23license             GPL-2+ LGPL-2.1
24use_xz              yes
25checksums           rmd160  ecaf3952fda5f3aaec92d38c9fd3aac33397bf5c \
26                    sha256  bc856cda4136403446d53d11576f86990b61d1fe4668f6008e9eae47450d4e1d
27depends_build \
28    port:pkgconfig \
29    port:boost
30depends_lib \
31    port:audiofile \
32    port:cdparanoia \
33    port:curl \
34    port:faad2 \
35    port:flac \
36    path:lib/pkgconfig/glib-2.0.pc:glib2 \
37    port:libcue \
38    port:libiconv \
39    port:libid3tag \
40    port:libogg \
41    port:libvorbis \
42    port:zlib \
43    port:libao
44
45#   revise Main.cxx with patch in future version 0.19.12 to allow compilation without inotify
46configure.args \
47    --mandir=${prefix}/share/man \
48    --disable-ffmpeg \
49    --disable-jack \
50    --enable-ao \
51    --disable-mpc
52configure.cflags-append -I${prefix}/include
53
54variant mpcdec description {Support for musepack via libmpcdec} {
55    depends_lib-append  port:libmpcdec
56    configure.args-delete --disable-mpc
57}
58variant ffmpeg description {Support for myriad formats via ffmpeg} {
59    depends_lib-append  path:lib/libavcodec.dylib:ffmpeg
60    configure.args-delete --disable-ffmpeg
61}
62variant mod description {Support for several formats of tracker/sequencer files via libmikmod} {
63    depends_lib-append    port:libmikmod
64    configure.args-append --enable-mod
65}
66variant modplug description {Support for several formats of tracker/sequencer files via libmodplug} {
67    depends_lib-append    port:libmodplug
68    configure.args-append --enable-modplug
69}
70variant mpg123 conflicts mad description {Use mpg123 rather than mad as mp3 deconding library} {
71    depends_lib-append    port:mpg123
72    configure.args-append --enable-mpg123 --disable-mad
73}
74variant mad conflicts mpg123 description (Use mad rather than mpg123 as mp3 decoding library} {
75    depends_lib-append      port:libmad
76    configure.args-append   --enable-mad --disable-mpg123
77}
78if {![variant_isset mpg123]} {
79    default_variants    +mad
80}
81
82# Doesn't work with old GCC. Also blacklist old Clang, since it uses
83# LLVM-GCC to compile C++.
84compiler.blacklist-append   gcc-3.3 {*gcc-4.[0-5]} {clang < 425.0.24}
85
86if {${os.platform} eq "darwin" && ${os.major} > 8} {
87    set mpduser       _mpd
88} else {
89    set mpduser       mpd
90}
91# Create new user for mpd:
92add_users ${mpduser} group=${mpduser} realname=Music\ Player\ Daemon
93
94startupitem.create  yes
95startupitem.start   "${prefix}/bin/mpd --no-daemon ${prefix}/etc/mpd.conf"
96startupitem.stop    "${prefix}/bin/mpd --kill"
97destroot.keepdirs   ${destroot}${prefix}/var/lib/mpd/music \
98    ${destroot}${prefix}/var/lib/mpd/playlists \
99    ${destroot}${prefix}/var/log/mpd
100post-destroot {
101    # ensure ${prefix}/var/[lib/mpd/[music,playlists],log/mpd] exist
102    xinstall -m 755 -o ${mpduser} -g ${mpduser} -d \
103    ${destroot}${prefix}/var/lib/mpd \
104    ${destroot}${prefix}/var/lib/mpd/music \
105    ${destroot}${prefix}/var/lib/mpd/playlists \
106    ${destroot}${prefix}/var/log/mpd
107
108    xinstall -m 644 ${filespath}/mpd.conf ${destroot}${prefix}/etc/mpd.conf.default
109    reinplace "s|%%PREFIX%%|${prefix}|g" \
110        ${destroot}${prefix}/etc/mpd.conf.default
111    reinplace "s|%%MPDUSER%%|${mpduser}|g" \
112        ${destroot}${prefix}/etc/mpd.conf.default
113}
114post-activate {
115    if {![file exists ${prefix}/etc/mpd.conf]} {
116        copy ${prefix}/etc/mpd.conf.default ${prefix}/etc/mpd.conf
117    }
118}
119
120notes "A basic configuration file has been created for you.
121To add music to mpd's database, create symbolic links in
122${prefix}/var/lib/mpd/music using 'ln -s'.  For advanced
123configuration, run \"man mpd.conf\" or refer to
124${prefix}/share/doc/mpd/mpdconf.example for an example configuration file.
125
126You may get \"Problems shmget'ing\" message when launching mpd.
127In this case, you can increase the values of kern.sysv.shmmax and
128kern.sysv.shmall in /etc/rc."
129
130
131livecheck.url       http://www.musicpd.org/download/${name}/${branch}/
132livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)"
Note: See TracBrowser for help on using the repository browser.