Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 268315 | Differences between
and this patch

Collapse All | Expand All

(-)a/Makefile.am (-4 / +7 lines)
Lines 44-53 pkgconfig_DATA += pygtk-$(PLATFORM_VERSION).pc Link Here
44
defsdir = $(pkgdatadir)/$(PLATFORM_VERSION)/defs
44
defsdir = $(pkgdatadir)/$(PLATFORM_VERSION)/defs
45
defs_DATA =
45
defs_DATA =
46
46
47
# python
48
pyexec_LTLIBRARIES =
49
noinst_PYTHON = ltihooks.py
50
51
# pygtk scripts
47
# pygtk scripts
52
pkgpythondir = $(pyexecdir)/gtk-2.0
48
pkgpythondir = $(pyexecdir)/gtk-2.0
53
49
Lines 141-143 doc-dist: Link Here
141
	cp -r docs/cursors/* pygtk/cursors
137
	cp -r docs/cursors/* pygtk/cursors
142
	tar cfz $(PACKAGE)-docs.tar.gz pygtk
138
	tar cfz $(PACKAGE)-docs.tar.gz pygtk
143
	rm -fr pygtk
139
	rm -fr pygtk
140
141
142
all: $(pkgpyexec_LTLIBRARIES:.la=.so)
143
clean-local:
144
	rm -f $(pkgpyexec_LTLIBRARIES:.la=.so)
145
.la.so:
146
	$(LN_S) .libs/$@ $@ || true
(-)a/gtk/Makefile.am (-1 / +7 lines)
Lines 195-201 CLEANFILES += \ Link Here
195
	gtkunixprint.c 		\
195
	gtkunixprint.c 		\
196
	gtkunixprint.defs 	\
196
	gtkunixprint.defs 	\
197
	gtkunixprint-types.defs
197
	gtkunixprint-types.defs
198
		
198
199
199
200
EXTRA_DIST +=				\
200
EXTRA_DIST +=				\
201
	$(GTKUNIXPRINT_DEFS)		\
201
	$(GTKUNIXPRINT_DEFS)		\
Lines 248-250 endif Link Here
248
gtk-types.c:
248
gtk-types.c:
249
	@:
249
	@:
250
250
251
252
all: $(pygtkexec_LTLIBRARIES:.la=.so) $(pkgpyexec_LTLIBRARIES:.la=.so)
253
clean-local:
254
	rm -f $(pygtkexec_LTLIBRARIES:.la=.so) $(pkgpyexec_LTLIBRARIES:.la=.so)
255
.la.so:
256
	$(LN_S) .libs/$@ $@ || true
(-)a/gtk/__init__.py (-15 lines)
Lines 22-35 Link Here
22
22
23
import sys
23
import sys
24
24
25
# this can go when things are a little further along
26
try:
27
    import ltihooks
28
    # pyflakes
29
    ltihooks
30
except ImportError:
31
    ltihooks = None
32
33
# For broken embedded programs which forgot to call Sys_SetArgv
25
# For broken embedded programs which forgot to call Sys_SetArgv
34
if not hasattr(sys, 'argv'):
26
if not hasattr(sys, 'argv'):
35
    sys.argv = []
27
    sys.argv = []
Lines 49-61 else: Link Here
49
41
50
import gdk
42
import gdk
51
43
52
if ltihooks:
53
    try:
54
        ltihooks.uninstall()
55
        del ltihooks
56
    except:
57
        pass
58
59
from gtk._lazyutils import LazyNamespace, LazyModule
44
from gtk._lazyutils import LazyNamespace, LazyModule
60
from gtk.deprecation import _Deprecated, _DeprecatedConstant
45
from gtk.deprecation import _Deprecated, _DeprecatedConstant
61
46
(-)a/tests/common.py (-11 lines)
Lines 7-35 def importModules(buildDir, srcDir): Link Here
7
    # Be very careful when you change this code, it's
7
    # Be very careful when you change this code, it's
8
    # fragile and the order is really significant
8
    # fragile and the order is really significant
9
9
10
    # ltihooks
11
    sys.path.insert(0, srcDir)
12
    # atk, pango
10
    # atk, pango
13
    sys.path.insert(0, buildDir)
11
    sys.path.insert(0, buildDir)
14
    # _gtk, keysyms, glade
12
    # _gtk, keysyms, glade
15
    sys.path.insert(0, os.path.join(buildDir, 'gtk'))
13
    sys.path.insert(0, os.path.join(buildDir, 'gtk'))
16
    sys.argv.append('--g-fatal-warnings')
14
    sys.argv.append('--g-fatal-warnings')
17
    import ltihooks
18
15
19
    atk = importModule('atk', buildDir)
16
    atk = importModule('atk', buildDir)
20
    pango = importModule('pango', buildDir)
17
    pango = importModule('pango', buildDir)
21
    gtk = importModule('gtk', buildDir, 'gtk')
18
    gtk = importModule('gtk', buildDir, 'gtk')
22
    gdk = importModule('gtk.gdk', buildDir, '_gdk.la')
19
    gdk = importModule('gtk.gdk', buildDir, '_gdk.la')
23
20
24
    # gtk/__init__.py removes the ltihooks, readd them
25
    import gtk
26
27
    ltihooks.install()
28
    glade = importModule('gtk.glade', buildDir)
21
    glade = importModule('gtk.glade', buildDir)
29
22
30
    ltihooks.uninstall()
31
    del ltihooks
32
33
    globals().update(locals())
23
    globals().update(locals())
34
24
35
    os.environ['PYGTK_USE_GIL_STATE_API'] = ''
25
    os.environ['PYGTK_USE_GIL_STATE_API'] = ''
36
-
(-)a/ltihooks.py (-60 lines)
Lines 1-60 Link Here
1
# -*- Mode: Python; py-indent-offset: 4 -*-
2
# ltihooks.py: python import hooks that understand libtool libraries.
3
# Copyright (C) 2000 James Henstridge.
4
#
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
9
#
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19
import os, ihooks
20
21
class LibtoolHooks(ihooks.Hooks):
22
    def get_suffixes(self):
23
        """Like normal get_suffixes, but adds .la suffixes to list"""
24
        ret = ihooks.Hooks.get_suffixes(self)
25
        ret.insert(0, ('module.la', 'rb', 3))
26
        ret.insert(0, ('.la', 'rb', 3))
27
        return ret
28
29
    def load_dynamic(self, name, filename, file=None):
30
        """Like normal load_dynamic, but treat .la files specially"""
31
        if len(filename) > 3 and filename[-3:] == '.la':
32
            fp = open(filename, 'r')
33
            dlname = ''
34
            installed = 1
35
            line = fp.readline()
36
            while line:
37
                if len(line) > 7 and line[:7] == 'dlname=':
38
                    dlname = line[8:-2]
39
                elif len(line) > 10 and line[:10] == 'installed=':
40
                    installed = line[10:-1] == 'yes'
41
                line = fp.readline()
42
            fp.close()
43
            if dlname:
44
                if installed:
45
                    filename = os.path.join(os.path.dirname(filename),
46
                                            dlname)
47
                else:
48
                    filename = os.path.join(os.path.dirname(filename),
49
                                            '.libs', dlname)
50
        return ihooks.Hooks.load_dynamic(self, name, filename, file)
51
52
importer = ihooks.ModuleImporter()
53
importer.set_hooks(LibtoolHooks())
54
55
def install():
56
    importer.install()
57
def uninstall():
58
    importer.uninstall()
59
60
install()

Return to bug 268315