Skip to content

Commit 0aa0ce0

Browse files
committed
python::python3: fix dev package
The python-dev package holds a magic sysconf module that is used by setuptools and friends to find crucial paths. In particular, the path to the include files is taken from there. So far, the module did hold absolute paths that pointed to the intended install location. That is completely wrong because the package never ends up there and needs to be relocatable. Patch the module accordingly to rewrite all absolute paths to one relative to the sysconfig module.
1 parent 4dcdbb8 commit 0aa0ce0

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

recipes/python/python3.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,16 @@ multiPackage:
101101
autotoolsPackageDev
102102
mkdir -p usr/lib/python${MAJOR_MINOR}
103103
cp $1/install/usr/lib/python${MAJOR_MINOR}/_sysconfigdata_*.py usr/lib/python${MAJOR_MINOR}
104-
# remove any absolute include-/library-paths
105-
sed -E -e "s|-[LI]/[^ ']+||" usr/lib/python${MAJOR_MINOR}/_sysconfigdata_*.py
104+
# Remove any absolute include-/library-paths and make the
105+
# data relocatable...
106+
sed -i -E \
107+
-e '1i prefix = "/".join(__file__.split("/")[:-3])' \
108+
-e "s|-[LI]/[^ ']*||g" \
109+
-e "/DESTDIRS/b" \
110+
-e "/INCLDIRSTOMAKE/b" \
111+
-e "/TZPATH/b" \
112+
-e "s|'/usr|prefix + '|" \
113+
usr/lib/python${MAJOR_MINOR}/_sysconfigdata_*.py
106114
python3 -m compileall usr/lib/python${MAJOR_MINOR}
107115
provideDeps: [ "*-dev" ]
108116

0 commit comments

Comments
 (0)