Skip to content

Commit 871c7f9

Browse files
misl6ShyamQt
authored andcommitted
Use p4a_install instead of install, as a file named INSTALL is already present. (kivy#2663)
1 parent 7168dac commit 871c7f9

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

pythonforandroid/recipes/liblzma/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
from pythonforandroid.archs import Arch
77
from pythonforandroid.logger import shprint
88
from pythonforandroid.recipe import Recipe
9-
from pythonforandroid.util import current_directory, ensure_dir
9+
from pythonforandroid.util import current_directory
1010

1111

1212
class LibLzmaRecipe(Recipe):
1313

1414
version = '5.2.4'
1515
url = 'https://tukaani.org/xz/xz-{version}.tar.gz'
16-
built_libraries = {'liblzma.so': 'install/lib'}
16+
built_libraries = {'liblzma.so': 'p4a_install/lib'}
1717

1818
def build_arch(self, arch: Arch) -> None:
1919
env = self.get_recipe_env(arch)
20-
install_dir = join(self.get_build_dir(arch.arch), 'install')
20+
install_dir = join(self.get_build_dir(arch.arch), 'p4a_install')
2121
with current_directory(self.get_build_dir(arch.arch)):
2222
if not exists('configure'):
2323
shprint(sh.Command('./autogen.sh'), _env=env)
@@ -42,7 +42,6 @@ def build_arch(self, arch: Arch) -> None:
4242
_env=env
4343
)
4444

45-
ensure_dir('install')
4645
shprint(sh.make, 'install', _env=env)
4746

4847
def get_library_includes(self, arch: Arch) -> str:
@@ -52,7 +51,7 @@ def get_library_includes(self, arch: Arch) -> str:
5251
variable `CPPFLAGS`.
5352
"""
5453
return " -I" + join(
55-
self.get_build_dir(arch.arch), 'install', 'include',
54+
self.get_build_dir(arch.arch), 'p4a_install', 'include',
5655
)
5756

5857
def get_library_ldflags(self, arch: Arch) -> str:

tests/recipes/test_liblzma.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_get_library_includes(self):
1515
recipe_build_dir = self.recipe.get_build_dir(self.arch.arch)
1616
self.assertEqual(
1717
self.recipe.get_library_includes(self.arch),
18-
f" -I{join(recipe_build_dir, 'install/include')}",
18+
f" -I{join(recipe_build_dir, 'p4a_install/include')}",
1919
)
2020

2121
def test_get_library_ldflags(self):
@@ -25,11 +25,27 @@ def test_get_library_ldflags(self):
2525
recipe_build_dir = self.recipe.get_build_dir(self.arch.arch)
2626
self.assertEqual(
2727
self.recipe.get_library_ldflags(self.arch),
28-
f" -L{join(recipe_build_dir, 'install/lib')}",
28+
f" -L{join(recipe_build_dir, 'p4a_install/lib')}",
2929
)
3030

3131
def test_link_libs_flags(self):
3232
"""
3333
Test :meth:`~pythonforandroid.recipes.liblzma.get_library_libs_flag`.
3434
"""
3535
self.assertEqual(self.recipe.get_library_libs_flag(), " -llzma")
36+
37+
def test_install_dir_not_named_install(self):
38+
"""
39+
Tests that the install directory is not named ``install``.
40+
41+
liblzma already have a file named ``INSTALL`` in its source directory.
42+
On case-insensitive filesystems, using a folder named ``install`` will
43+
cause a conflict. (See issue: #2343).
44+
45+
WARNING: This test is quite flaky, but should be enough to
46+
ensure that someone in the future will not accidentally rename
47+
the install directory without seeing this test to fail.
48+
"""
49+
liblzma_install_dir = self.recipe.built_libraries["liblzma.so"]
50+
51+
self.assertNotIn("install", liblzma_install_dir.split("/"))

0 commit comments

Comments
 (0)