1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-02-02 12:26:48 +01:00

Use cross version of install_name_tool if available.

This commit is contained in:
John Maguire 2016-12-15 11:43:47 +00:00
parent acc5e9f07c
commit ae4fac4b4f

39
dist/macdeploy.py vendored
View File

@ -15,6 +15,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Clementine. If not, see <http://www.gnu.org/licenses/>. # along with Clementine. If not, see <http://www.gnu.org/licenses/>.
from distutils import spawn
import logging import logging
import os import os
import re import re
@ -107,15 +108,18 @@ QT_PLUGINS = [
'imageformats/libqmng.dylib', 'imageformats/libqmng.dylib',
'imageformats/libqsvg.dylib', 'imageformats/libqsvg.dylib',
] ]
QT_PLUGINS_SEARCH_PATH=[ QT_PLUGINS_SEARCH_PATH = [
'/target/plugins', '/target/plugins',
'/usr/local/Trolltech/Qt-4.7.0/plugins', '/usr/local/Trolltech/Qt-4.7.0/plugins',
'/Developer/Applications/Qt/plugins', '/Developer/Applications/Qt/plugins',
] ]
GIO_MODULES_SEARCH_PATH=[ GIO_MODULES_SEARCH_PATH = ['/target/lib/gio/modules',]
'/target/lib/gio/modules',
] INSTALL_NAME_TOOL_APPLE = 'install_name_tool'
INSTALL_NAME_TOOL_CROSS = 'x86_64-apple-darwin-%s' % INSTALL_NAME_TOOL_APPLE
INSTALL_NAME_TOOL = INSTALL_NAME_TOOL_CROSS if spawn.find_executable(
INSTALL_NAME_TOOL_CROSS) else INSTALL_NAME_TOOL_APPLE
class Error(Exception): class Error(Exception):
@ -334,34 +338,39 @@ def CopyFramework(src_binary):
# Create symlinks in the Framework to make it look like # Create symlinks in the Framework to make it look like
# https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html # https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html
commands.append(['ln', '-sf', commands.append([
'Versions/Current/%s' % name, 'ln', '-sf', 'Versions/Current/%s' % name, os.path.join(dest_base, name)
os.path.join(dest_base, name)]) ])
commands.append(['ln', '-sf', commands.append([
'Versions/Current/Resources', 'ln', '-sf', 'Versions/Current/Resources',
os.path.join(dest_base, 'Resources')]) os.path.join(dest_base, 'Resources')
commands.append(['ln', '-sf', ])
version, commands.append(
os.path.join(dest_base, 'Versions/Current')]) ['ln', '-sf', version, os.path.join(dest_base, 'Versions/Current')])
return dest_binary return dest_binary
def FixId(path, library_name): def FixId(path, library_name):
id = '@executable_path/../Frameworks/%s' % library_name id = '@executable_path/../Frameworks/%s' % library_name
args = ['install_name_tool', '-id', id, path] args = [INSTALL_NAME_TOOL, '-id', id, path]
commands.append(args) commands.append(args)
def FixLibraryId(path): def FixLibraryId(path):
library_name = os.path.basename(path) library_name = os.path.basename(path)
FixId(path, library_name) FixId(path, library_name)
def FixFrameworkId(path, id): def FixFrameworkId(path, id):
FixId(path, id) FixId(path, id)
def FixInstallPath(library_path, library, new_path): def FixInstallPath(library_path, library, new_path):
args = ['install_name_tool', '-change', library_path, new_path, library] args = [INSTALL_NAME_TOOL, '-change', library_path, new_path, library]
commands.append(args) commands.append(args)
def FindSystemLibrary(library_name): def FindSystemLibrary(library_name):
for path in ['/lib', '/usr/lib']: for path in ['/lib', '/usr/lib']:
full_path = os.path.join(path, library_name) full_path = os.path.join(path, library_name)