Skip to content

Commit 4976cb0

Browse files
committed
fix bundling of plugins on OS X.
1 parent 122a16a commit 4976cb0

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

copyq.pro

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ TRANSLATIONS = translations/copyq_cs.ts \
1010
translations/copyq_es.ts
1111

1212
macx {
13+
package_plugins.commands = \
14+
mkdir -p copyq.app/Contents/PlugIns/copyq/ ; \
15+
cp plugins/*.dylib copyq.app/Contents/PlugIns/copyq/
16+
package_plugins.depends = sub-plugins sub-src
17+
QMAKE_EXTRA_TARGETS += package_plugins
18+
1319
package_frameworks.commands = \
1420
test -e copyq.app/Contents/Frameworks/QtCore.framework \
1521
|| $$dirname(QMAKE_QMAKE)/macdeployqt copyq.app
1622
package_frameworks.target = copyq.app/Contents/Frameworks/QtCore.framework
17-
package_frameworks.depends = sub-src sub-plugins
23+
package_frameworks.depends = sub-src sub-plugins package_plugins
1824
QMAKE_EXTRA_TARGETS += package_frameworks
1925

20-
package_plugins.commands = \
21-
mkdir -p copyq.app/Contents/Resources/plugins/ ; \
22-
cp plugins/*.dylib copyq.app/Contents/Resources/plugins/
23-
package_plugins.depends = sub-plugins
24-
QMAKE_EXTRA_TARGETS += package_plugins
25-
2626
bundle_mac.depends = package_frameworks package_plugins
2727
bundle_mac.target = copyq.app
2828
QMAKE_EXTRA_TARGETS += bundle_mac

src/item/itemfactory.cpp

+13-11
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,23 @@ bool findPluginDir(QDir *pluginsDir)
5757

5858
#elif defined(Q_OS_MAC)
5959
pluginsDir->setPath( QCoreApplication::instance()->applicationDirPath() );
60-
if ( pluginsDir->dirName() == "MacOS"
61-
&& pluginsDir->cdUp() // Contents
62-
&& pluginsDir->cd("Resources")
63-
&& pluginsDir->cd("plugins"))
60+
if (pluginsDir->dirName() != "MacOS") {
61+
return false;
62+
}
63+
64+
if ( pluginsDir->cdUp() // Contents
65+
&& pluginsDir->cd("Plugins")
66+
&& pluginsDir->cd("copyq"))
6467
{
6568
// OK, found it in the bundle
6669
COPYQ_LOG("Found plugins in application bundle");
6770
} else if (
68-
pluginsDir->setPath( QCoreApplication::instance()->applicationDirPath() ),
69-
pluginsDir->dirName() == "MacOS"
70-
&& pluginsDir->cdUp() // Contents
71-
&& pluginsDir->cdUp() // copyq.app
72-
&& pluginsDir->cdUp() // repo root
73-
&& pluginsDir->cd("plugins")) {
74-
COPYQ_LOG("Found plugins in build tree");
71+
pluginsDir->setPath( QCoreApplication::instance()->applicationDirPath() ),
72+
pluginsDir->cdUp() // Contents
73+
&& pluginsDir->cdUp() // copyq.app
74+
&& pluginsDir->cdUp() // repo root
75+
&& pluginsDir->cd("plugins")) {
76+
COPYQ_LOG("Found plugins in build tree");
7577
} else {
7678
return false;
7779
}

0 commit comments

Comments
 (0)