Skip to content

Commit addcb35

Browse files
committed
add homebrew info; remove hardcoded path to qt plugins
1 parent 9c58225 commit addcb35

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,17 @@ For Arch Linux, two packages [ldoce5viewer](https://aur.archlinux.org/packages/l
6363

6464
(for advanced users)
6565

66+
*Homebrew*:
67+
```bash
68+
$ brew install pyqt
69+
$ pip install lxml pyobjc-core pyobjc-framework-Cocoa whoosh py2app
70+
$ # inside ldoce5viewer directory
71+
$ sudo DISTUTILS_DEBUG=1 python setup.py py2app
72+
$ open dist/LDOCE5\ Viewer.app/
73+
```
74+
75+
Or if you are using *MacPorts*:
6676
<ol>
67-
<li><p>Install MacPorts</p></li>
6877
<li><p>Install the following ports:</p>
6978
<ul>
7079
<li>python27 (or python3x)</li>

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22

3+
import subprocess
34
from distutils.core import setup
45
from ldoce5viewer import __version__
56

@@ -60,6 +61,8 @@ def iter_static():
6061
except ImportError:
6162
pass
6263
else:
64+
qt_plugins_path = subprocess.check_output('qmake -query QT_INSTALL_PLUGINS', shell=True)
65+
qt_plugins_path = qt_plugins_path[0:len(qt_plugins_path)-1] # remove "\n"
6366
extra_options.update(dict(
6467
name='LDOCE5 Viewer',
6568
app=['ldoce5viewer.py'],
@@ -90,7 +93,7 @@ def iter_static():
9093
#]
9194
}},
9295
data_files=[
93-
('qt_plugins/imageformats', ['/opt/local/share/qt4/plugins/imageformats/libqjpeg.dylib']),
96+
('qt_plugins/imageformats', [qt_plugins_path]),
9497
('', ['ldoce5viewer/static']),
9598
],
9699
))

0 commit comments

Comments
 (0)