Ticket #54091: Portfile

File Portfile, 3.4 KB (added by RJVB (René Bertin), 7 years ago)
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 120912 2014-06-11 13:10:52Z ciserlohn@macports.org $
3
4PortSystem          1.0
5PortGroup           qt5 1.0
6PortGroup           cmake 1.1
7PortGroup           github 1.0
8
9name                qmplay2
10
11description         A Qt5-based video and audio player.
12long_description    QMPlay2 is a video and audio player. It can play all formats \
13                    supported by FFmpeg, libmodplug (including J2B and SFX). It also \
14                    supports Audio CD, raw files, Rayman 2 music and chiptunes. It \
15                    contains YouTube and Prostopleer browsers.
16license             LGPL-3
17maintainers         gmail.com:rjvbertin openmaintainer
18platforms           darwin linux
19
20subport             ${name}-devel {
21    long_description A QMPlay2 port aimed at development purposes.
22}
23
24
25if {${subport} eq "${name}"} {
26    github.setup    zaps166 QMPlay2 17.04.21
27    checksums       rmd160  e93bd8cc61119ffef0f33634ebc2ad97921b49cb \
28                    sha256  17b2a5b0930190e64f2c7bf44de36f1ee1c2f980c86a7e6331a10a70803340ae
29} else {
30    github.setup    zaps166 QMPlay2 154abbb08b78a6edec8421ea7d35ebd4917c26d1
31    version         17.04.21.9
32    # this port is intended to facilitate development efforts shared with "upstreams"
33    # so using git instead of a tarball fetch type is more appropriate.
34    fetch.type      git
35    distname        qmplay2-git
36}
37
38cmake.save_configure_cmd
39
40configure.args-append \
41                    -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
42                    -DUSE_QT5=ON \
43                    -DUSE_FFMPEG_AVDEVICE=ON \
44                    -DUSE_OPENGL_FOR_VISUALIZATIONS=ON \
45                    -DUSE_JEMALLOC=ON
46
47if {![variant_exists LTO]} {
48    variant LTO description {Build with link-time optimisation} {}
49}
50if {[variant_isset LTO]} {
51    configure.args-append \
52                    -DUSE_LINK_TIME_OPTIMIZATION=ON
53}
54
55platform linux {
56    cmake.install_rpath-prepend \
57                    ${qt_libs_dir}
58    # don't use the buildsystem's rpath support
59    # (it will install only a single path)
60    configure.args-append \
61                    -DSET_INSTALL_RPATH=OFF
62}
63
64qt5.depends_component \
65                    qtsvg qttools
66depends_lib-append  port:ffmpeg \
67                    port:portaudio \
68                    port:jemalloc
69
70patch.pre_args      -Np1
71patchfiles-append   patch-macports-build.diff
72
73platform darwin {
74    ## build system is set up to create a standalone, all-inclusive app bundle!
75    depends_lib-append \
76                    port:libass \
77                    port:taglib \
78                    port:libcdio \
79                    port:libcddb
80
81    configure.args-append \
82                    -DUSE_PULSEAUDIO=OFF \
83                    -DBUNDLE_INSTALL_DIR=${qt_apps_dir} \
84                    -DUSE_XVIDEO=OFF
85    post-destroot {
86        file rename ${destroot}${qt_apps_dir}/QMPlay2.app/Contents/MacOS/libqmplay2.dylib ${destroot}${prefix}/lib/
87        # install a wrapper script in ${prefix}/bin
88        if {[info procs "qt5.add_app_wrapper"] ne ""} {
89            qt5.add_app_wrapper QMPlay2
90        } else {
91            system "echo \"#!/bin/sh\nexec \\\"${qt_apps_dir}/QMPlay2.app/Contents/MacOS/QMPlay2\\\" \\\"\\\$\@\\\"\" > ${destroot}${prefix}/bin/QMPlay2"
92            system "chmod 755 ${destroot}${prefix}/bin/QMPlay2"
93        }
94    }
95}