Skip to content

Fix reportlab GPL issue by removing problematic component #1491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from Nov 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion pythonforandroid/recipes/reportlab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,20 @@ class ReportLabRecipe(CompiledComponentsPythonRecipe):
def prebuild_arch(self, arch):
if not self.is_patched(arch):
super(ReportLabRecipe, self).prebuild_arch(arch)
self.apply_patch('patches/fix-setup.patch', arch.arch)
recipe_dir = self.get_build_dir(arch.arch)

# Some versions of reportlab ship with a GPL-licensed font.
# Remove it, since this is problematic in .apks unless the
# entire app is GPL:
font_dir = os.path.join(recipe_dir,
"src", "reportlab", "fonts")
if os.path.exists(font_dir):
for l in os.listdir(font_dir):
if l.lower().startswith('darkgarden'):
os.remove(os.path.join(font_dir, l))

# Apply patches:
self.apply_patch('patches/fix-setup.patch', arch.arch)
shprint(sh.touch, os.path.join(recipe_dir, '.patched'))
ft = self.get_recipe('freetype', self.ctx)
ft_dir = ft.get_build_dir(arch.arch)
Expand Down