summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am11
-rw-r--r--gtk/Makefile.am8
-rw-r--r--gtk/__init__.py15
-rw-r--r--ltihooks.py60
-rw-r--r--tests/common.py10
6 files changed, 15 insertions, 90 deletions
diff --git a/.gitignore b/.gitignore
index a2ac9c60..426ab64e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,6 +33,7 @@ stamp-h1
*.o
*.pc
*.pyc
+*.so
.deps
.libs
diff --git a/Makefile.am b/Makefile.am
index 1ed51965..24727273 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -44,10 +44,6 @@ pkgconfig_DATA += pygtk-$(PLATFORM_VERSION).pc
defsdir = $(pkgdatadir)/$(PLATFORM_VERSION)/defs
defs_DATA =
-# python
-pyexec_LTLIBRARIES =
-noinst_PYTHON = ltihooks.py
-
# pygtk scripts
pkgpythondir = $(pyexecdir)/gtk-2.0
@@ -141,3 +137,10 @@ doc-dist:
cp -r docs/cursors/* pygtk/cursors
tar cfz $(PACKAGE)-docs.tar.gz pygtk
rm -fr pygtk
+
+
+all: $(pkgpyexec_LTLIBRARIES:.la=.so)
+clean-local:
+ rm -f $(pkgpyexec_LTLIBRARIES:.la=.so)
+.la.so:
+ $(LN_S) .libs/$@ $@ || true
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 20212202..b9ec8f39 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -195,7 +195,7 @@ CLEANFILES += \
gtkunixprint.c \
gtkunixprint.defs \
gtkunixprint-types.defs
-
+
EXTRA_DIST += \
$(GTKUNIXPRINT_DEFS) \
@@ -248,3 +248,9 @@ endif
gtk-types.c:
@:
+
+all: $(pygtkexec_LTLIBRARIES:.la=.so) $(pkgpyexec_LTLIBRARIES:.la=.so)
+clean-local:
+ rm -f $(pygtkexec_LTLIBRARIES:.la=.so) $(pkgpyexec_LTLIBRARIES:.la=.so)
+.la.so:
+ $(LN_S) .libs/$@ $@ || true
diff --git a/gtk/__init__.py b/gtk/__init__.py
index e2733dcc..92af8696 100644
--- a/gtk/__init__.py
+++ b/gtk/__init__.py
@@ -22,14 +22,6 @@
import sys
-# this can go when things are a little further along
-try:
- import ltihooks
- # pyflakes
- ltihooks
-except ImportError:
- ltihooks = None
-
# For broken embedded programs which forgot to call Sys_SetArgv
if not hasattr(sys, 'argv'):
sys.argv = []
@@ -49,13 +41,6 @@ else:
import gdk
-if ltihooks:
- try:
- ltihooks.uninstall()
- del ltihooks
- except:
- pass
-
from gtk._lazyutils import LazyNamespace, LazyModule
from gtk.deprecation import _Deprecated, _DeprecatedConstant
diff --git a/ltihooks.py b/ltihooks.py
deleted file mode 100644
index bbc25df6..00000000
--- a/ltihooks.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# -*- Mode: Python; py-indent-offset: 4 -*-
-# ltihooks.py: python import hooks that understand libtool libraries.
-# Copyright (C) 2000 James Henstridge.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-import os, ihooks
-
-class LibtoolHooks(ihooks.Hooks):
- def get_suffixes(self):
- """Like normal get_suffixes, but adds .la suffixes to list"""
- ret = ihooks.Hooks.get_suffixes(self)
- ret.insert(0, ('module.la', 'rb', 3))
- ret.insert(0, ('.la', 'rb', 3))
- return ret
-
- def load_dynamic(self, name, filename, file=None):
- """Like normal load_dynamic, but treat .la files specially"""
- if len(filename) > 3 and filename[-3:] == '.la':
- fp = open(filename, 'r')
- dlname = ''
- installed = 1
- line = fp.readline()
- while line:
- if len(line) > 7 and line[:7] == 'dlname=':
- dlname = line[8:-2]
- elif len(line) > 10 and line[:10] == 'installed=':
- installed = line[10:-1] == 'yes'
- line = fp.readline()
- fp.close()
- if dlname:
- if installed:
- filename = os.path.join(os.path.dirname(filename),
- dlname)
- else:
- filename = os.path.join(os.path.dirname(filename),
- '.libs', dlname)
- return ihooks.Hooks.load_dynamic(self, name, filename, file)
-
-importer = ihooks.ModuleImporter()
-importer.set_hooks(LibtoolHooks())
-
-def install():
- importer.install()
-def uninstall():
- importer.uninstall()
-
-install()
diff --git a/tests/common.py b/tests/common.py
index dfc34012..33216e1e 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -7,29 +7,19 @@ def importModules(buildDir, srcDir):
# Be very careful when you change this code, it's
# fragile and the order is really significant
- # ltihooks
- sys.path.insert(0, srcDir)
# atk, pango
sys.path.insert(0, buildDir)
# _gtk, keysyms, glade
sys.path.insert(0, os.path.join(buildDir, 'gtk'))
sys.argv.append('--g-fatal-warnings')
- import ltihooks
atk = importModule('atk', buildDir)
pango = importModule('pango', buildDir)
gtk = importModule('gtk', buildDir, 'gtk')
gdk = importModule('gtk.gdk', buildDir, '_gdk.la')
- # gtk/__init__.py removes the ltihooks, readd them
- import gtk
-
- ltihooks.install()
glade = importModule('gtk.glade', buildDir)
- ltihooks.uninstall()
- del ltihooks
-
globals().update(locals())
os.environ['PYGTK_USE_GIL_STATE_API'] = ''