Example #1
0
        def run(self):
            py2app.run(self)

            # XXX py2app can't copy Qt plugins.
            plugins = os.path.join(unicode(QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.PluginsPath)), "imageformats")
            dest = os.path.abspath("dist/MusicBrainz Picard.app/Contents/plugins/imageformats")
            self.mkpath(dest)
            for lib in ("libqgif.dylib", "libqjpeg.dylib", "libqtiff.dylib"):
                src_file = os.path.join(plugins, lib)
                if os.path.isfile(src_file):
                    dest_file = os.path.join(dest, lib)
                    copy_file(src_file, dest_file)
                    call(["install_name_tool", "-change", "QtCore.framework/Versions/4/QtCore", "@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore", dest_file])
                    call(["install_name_tool", "-change", "QtGui.framework/Versions/4/QtGui", "@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui", dest_file])

            # XXX Without qt.conf, launching the app bundle results in a ton of warnings about
            # "loading two sets of Qt binaries into the same process," followed by it crashing.
            # Tools like macdeployqt create this file automatically, with the same contents.
            fp = open("dist/MusicBrainz Picard.app/Contents/Resources/qt.conf", "w")
            fp.writelines(["[Paths]", "Prefix="])
            fp.close()

            # XXX Find and bundle fpcalc, since py2app can't.
            fpcalc = find_app("fpcalc")
            if fpcalc:
                dest_fpcalc = os.path.abspath("dist/MusicBrainz Picard.app/Contents/MacOS/fpcalc")
                copy_file(fpcalc, dest_fpcalc)
                os.chmod(dest_fpcalc, 0755)
Example #2
0
        def run(self):
            py2app.run(self)

            # XXX Find and bundle fpcalc, since py2app can't.
            fpcalc = find_app("fpcalc")
            if fpcalc:
                dest_fpcalc = os.path.abspath("dist/MusicBrainz Picard.app/Contents/MacOS/fpcalc")
                copy_file(fpcalc, dest_fpcalc)
                os.chmod(dest_fpcalc, 0o755)
Example #3
0
        def run(self):
            py2app.run(self)

            # XXX Find and bundle fpcalc, since py2app can't.
            fpcalc = find_app("fpcalc")
            if fpcalc:
                dest_fpcalc = os.path.abspath("dist/MusicBrainz Picard.app/Contents/MacOS/fpcalc")
                copy_file(fpcalc, dest_fpcalc)
                os.chmod(dest_fpcalc, 0o755)
Example #4
0
        def run(self):
            py2app.run(self)

            # XXX py2app can't copy Qt plugins.
            plugins = os.path.join(
                unicode(
                    QtCore.QLibraryInfo.location(
                        QtCore.QLibraryInfo.PluginsPath)), "imageformats")
            dest = os.path.abspath(
                "dist/MusicBrainz Picard.app/Contents/plugins/imageformats")
            self.mkpath(dest)
            for lib in ("libqgif.dylib", "libqjpeg.dylib", "libqtiff.dylib"):
                src_file = os.path.join(plugins, lib)
                if os.path.isfile(src_file):
                    dest_file = os.path.join(dest, lib)
                    copy_file(src_file, dest_file)
                    call([
                        "install_name_tool", "-change",
                        "QtCore.framework/Versions/4/QtCore",
                        "@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore",
                        dest_file
                    ])
                    call([
                        "install_name_tool", "-change",
                        "QtGui.framework/Versions/4/QtGui",
                        "@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui",
                        dest_file
                    ])

            # XXX Without qt.conf, launching the app bundle results in a ton of warnings about
            # "loading two sets of Qt binaries into the same process," followed by it crashing.
            # Tools like macdeployqt create this file automatically, with the same contents.
            fp = open("dist/MusicBrainz Picard.app/Contents/Resources/qt.conf",
                      "w")
            fp.writelines(["[Paths]", "Prefix="])
            fp.close()

            # XXX Find and bundle fpcalc, since py2app can't.
            fpcalc = find_app("fpcalc")
            if fpcalc:
                dest_fpcalc = os.path.abspath(
                    "dist/MusicBrainz Picard.app/Contents/MacOS/fpcalc")
                copy_file(fpcalc, dest_fpcalc)
                os.chmod(dest_fpcalc, 0755)