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 104 105 106 107 108 109 110 111 112 113
|
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: 2024-14-19
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(-)
Index: omniorb-dfsg/mk/beforeauto.mk.in
===================================================================
--- omniorb-dfsg.orig/mk/beforeauto.mk.in
+++ omniorb-dfsg/mk/beforeauto.mk.in
@@ -42,8 +42,8 @@ INSTALLTARGET := 1
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
Index: omniorb-dfsg/src/tool/omniidl/python2/scripts/omniidl.in
===================================================================
--- omniorb-dfsg.orig/src/tool/omniidl/python2/scripts/omniidl.in
+++ omniorb-dfsg/src/tool/omniidl/python2/scripts/omniidl.in
@@ -43,9 +43,9 @@ import os, os.path
pylibdir = archlibdir = None
binarchdir = os.path.abspath(os.path.dirname(sys.argv[0]))
-# Try a path based on the installation prefix
+# Try a path based on the installation prefix, customised for Debian
py_version = ".".join(sys.version.split(".")[:2])
-sppath = "@prefix@/lib/python" + py_version + "/site-packages"
+sppath = "@prefix@/lib/omniidl"
if os.path.isdir(sppath):
sys.path.append(sppath)
@@ -93,22 +93,6 @@ if binarchdir != "":
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" + py_version + "/site-packages")
-
-paths = [ "@exec_prefix@/lib/python" + py_version + "/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("${PYTHON_EXEC_PREFIX}", "@exec_prefix@")
- path = path.replace("${prefix}", "@prefix@")
- path = path.replace("${PYTHON_PREFIX}", "@prefix@")
- sys.path.append(path)
-
try:
import _omniidl
except ImportError, msg:
Index: omniorb-dfsg/src/tool/omniidl/python3/scripts/omniidl.in
===================================================================
--- omniorb-dfsg.orig/src/tool/omniidl/python3/scripts/omniidl.in
+++ omniorb-dfsg/src/tool/omniidl/python3/scripts/omniidl.in
@@ -43,12 +43,11 @@ import os, os.path
pylibdir = archlibdir = None
binarchdir = os.path.abspath(os.path.dirname(sys.argv[0]))
-# Try a path based on the installation prefix
py_version = ".".join(sys.version.split(".")[:2])
-sppath = "@prefix@/lib/python" + py_version + "/site-packages"
-if os.path.isdir(sppath):
- sys.path.append(sppath)
+# omniidl module should be found under the /usr/lib tree
+omniidldir = os.path.join("/", "usr", "lib", "omniidl")
+sys.path.insert(0, omniidldir)
# Paths in a traditional omni tree
if binarchdir != "":
@@ -93,22 +92,6 @@ if binarchdir != "":
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" + py_version + "/site-packages")
-
-paths = [ "@exec_prefix@/lib/python" + py_version + "/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("${PYTHON_EXEC_PREFIX}", "@exec_prefix@")
- path = path.replace("${prefix}", "@prefix@")
- path = path.replace("${PYTHON_PREFIX}", "@prefix@")
- sys.path.append(path)
-
try:
import _omniidl
except ImportError as msg:
|