setup.py: use relative paths in data_files
fixes https://github.com/spesmilo/electrum/issues/7787 fixes https://github.com/spesmilo/electrum/issues/5227 closes https://github.com/spesmilo/electrum/pull/5553
This commit is contained in:
18
setup.py
18
setup.py
@@ -33,21 +33,11 @@ version_spec.loader.exec_module(version_module)
|
||||
data_files = []
|
||||
|
||||
if platform.system() in ['Linux', 'FreeBSD', 'DragonFly']:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--root=', dest='root_path', metavar='dir', default='/')
|
||||
opts, _ = parser.parse_known_args(sys.argv[1:])
|
||||
usr_share = os.path.join(sys.prefix, "share")
|
||||
icons_dirname = 'pixmaps'
|
||||
if not os.access(opts.root_path + usr_share, os.W_OK) and \
|
||||
not os.access(opts.root_path, os.W_OK):
|
||||
icons_dirname = 'icons'
|
||||
if 'XDG_DATA_HOME' in os.environ.keys():
|
||||
usr_share = os.environ['XDG_DATA_HOME']
|
||||
else:
|
||||
usr_share = os.path.expanduser('~/.local/share')
|
||||
# note: we can't use absolute paths here. see #7787
|
||||
data_files += [
|
||||
(os.path.join(usr_share, 'applications/'), ['electrum.desktop']),
|
||||
(os.path.join(usr_share, icons_dirname), ['electrum/gui/icons/electrum.png']),
|
||||
(os.path.join('share', 'applications'), ['electrum.desktop']),
|
||||
(os.path.join('share', 'pixmaps'), ['electrum/gui/icons/electrum.png']),
|
||||
(os.path.join('share', 'icons/hicolor/128x128/apps'), ['electrum/gui/icons/electrum.png']),
|
||||
]
|
||||
|
||||
extras_require = {
|
||||
|
||||
Reference in New Issue
Block a user