Skip to content

Commit 8e7d649

Browse files
authored
Merge pull request #1491 from JonasT/reportlabgplfix
Fix reportlab GPL issue by removing problematic component
2 parents 0cb9ade + 85ff98b commit 8e7d649

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pythonforandroid/recipes/reportlab/__init__.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,20 @@ class ReportLabRecipe(CompiledComponentsPythonRecipe):
1313
def prebuild_arch(self, arch):
1414
if not self.is_patched(arch):
1515
super(ReportLabRecipe, self).prebuild_arch(arch)
16-
self.apply_patch('patches/fix-setup.patch', arch.arch)
1716
recipe_dir = self.get_build_dir(arch.arch)
17+
18+
# Some versions of reportlab ship with a GPL-licensed font.
19+
# Remove it, since this is problematic in .apks unless the
20+
# entire app is GPL:
21+
font_dir = os.path.join(recipe_dir,
22+
"src", "reportlab", "fonts")
23+
if os.path.exists(font_dir):
24+
for l in os.listdir(font_dir):
25+
if l.lower().startswith('darkgarden'):
26+
os.remove(os.path.join(font_dir, l))
27+
28+
# Apply patches:
29+
self.apply_patch('patches/fix-setup.patch', arch.arch)
1830
shprint(sh.touch, os.path.join(recipe_dir, '.patched'))
1931
ft = self.get_recipe('freetype', self.ctx)
2032
ft_dir = ft.get_build_dir(arch.arch)

0 commit comments

Comments
 (0)