You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/media-video/miro/files/miro-2.5.3-remove-pkg-confi...

75 lines
2.8 KiB

From b5acbb41f5c6b2c4ce3b4a6944459ea425d7f971 Mon Sep 17 00:00:00 2001
From: Mounir Lamouri (volkmar) <mounir.lamouri@gmail.com>
Date: Sat, 28 Nov 2009 14:39:19 +0100
Subject: [PATCH] Remove use of 'pkg-config --list-all' to 'pkg-config --exists'.
Fix bug 4613.
---
platform/gtk-x11/setup.py | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/platform/gtk-x11/setup.py b/platform/gtk-x11/setup.py
index a731ff6..94dc72a 100755
--- a/platform/gtk-x11/setup.py
+++ b/platform/gtk-x11/setup.py
@@ -297,6 +297,14 @@ def parse_pkg_config(command, components, options_dict = None):
return options_dict
+def package_exist(package_name):
+ """
+ Return True if the package is present in the system. False otherwise.
+ The check is made with pkg-config.
+ """
+ # pkg-config returs 0 if the package is present
+ return subprocess.call(['pkg-config', '--exists', package_name]) == 0
+
def compile_xine_extractor():
rv = os.system("gcc %s -o %s `pkg-config --libs --cflags gdk-pixbuf-2.0 glib-2.0 libxine`" %
(os.path.join(platform_dir, "xine/xine_extractor.c"), os.path.join(platform_dir, "xine/xine_extractor")))
@@ -346,11 +354,6 @@ fi
#### MozillaBrowser Extension ####
def get_mozilla_stuff():
- try:
- packages = get_command_output("pkg-config --list-all")
- except RuntimeError, error:
- sys.exit("Package config error:\n%s" % (error,))
-
if XPCOM_LIB and GTKMOZEMBED_LIB and XULRUNNER_19 != None:
print "\nUsing XPCOM_LIB, GTKMOZEMBED_LIB and XULRUNNER_19 values...."
xulrunner19 = XULRUNNER_19
@@ -360,24 +363,24 @@ def get_mozilla_stuff():
else:
print "\nTrying to figure out xpcom_lib, gtkmozembed_lib, and xulrunner_19 values...."
xulrunner19 = False
- if re.search("^libxul", packages, re.MULTILINE):
+ if package_exist('libxul'):
xulrunner19 = True
xpcom_lib = 'libxul'
gtkmozembed_lib = 'libxul'
- elif re.search("^xulrunner-xpcom", packages, re.MULTILINE):
+ elif package_exist('xulrunner-xpcom'):
xpcom_lib = 'xulrunner-xpcom'
gtkmozembed_lib = 'xulrunner-gtkmozembed'
- elif re.search("^seamonkey-xpcom", packages, re.MULTILINE):
+ elif package_exist('seamonkey-xpcom'):
xpcom_lib = 'seamonkey-xpcom'
gtkmozembed_lib = 'seamonkey-gtkmozembed'
- elif re.search("^mozilla-xpcom", packages, re.MULTILINE):
+ elif package_exist('mozilla-xpcom'):
xpcom_lib = 'mozilla-xpcom'
gtkmozembed_lib = 'mozilla-gtkmozembed'
- elif re.search("^firefox-xpcom", packages, re.MULTILINE):
+ elif package_exist('firefox-xpcom'):
xpcom_lib = 'firefox-xpcom'
gtkmozembed_lib = 'firefox-gtkmozembed'
--
1.6.3.3