setup.py: always install ttx manpage (even when not used); remove platform-specific branch

It's not a good thing that we build different wheel packages (with/without data_files) according to the platform we build them with.
After all, these wheels are meant to be "universal".

Even when manpages can't be used on a target platform (e.g. Windows), their mere presence should not do any harm; they are simply copied to a 'share/man' folder relative to the python prefix. On Unix systems (Linux, Homebrew, etc.) this is usually `/usr` or `/usr/local`, so `man ttx` just works (TM).

Note that other popular python tools like IPython or Sympy also install manpages the same way we do here with ttx, and they do that unconditionally for all platforms.

As regards issue #796, whereby attempting to `sudo pip install fonttools` fails because the manpage file is copied to a SIP-protected location on OSX El Capitan and above:

Users who still wish to install fonttools globally with sudo (and are not scared after googling 'why sudo pip is bad'), can still use the '--install-data' option of setup.py install to modify the data_files base installation directory.

If you install with pip (recommended over `python setup.py install`), you can use --install-option to pass through installation options to setup.py (which is run by pip when installing from source).

For example, to install man pages to /usr/local/share/man/man1/*.1 you could pass "/usr/local" as the base directory for --install-data, like so:

sudo -H /usr/bin/python -m pip install --install-option="--install-data=/usr/local" fonttools
This commit is contained in:
Cosimo Lupo 2017-01-09 15:54:25 +00:00
parent 49bcbb916b
commit fb6d3f6356
No known key found for this signature in database
GPG Key ID: B61AAAD0B53A6419

View File

@ -276,7 +276,7 @@ setup(
include_package_data=True, include_package_data=True,
data_files=[ data_files=[
('share/man/man1', ["Doc/ttx.1"]) ('share/man/man1', ["Doc/ttx.1"])
] if sys.platform.startswith('linux') else [], ],
setup_requires=pytest_runner + wheel + bumpversion, setup_requires=pytest_runner + wheel + bumpversion,
tests_require=[ tests_require=[
'pytest>=2.8', 'pytest>=2.8',