diff --git a/setup.py b/setup.py index 0b3ce00f7..9f43f5f27 100644 --- a/setup.py +++ b/setup.py @@ -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"))