From 4aad94e9d68375e62d385ffce1f062763710cf37 Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Wed, 3 Nov 2010 11:26:03 +0100 Subject: pygtk_postinstall.py: remove pygtk-2.0.pc treatment from postinstall as pkg-config on windows figures out the correct prefix at runtime --- pygtk_postinstall.py | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) (limited to 'pygtk_postinstall.py') diff --git a/pygtk_postinstall.py b/pygtk_postinstall.py index f471ca03..7651179b 100644 --- a/pygtk_postinstall.py +++ b/pygtk_postinstall.py @@ -1,39 +1,9 @@ +# -*- coding: utf-8 -*- -"""pygtk is now installed on your machine. -Local configuration files were successfully updated.""" - -import os, os.path, re, sys -import distutils.sysconfig -import distutils.file_util -import distutils.errors - -pkgconfig_file = os.path.normpath( - os.path.join(sys.prefix, - 'lib/pkgconfig/pygtk-2.0.pc')) - -prefix_pattern=re.compile("^prefix=.*") -exec_pattern=re.compile("^exec\s.*") -codegendir_pattern=re.compile("^codegendir=.*") -version_pattern=re.compile("Version: ([0-9]+\.[0-9]+\.[0-9]+)") - -def replace_prefix(s): - if prefix_pattern.match(s): - s='prefix='+sys.prefix.replace("\\","/")+'\n' - if exec_pattern.match(s): - s=('exec '+sys.prefix+'\\python.exe '+ - '$codegendir/codegen.py \"$@\"\n').replace("\\","/") - if codegendir_pattern.match(s): - s=('codegendir=' - +distutils.sysconfig.get_python_lib().replace("\\","/")+ - '/gtk-2.0/codegen' + '\n') - return s +import sys if len(sys.argv) == 2: if sys.argv[1] == "-install": - # fixup the pkgconfig file - lines=open(pkgconfig_file).readlines() - open(pkgconfig_file, 'w').writelines(map(replace_prefix,lines)) - print __doc__ - + print ('pygtk is now installed on your machine.\n') -- cgit v1.2.1