Skip to content

Commit d4304da

Browse files
committed
Fix python site-packages dir
Fixes the need for PYTHONPATH on Gentoo Signed-off-by: Alec Ari <neotheuser@ymail.com>
1 parent 658d666 commit d4304da

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

debian/linuxcnc.install.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ usr/bin/xyzbc-trt-gui
110110

111111
usr/lib/lib*.so.*
112112
usr/lib/linuxcnc
113-
usr/lib/python3
113+
usr/lib/python3*
114114
usr/lib/tcltk
115115

116116
usr/share/axis

lib/python/qtvcp/designer/install_script

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
SITEPY=$(python3 -c "import site; print([p for p in site.getsitepackages() if p.startswith('/usr/lib') and '/lib64/' not in p][0])")
4+
35
# install base packages for displaying qtvcp screens and sounds
46
echo -e '\ninstalling common base packages'
57
sudo apt-get install -y gstreamer1.0-tools espeak espeak-ng sound-theme-freedesktop
@@ -62,11 +64,11 @@ if [ "$response" -eq 2 ]; then
6264
# for full LinuxCNC installation
6365
elif [ "$response" -eq 3 ]; then
6466
# check for valid plugin file
65-
if [ -f /usr/lib/python3/dist-packages/qtvcp/plugins/qtvcp_plugin.py ]; then
66-
pifile=/usr/lib/python3/dist-packages/qtvcp/plugins/qtvcp_plugin.py
67+
if [ -f "${SITEPY}/qtvcp/plugins/qtvcp_plugin.py" ]; then
68+
pifile="${SITEPY}/qtvcp/plugins/qtvcp_plugin.py"
6769
else
6870
# clear
69-
echo -e '\n'"$pifile "'not found in /usr/lib/python3/dist-packages/qtvcp/plugins/'
71+
echo -e '\n'"$pifile "'not found in ${SITEPY}/qtvcp/plugins/'
7072
echo -e '\ncannot continue designer installation\n'
7173
exit
7274
fi

scripts/setup_designer.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
SITEPY=$(python3 -c "import site; print([p for p in site.getsitepackages() if p.startswith('/usr/lib') and '/lib64/' not in p][0])")
4+
35
# install base packages for displaying qtvcp screens and sounds
46
echo -e '\ninstalling common base packages'
57
sudo apt-get install -y gstreamer1.0-tools espeak espeak-ng sound-theme-freedesktop
@@ -62,11 +64,11 @@ if [ "$response" -eq 2 ]; then
6264
# for full LinuxCNC installation
6365
elif [ "$response" -eq 3 ]; then
6466
# check for valid plugin file
65-
if [ -f /usr/lib/python3/dist-packages/qtvcp/plugins/qtvcp_plugin.py ]; then
66-
pifile=/usr/lib/python3/dist-packages/qtvcp/plugins/qtvcp_plugin.py
67+
if [ -f "${SITEPY}/qtvcp/plugins/qtvcp_plugin.py" ]; then
68+
pifile="${SITEPY}/qtvcp/plugins/qtvcp_plugin.py"
6769
else
6870
# clear
69-
echo -e '\n'"$pifile"' not found in /usr/lib/python3/dist-packages/qtvcp/plugins/'
71+
echo -e '\n'"$pifile"' not found in "${SITEPY}/qtvcp/plugins/'
7072
echo -e '\ncannot continue designer installation\n'
7173
exit
7274
fi

src/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ fi
16571657
AC_MSG_RESULT([$PYTHON_TK_VERSION])
16581658

16591659
AC_MSG_CHECKING(for site-package location)
1660-
SITEPY="$($PYTHON -c 'import sysconfig; s = sysconfig.get_scheme_names(); m=list(set(("deb_system", "rpm_prefix")) & set(s)); print(sysconfig.get_path("platlib", m.__getitem__(0))) if m else print("/usr/lib/python3/dist-packages");')"
1660+
SITEPY="$PYTHON_SITE_PKG"
16611661
AC_MSG_RESULT($SITEPY)
16621662

16631663
AC_MSG_CHECKING(for working GLU quadrics)

0 commit comments

Comments
 (0)