From ada36a3ee504ab11fd03fd338925712106a1ad52 Mon Sep 17 00:00:00 2001 From: FestplattenSchnitzel Date: Mon, 8 Aug 2022 18:06:30 +0200 Subject: [PATCH] Fix l10n broken in venvs --- setup.py | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/setup.py b/setup.py index 741b6877..0cc4e88c 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -import os import re import subprocess import sys @@ -50,30 +49,20 @@ class InstallWithCompile(install): def get_data_files(): - # workaround issue on OSX or --user installs, where sys.prefix is not an installable location - if os.access(sys.prefix, os.W_OK | os.X_OK): - data_prefix = sys.prefix - else: - data_prefix = '.' - data_files = [] with open('MANIFEST.in') as fp: data = fp.read() data_files.append( - ( - data_prefix + '/share/doc/fdroidserver/examples', - ['buildserver/config.buildserver.yml'] - + re.findall(r'include (examples/.*)', data), - ) + ('share/doc/fdroidserver/examples', re.findall(r'include (examples/.*)', data)) + ) + data_files.append( + ('share/doc/fdroidserver/examples', ['buildserver/config.buildserver.yml']) ) - for f in re.findall( - r'include (locale/[a-z][a-z][a-zA-Z_]*/LC_MESSAGES/fdroidserver\.)po', data - ): - f += 'mo' - d = os.path.join(data_prefix, 'share', os.path.dirname(f)) - data_files.append((d, [f])) + for d in re.findall(r'include (locale/.*)/fdroidserver\.po', data): + data_files.append(('share/' + d, [d + '/fdroidserver.mo'])) + return data_files