1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
From: Floris Bruynooghe <flub@devork.be>
Date: Fri, 18 Jun 2021 13:32:35 +0200
Subject: Place omniidl python modules in a private directory
Forwarded: no
Last-Update: 2011-07-21
The omniidl code is not meant as importable code but just to make the
tool work. Therefore it should live in /usr/lib/omniidl in Debian.
This also helps dh_python2 do the right thing.
---
mk/beforeauto.mk.in | 4 ++--
src/tool/omniidl/python/scripts/omniidl.in | 18 ++----------------
src/tool/omniidl/python3/scripts/omniidl.in | 24 +++++-------------------
3 files changed, 9 insertions(+), 37 deletions(-)
--- a/mk/beforeauto.mk.in
+++ b/mk/beforeauto.mk.in
@@ -40,8 +40,8 @@
INSTALLINCDIR := $(DESTDIR)@includedir@
INSTALLBINDIR := $(DESTDIR)@bindir@
INSTALLLIBDIR := $(DESTDIR)@libdir@
-INSTALLPYTHONDIR := $(DESTDIR)@pythondir@
-INSTALLPYEXECDIR := $(DESTDIR)@pyexecdir@
+INSTALLPYTHONDIR := $(DESTDIR)/usr/lib/omniidl
+INSTALLPYEXECDIR := $(DESTDIR)/usr/lib/omniidl
INSTALLIDLDIR := $(DESTDIR)@datadir@/idl
--- a/src/tool/omniidl/python/scripts/omniidl.in
+++ b/src/tool/omniidl/python/scripts/omniidl.in
@@ -43,8 +43,8 @@
pylibdir = archlibdir = None
binarchdir = os.path.abspath(os.path.dirname(sys.argv[0]))
-# Try a path based on the installation prefix
-sppath = "@prefix@/lib/python" + sys.version[:3] + "/site-packages"
+# Try a path based on the installation prefix, customised for Debian
+sppath = "@prefix@/lib/omniidl"
if os.path.isdir(sppath):
sys.path.append(sppath)
@@ -92,20 +92,6 @@
if os.path.isdir(archlibdir):
sys.path.insert(0, archlibdir)
-# Last chance, try a path based on the installation prefixes
-sys.path.append("@prefix@/lib/python" + sys.version[:3] + "/site-packages")
-
-paths = [ "@exec_prefix@/lib/python" + sys.version[:3] + "/site-packages",
- "@pythondir@",
- "@pyexecdir@" ]
-
-
-# Autoconf insists on making our life difficult...
-for path in paths:
- path = path.replace("${exec_prefix}", "@exec_prefix@")
- path = path.replace("${prefix}", "@prefix@")
- sys.path.append(path)
-
try:
import _omniidl
except ImportError, msg:
--- a/src/tool/omniidl/python3/scripts/omniidl.in
+++ b/src/tool/omniidl/python3/scripts/omniidl.in
@@ -43,11 +43,11 @@
pylibdir = archlibdir = None
binarchdir = os.path.abspath(os.path.dirname(sys.argv[0]))
-# Try a path based on the installation prefix
-sppath = "@prefix@/lib/python" + sys.version[:3] + "/site-packages"
-
-if os.path.isdir(sppath):
- sys.path.append(sppath)
+omniidldir = "/does-not-exist"
+if binarchdir == "/usr/bin":
+ omniidldir = os.path.join(os.path.dirname(binarchdir), "lib", "omniidl")
+if os.path.isdir(omniidldir):
+ sys.path.insert(0, omniidldir)
# Paths in a traditional omni tree
if binarchdir != "":
@@ -92,20 +92,6 @@
if os.path.isdir(archlibdir):
sys.path.insert(0, archlibdir)
-# Last chance, try a path based on the installation prefixes
-sys.path.append("@prefix@/lib/python" + sys.version[:3] + "/site-packages")
-
-paths = [ "@exec_prefix@/lib/python" + sys.version[:3] + "/site-packages",
- "@pythondir@",
- "@pyexecdir@" ]
-
-
-# Autoconf insists on making our life difficult...
-for path in paths:
- path = path.replace("${exec_prefix}", "@exec_prefix@")
- path = path.replace("${prefix}", "@prefix@")
- sys.path.append(path)
-
try:
import _omniidl
except ImportError as msg:
|