Merge branch 'fix-osx-pkg'

This commit is contained in:
Brian Warner 2016-03-16 12:40:30 -07:00
commit d5c34d46bc
10 changed files with 72 additions and 17 deletions

23
docs/OS-X.rst Normal file
View File

@ -0,0 +1,23 @@
==============
OS-X Packaging
==============
Pre-built Tahoe-LAFS ".pkg" installers for OS-X are generated with each
source-code commit. These installers offer an easy way to get Tahoe and all
its dependencies installed on your Mac. They do not yet provide a
double-clickable application: after installation, you will have a "tahoe"
command-line tool, which you can use from a shell (a Terminal window) just as
if you'd installed from source.
Installers are available from this directory:
https://tahoe-lafs.org/source/tahoe-lafs/tarballs/OS-X-packages/
Download the latest .pkg file to your computer and double-click on it. This
will install to /Applications/tahoe.app, however the app icon there is not
how you use Tahoe (launching it will get you a dialog box with a reminder to
use Terminal). `/Applications/tahoe.app/bin/tahoe` is the executable. You can
symlink this to /usr/local/bin/ or ~/bin/ to make it more convenient to run.
Tahoe-LAFS can also be installed on OS-X with pip, as described in the
README.

View File

@ -1,22 +1,52 @@
#!/bin/sh #!/bin/sh
APPNAME=$1
VERSION=`sh -c "cat src/allmydata/_version.py | grep verstr | head -n 1 | cut -d' ' -f 3" | sed "s/'//g"` VERSION=`sh -c "cat src/allmydata/_version.py | grep verstr | head -n 1 | cut -d' ' -f 3" | sed "s/'//g"`
PWD=`pwd` PWD=`pwd`
TARGET="/Applications/tahoe.app"
# The editing of allmydata-tahoe.egg-link and easy-install.pth files virtualenv osx-venv
# (*in-place*) ensures that we reference the source at the correct path, osx-venv/bin/pip install .
# removing the hard-coded local source tree directory names.
# # The virtualenv contains all the dependencies we need, but the bin/python
find support -name $APPNAME.egg-link -execdir sh -c "echo >> {}; echo /Applications/tahoe.app/src >> {}" \; # itself is not useful, nor is having it as the shbang line in the generated
find support -name easy-install.pth -execdir sed -i.bak 's|^.*/src$|../../../../src|' '{}' \; # bin/tahoe executable. Replace bin/tahoe with a form that explicitly sets
# sys.path to the target directory (/Applications/tahoe.app). This isn't as
# isolated as a proper virtualenv would be (the system site-packages
# directory will still appear later in sys.path), but I think it ought to
# work.
rm osx-venv/bin/*
cat >osx-venv/bin/tahoe <<EOF
#!/usr/bin/env python
import sys, os.path
up = os.path.dirname
bintahoe = os.path.abspath(__file__)
appdir = up(up(bintahoe))
sitedir = os.path.join(appdir, "lib", "python2.7", "site-packages")
# usually "/Applications/tahoe.app/lib/python2.7/site-packages"
sys.path.insert(0, sitedir)
from allmydata.scripts.runner import run
run()
EOF
chmod +x osx-venv/bin/tahoe
# The venv has a .pth file which allows "import zope.interface" to work even
# though "zope" isn't really a package (it has no __init__.py). The venv's
# python has this site-packages/ on sys.path early enough to process the .pth
# file, and running tahoe with PYTHONPATH=...site-packages would also process
# it, but a simple sys.path.insert doesn't. This is the simplest hack I could
# find to fix it.
touch osx-venv/lib/python2.7/site-packages/zope/__init__.py
cp -r $PWD/misc/build_helpers/osx/Contents osx-venv/Contents
# create component pkg # create component pkg
pkgbuild --root "$PWD" \ pkgbuild --root osx-venv \
--identifier com.leastauthority.tahoe \ --identifier com.leastauthority.tahoe \
--version "$VERSION" \ --version "$VERSION" \
--ownership recommended \ --ownership recommended \
--install-location /Applications/tahoe.app \ --install-location $TARGET \
--scripts "$PWD/misc/build_helpers/osx/scripts" \ --scripts "$PWD/misc/build_helpers/osx/scripts" \
tahoe-lafs.pkg tahoe-lafs.pkg

View File

Before

Width:  |  Height:  |  Size: 362 B

After

Width:  |  Height:  |  Size: 362 B

View File

@ -32,14 +32,16 @@
<pkg-ref id="com.leastauthority.tahoe" version="1.10.0" auth="Root">tahoe-lafs.pkg</pkg-ref> <pkg-ref id="com.leastauthority.tahoe" version="1.10.0" auth="Root">tahoe-lafs.pkg</pkg-ref>
<license language="en" mime-type="text/plain"><![CDATA[ <license language="en" mime-type="text/plain"><![CDATA[
Copyright 2006-2014 The Tahoe-LAFS Software Foundation Copyright 2006-2016 The Tahoe-LAFS Software Foundation
You may use this package under the GNU General Public License, version 2 or, at You may use this package under the GNU General Public License,
your option, any later version. You may use this package under the Transitive version 2 or, at your option, any later version. You may use
Grace Period Public Licence, version 1.0, or at your option, any later this package under the Transitive Grace Period Public Licence,
version. (You may choose to use this package under the terms of either licence, version 1.0, or at your option, any later version. (You may
at your option.) See the file 'COPYING.GPL' for the terms of the GNU General choose to use this package under the terms of either licence,
Public License, version 2. See the file 'COPYING.TGPPL.rst' for the terms of at your option.) See the file 'COPYING.GPL' for the terms of
the Transitive Grace Period Public Licence, version 1.0. the GNU General Public License, version 2. See the file
'COPYING.TGPPL.rst' for the terms of the Transitive Grace
Period Public Licence, version 1.0.
]]></license> ]]></license>
</installer-script> </installer-script>