mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-22 21:44:25 -04:00
OSX version still needs a bit of work, but completely works now (#43)
This commit is contained in:
parent
31ec0c11d5
commit
a464b6fe1d
5 changed files with 33 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -16,6 +16,7 @@ sdist
|
||||||
develop-eggs
|
develop-eggs
|
||||||
.installed.cfg
|
.installed.cfg
|
||||||
MANIFEST
|
MANIFEST
|
||||||
|
env
|
||||||
|
|
||||||
# Installer logs
|
# Installer logs
|
||||||
pip-log.txt
|
pip-log.txt
|
||||||
|
|
24
BUILD.md
24
BUILD.md
|
@ -23,24 +23,28 @@ Note that python-stem appears in Debian wheezy and newer (so by extension Tails
|
||||||
|
|
||||||
## Mac OS X
|
## Mac OS X
|
||||||
|
|
||||||
*Note: This is a work-in-progress. The OnionShare GUI doesn't yet work in Mac OS X. See https://github.com/micahflee/onionshare/issues/43 for progress.*
|
The first time you're setting up your dev environment:
|
||||||
|
|
||||||
Get a copy of the source code:
|
echo export PYTHONPATH=\$PYTHONPATH:/usr/local/lib/python2.7/site-packages/ >> ~/.profile
|
||||||
|
source ~/.profile
|
||||||
|
brew install qt4 pyqt
|
||||||
|
virtualenv env
|
||||||
|
. env/bin/activate
|
||||||
|
pip install flask stem py2app
|
||||||
|
# fixes a silly bug https://bitbucket.org/ronaldoussoren/py2app/issue/143/resulting-app-mistakenly-looks-for-pyside
|
||||||
|
patch env/lib/python2.7/site-packages/py2app/util.py < setup/py2app.patch
|
||||||
|
|
||||||
git clone https://github.com/micahflee/onionshare.git
|
Each time you start work:
|
||||||
cd onionshare
|
|
||||||
|
|
||||||
Install py2app (if you don't have pip installed, you can `sudo easy_install pip`):
|
. env/bin/activate
|
||||||
|
|
||||||
sudo pip install py2app
|
Build the .app:
|
||||||
|
|
||||||
Then build the .app:
|
|
||||||
|
|
||||||
python setup.py py2app
|
python setup.py py2app
|
||||||
|
|
||||||
Now you'll see `dist/OnionShare.app` with a nice icon. However, it won't run yet.
|
Now you should have `dist/OnionShare.app`.
|
||||||
|
|
||||||
## Windows
|
## Windows
|
||||||
|
|
||||||
*Note: Haven't started figuring this out yet.*
|
*Coming soon.*
|
||||||
|
|
||||||
|
|
9
setup.py
9
setup.py
|
@ -20,19 +20,22 @@ version = open('version').read().strip()
|
||||||
args = {}
|
args = {}
|
||||||
|
|
||||||
if platform.system() == 'Darwin':
|
if platform.system() == 'Darwin':
|
||||||
args['data_files'] = ['LICENSE', 'README.md', 'BUILD.md', 'version', 'onionshare', 'onionshare_gui']
|
args['data_files'] = ['LICENSE', 'README.md', 'version']
|
||||||
args['app'] = ['setup/onionshare_osx.py']
|
args['app'] = ['setup/onionshare-launcher.py']
|
||||||
args['options'] = {
|
args['options'] = {
|
||||||
'py2app': {
|
'py2app': {
|
||||||
'argv_emulation': True,
|
'argv_emulation': True,
|
||||||
|
'packages': ['flask', 'stem', 'jinja2', 'onionshare_gui', 'onionshare'],
|
||||||
|
'includes': ['PyQt4'],
|
||||||
|
'excludes': ['PyQt4.QtDesigner', 'PyQt4.QtOpenGL', 'PyQt4.QtScript', 'PyQt4.QtSql', 'PyQt4.QtTest', 'PyQt4.QtXml', 'PyQt4.phonon'],
|
||||||
'iconfile': 'setup/onionshare.icns',
|
'iconfile': 'setup/onionshare.icns',
|
||||||
'packages': ['flask', 'stem'],
|
|
||||||
'site_packages': True,
|
'site_packages': True,
|
||||||
'plist': {
|
'plist': {
|
||||||
'CFBundleName': 'OnionShare',
|
'CFBundleName': 'OnionShare',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
args['setup_requires'] = 'py2app'
|
||||||
|
|
||||||
elif platform.system() == 'Windows':
|
elif platform.system() == 'Windows':
|
||||||
pass
|
pass
|
||||||
|
|
12
setup/py2app.patch
Normal file
12
setup/py2app.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
--- original-util.py 2014-06-17 12:50:15.000000000 -0700
|
||||||
|
+++ util.py 2014-06-17 12:51:33.000000000 -0700
|
||||||
|
@@ -148,6 +148,9 @@
|
||||||
|
log.info("copying file %s -> %s", source, destination)
|
||||||
|
with zipio.open(source, 'rb') as fp_in:
|
||||||
|
if not dry_run:
|
||||||
|
+ if os.path.exists(destination):
|
||||||
|
+ os.unlink(destination)
|
||||||
|
+
|
||||||
|
with open(destination, 'wb') as fp_out:
|
||||||
|
data = fp_in.read()
|
||||||
|
fp_out.write(data)
|
Loading…
Add table
Add a link
Reference in a new issue