-sr_includes, sr_lib_dirs, sr_libs, (sr_version,) = [
- subprocess.check_output(
- ["pkg-config", option, "glib-2.0", "glibmm-2.4", "pygobject-3.0"]
- ).decode().rstrip().split(' ')
- for option in
- ("--cflags-only-I", "--libs-only-L", "--libs-only-l", "--modversion")]
+# Override the default compile flags used by distutils.
+os.environ['OPT'] = ''
+
+# Parse the command line arguments for VAR=value assignments,
+# and apply them as environment variables.
+while len(sys.argv) > 1:
+ match = re.match(r'([A-Z]+)=(.*)', sys.argv[1])
+ if match is None:
+ break
+ os.environ[match.group(1)] = match.group(2)
+ del sys.argv[1]