Skip to content

Commit

Permalink
Also search the LICENSE file in lib64/pythonX.Y
Browse files Browse the repository at this point in the history
Several Linux distributions including Gentoo, Fedora, openSUSE
put things in lib64/pythonX.Y instead of lib/pythonX.Y on 64bit
architectures (x86_64, aarch64, etc.).

This was already respected via the fix_lib64() function, however
when virtualenv was searching for Python LICENSE, it was not.

Now is the lib64/pythonX.Y patch searched as well and unlike fix_lib64()
no checks need to be made, as the patch are tested in sequence.

See pypa#1352 (comment)
  • Loading branch information
hroncok committed Jul 12, 2019
1 parent d997faa commit 01e27bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1333,9 +1333,12 @@ def copy_required_files(src_dir, lib_dir, symlink):

def copy_license(prefix, dst_prefix, lib_dir, symlink):
"""Copy the license file so `license()` builtin works"""
lib64_dir = lib_dir.replace("lib", "lib64")
for license_path in (
# posix cpython
os.path.join(prefix, os.path.relpath(lib_dir, dst_prefix), "LICENSE.txt"),
# posix cpython installed in /usr/lib64
os.path.join(prefix, os.path.relpath(lib64_dir, dst_prefix), "LICENSE.txt"),
# windows cpython
os.path.join(prefix, "LICENSE.txt"),
# pypy
Expand Down

0 comments on commit 01e27bd

Please sign in to comment.