Fix Sparkle integration for macOS
This commit is contained in:
@@ -26,6 +26,8 @@ before_install:
|
|||||||
brew install libcdio libmtp libimobiledevice libplist;
|
brew install libcdio libmtp libimobiledevice libplist;
|
||||||
brew install create-dmg;
|
brew install create-dmg;
|
||||||
brew cask install sparkle;
|
brew cask install sparkle;
|
||||||
|
sudo ln -s /usr/local/Caskroom/sparkle/$(ls /usr/local/Caskroom/sparkle | head -n1)/Sparkle.framework /Library/Frameworks/Sparkle.framework;
|
||||||
|
sudo ln -s /usr/local/Caskroom/sparkle/$(ls /usr/local/Caskroom/sparkle | head -n1)/Sparkle.framework.dSYM /Library/Frameworks/Sparkle.framework.dSYM;
|
||||||
export Qt5_DIR=/usr/local/opt/qt5/lib/cmake;
|
export Qt5_DIR=/usr/local/opt/qt5/lib/cmake;
|
||||||
export Qt5LinguistTools_DIR=/usr/local/opt/qt5/lib/cmake/Qt5LinguistTools;
|
export Qt5LinguistTools_DIR=/usr/local/opt/qt5/lib/cmake/Qt5LinguistTools;
|
||||||
export PATH="/usr/local/opt/gettext/bin:$PATH";
|
export PATH="/usr/local/opt/gettext/bin:$PATH";
|
||||||
@@ -34,7 +36,7 @@ before_install:
|
|||||||
fi
|
fi
|
||||||
before_script:
|
before_script:
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker exec build cmake -Hstrawberry -Bbuild ; fi
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker exec build cmake -Hstrawberry -Bbuild ; fi
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir build; cd build; cmake .. -DUSE_BUNDLE=ON -DSPARKLE= ; fi
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir build; cd build; cmake .. -DUSE_BUNDLE=ON ; fi
|
||||||
script:
|
script:
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker exec build make -C build -j8 ; fi
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker exec build make -C build -j8 ; fi
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||||
|
|||||||
@@ -72,6 +72,11 @@ if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
|
|||||||
set(DEBUG ON)
|
set(DEBUG ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||||
|
set(CMAKE_INSTALL_RPATH "@loader_path/../Frameworks")
|
||||||
|
endif()
|
||||||
|
|
||||||
find_program(CCACHE_EXECUTABLE NAMES ccache)
|
find_program(CCACHE_EXECUTABLE NAMES ccache)
|
||||||
if (CCACHE_EXECUTABLE)
|
if (CCACHE_EXECUTABLE)
|
||||||
message(STATUS "ccache found: will be used for compilation and linkage")
|
message(STATUS "ccache found: will be used for compilation and linkage")
|
||||||
@@ -253,10 +258,10 @@ set(SINGLEAPPLICATION_LIBRARIES singleapplication)
|
|||||||
set(SINGLECOREAPPLICATION_LIBRARIES singlecoreapplication)
|
set(SINGLECOREAPPLICATION_LIBRARIES singlecoreapplication)
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
find_library(SPARKLE Sparkle PATHS /usr/local/Caskroom/sparkle/1.22.0 NAMES Sparkle Sparkle.framework)
|
find_library(SPARKLE Sparkle)
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
|
|
||||||
if((NOT SPARKLE) AND (APPLE OR WIN32))
|
if(NOT SPARKLE AND (APPLE OR WIN32))
|
||||||
if(WITH_QT6)
|
if(WITH_QT6)
|
||||||
pkg_check_modules(QTSPARKLE qtsparkle-qt6)
|
pkg_check_modules(QTSPARKLE qtsparkle-qt6)
|
||||||
else()
|
else()
|
||||||
|
|||||||
11
dist/macos/macdeploy.py
vendored
11
dist/macos/macdeploy.py
vendored
@@ -31,7 +31,8 @@ LIBRARY_SEARCH_PATH = ['/usr/local/lib']
|
|||||||
|
|
||||||
FRAMEWORK_SEARCH_PATH = [
|
FRAMEWORK_SEARCH_PATH = [
|
||||||
'/Library/Frameworks',
|
'/Library/Frameworks',
|
||||||
os.path.join(os.environ['HOME'], 'Library/Frameworks')
|
os.path.join(os.environ['HOME'], 'Library/Frameworks'),
|
||||||
|
'/Library/Frameworks/Sparkle.framework/Versions'
|
||||||
]
|
]
|
||||||
|
|
||||||
QT_PLUGINS = [
|
QT_PLUGINS = [
|
||||||
@@ -190,7 +191,7 @@ def GetBrokenLibraries(binary):
|
|||||||
elif re.match(r'^\s*/usr/lib/', line):
|
elif re.match(r'^\s*/usr/lib/', line):
|
||||||
#print "unix style system lib"
|
#print "unix style system lib"
|
||||||
continue # unix style system library
|
continue # unix style system library
|
||||||
elif re.match(r'^\s*@executable_path', line) or re.match(r'^\s*@loader_path', line):
|
elif re.match(r'^\s*@executable_path', line) or re.match(r'^\s*@rpath', line) or re.match(r'^\s*@loader_path', line):
|
||||||
# Potentially already fixed library
|
# Potentially already fixed library
|
||||||
path = line.split('/')[3:]
|
path = line.split('/')[3:]
|
||||||
if path:
|
if path:
|
||||||
@@ -421,12 +422,14 @@ def FixLibraryInstallPath(library_path, library):
|
|||||||
|
|
||||||
def FixFrameworkInstallPath(library_path, library):
|
def FixFrameworkInstallPath(library_path, library):
|
||||||
parts = library_path.split(os.sep)
|
parts = library_path.split(os.sep)
|
||||||
|
full_path = ""
|
||||||
for i, part in enumerate(parts):
|
for i, part in enumerate(parts):
|
||||||
if re.match(r'\w+\.framework', part):
|
if re.match(r'\w+\.framework', part):
|
||||||
full_path = os.path.join(*parts[i:])
|
full_path = os.path.join(*parts[i:])
|
||||||
break
|
break
|
||||||
new_path = '@executable_path/../Frameworks/%s' % full_path
|
if full_path:
|
||||||
FixInstallPath(library_path, library, new_path)
|
new_path = '@executable_path/../Frameworks/%s' % full_path
|
||||||
|
FixInstallPath(library_path, library, new_path)
|
||||||
|
|
||||||
|
|
||||||
def FindQtPlugin(name):
|
def FindQtPlugin(name):
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
#include "globalshortcuts/globalshortcutbackend-macos.h"
|
#include "globalshortcuts/globalshortcutbackend-macos.h"
|
||||||
|
|
||||||
#ifdef HAVE_SPARKLE
|
#ifdef HAVE_SPARKLE
|
||||||
# import <Sparkle/SUUpdater.h>
|
# import <SUUpdater.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|||||||
Reference in New Issue
Block a user