Skip to content
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

setup.py: use PKG_CONFIG env var to get the pkg-config to use #1387

Merged
merged 1 commit into from
Apr 27, 2024
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
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,17 @@ def get_config_from_pkg_config():
"""
Get distutils-compatible extension arguments using pkg-config.
"""
pkg_config = os.environ.get('PKG_CONFIG', 'pkg-config')
try:
raw_cflags = subprocess.check_output(
["pkg-config", "--cflags", "--libs"]
[pkg_config, "--cflags", "--libs"]
+ ["lib" + name for name in FFMPEG_LIBRARIES]
)
except FileNotFoundError:
print("pkg-config is required for building PyAV")
print(f"{pkg_config} is required for building PyAV")
exit(1)
except subprocess.CalledProcessError:
print("pkg-config could not find libraries {}".format(FFMPEG_LIBRARIES))
print(f"{pkg_config} could not find libraries {FFMPEG_LIBRARIES}")
exit(1)

known, unknown = parse_cflags(raw_cflags.decode("utf-8"))
Expand Down
Loading