Ticket #40139: Portfile.6

File Portfile.6, 4.7 KB (added by dliessi (Davide Liessi), 11 years ago)

upgrade to 2.0.11; use github portgroup; remove python version suffix from link inside ${prefix}/bin; properly place files in ${prefix}/share; create application bundle

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$
3
4PortSystem          1.0
5PortGroup           python 1.0
6PortGroup           github 1.0
7
8github.setup        wbsoft frescobaldi 2.0.11 v
9conflicts           frescobaldi-devel
10categories          editors python
11maintainers         gmail.com:davide.liessi openmaintainer
12description         A LilyPond sheet music text editor
13long_description    Frescobaldi is a LilyPond sheet music text editor. \
14                    It aims to be powerful, yet lightweight and easy to use.
15homepage            http://www.frescobaldi.org/
16platforms           darwin
17supported_archs     noarch
18license             GPL-2+
19
20checksums           rmd160  5033eef310d5b68de3951cf07517416436f47cb7 \
21                    sha256  478177a1292e1232df7fb11cae3a28e67af2186191ad1f976e390029e331139c
22
23build {}
24
25depends_run-append  port:portmidi
26
27variant python26 conflicts python27 description {Use Python 2.6} {
28    python.default_version  26
29    depends_run-append      port:py${python.default_version}-pyqt4 \
30                            port:py${python.default_version}-python-poppler-qt4
31}
32variant python27 conflicts python26 description {Use Python 2.7} {
33    python.default_version  27
34    depends_run-append      port:py${python.default_version}-pyqt4 \
35                            port:py${python.default_version}-python-poppler-qt4
36}
37if {![variant_isset python26]} {
38    default_variants        +python27
39}
40
41variant app description {Make application bundle} {
42    depends_build-append    port:py${python.default_version}-cx_Freeze
43}
44default_variants    +app
45
46post-destroot {
47    set share_destroot ${destroot}${prefix}/share
48    set share_python ${python.prefix}/share
49
50    set man_dir /man/man1
51    xinstall -d ${share_destroot}${man_dir}
52    ln -s ${share_python}${man_dir}/frescobaldi.1 ${share_destroot}${man_dir}
53
54    set desktop_dir /applications
55    xinstall -d ${share_destroot}${desktop_dir}
56    ln -s ${share_python}${desktop_dir}/frescobaldi.desktop ${share_destroot}${desktop_dir}
57
58    set icons_dir /icons/hicolor/scalable/apps
59    xinstall -d ${share_destroot}${icons_dir}
60    ln -s ${share_python}${icons_dir}/frescobaldi.svg ${share_destroot}${icons_dir}
61
62    set doc_dir ${share_destroot}/doc/${subport}
63    xinstall -d ${doc_dir}
64    xinstall -m 644 -W ${worksrcpath} \
65        COPYING \
66        ChangeLog \
67        README \
68        THANKS \
69        ${doc_dir}
70
71    if {[variant_isset app]} {
72        set app_contents    ${destroot}${applications_dir}/Frescobaldi.app/Contents
73        set app_macos       ${app_contents}/MacOS
74        set app_resources   ${app_contents}/Resources
75
76        set infopliststrings \
77"/* Localized versions of Info.plist keys */
78
79CFBundleName = \"Frescobaldi\";
80CFBundleDisplayName = \"Frescobaldi\";
81
82NSHumanReadableCopyright = \"Copyright © 2008-2012 Wilbert Berendsen.\";
83"
84        foreach l {cs de en es fr gl it nl pl pt ru tr uk} {
85            set app_lproj ${app_resources}/${l}.lproj
86            xinstall -d ${app_lproj}
87            set fileID [ open "${app_lproj}/InfoPlist.strings" "w" ]
88            puts -nonewline ${fileID} ${infopliststrings}
89            close ${fileID}
90        }
91
92        set infoplist \
93"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
94<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
95<plist version=\"1.0\">
96<dict>
97    <key>CFBundlePackageType</key>
98    <string>APPL</string>
99    <key>CFBundleIdentifier</key>
100    <string>org.frescobaldi.frescobaldi</string>
101    <key>CFBundleSignature</key>
102    <string>????</string>
103    <key>CFBundleExecutable</key>
104    <string>Frescobaldi</string>
105    <key>CFBundleDisplayName</key>
106    <string>Frescobaldi</string>
107    <key>CFBundleVersion</key>
108    <string>${version}</string>
109    <key>CFBundleName</key>
110    <string>Frescobaldi</string>
111    <key>CFBundleIconFile</key>
112    <string>frescobaldi.icns</string>
113    <key>NSHumanReadableCopyright</key>
114    <string>Copyright © 2008-2012 Wilbert Berendsen.</string>
115</dict>
116</plist>
117"
118        set fileID [ open "${app_contents}/Info.plist" "w" ]
119        puts -nonewline ${fileID} ${infoplist}
120        close ${fileID}
121
122        xinstall -d ${app_macos}
123        exec ${prefix}/bin/cxfreeze-${python.branch} \
124            ${destroot}${python.prefix}/bin/frescobaldi \
125            --target-dir ${app_macos} --no-copy-deps --target-name Frescobaldi
126
127        xinstall -m 644 -W ${filespath} frescobaldi.icns ${app_resources}
128    }
129}
130
131python.link_binaries_suffix
132
133notes \
134"You may want to install FluidSynth and obtain a SoundFont
135in order to have audio output from Frescobaldi's MIDI output.
136
137You will need to select FluidSynth's MIDI input port
138in Frescobaldi's MIDI settings (in Preferences)
139while FluidSynth is running."