Skip to content

Commit 94da62c

Browse files
committed
Set PYTHONHOME in pythonIoc runner
This allows any virtual env to be picked up.
1 parent ad9a395 commit 94da62c

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ include $(TOP)/configure/RULES_TOP
1111
# succuessfully import the softioc library.
1212
SPHINX_BUILD := $(shell readlink -f $$(which sphinx-build))
1313

14+
PYTHONHOME := $(shell $(PYTHON) -c 'import sys; print(sys.exec_prefix)')
15+
1416
BUILD_DOCS ?= 1
1517

1618
install: pythonIoc
@@ -23,7 +25,8 @@ clean: clean-pythonIoc
2325
# Commands for creating startup script with correct paths to EPICS.
2426
define SED_EDIT_COMMANDS
2527
s:@@EPICS_BASE@@:$(EPICS_BASE):; \
26-
s:@@EPICS_HOST_ARCH@@:$(EPICS_HOST_ARCH):
28+
s:@@EPICS_HOST_ARCH@@:$(EPICS_HOST_ARCH):; \
29+
s:@@PYTHONHOME@@:$(PYTHONHOME):
2730
endef
2831

2932
# Ensure we get the build time EPICS_BASE into the executable

pythonIoc.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export HERE="$(readlink -fn "$(dirname "$0")")"
88
export PYTHONPATH="$PYTHONPATH${PYTHONPATH:+:}$HERE/python"
99
export EPICS_BASE='@@EPICS_BASE@@'
1010
export EPICS_HOST_ARCH='@@EPICS_HOST_ARCH@@'
11+
export PYTHONHOME='@@PYTHONHOME@@'
1112

1213
case "$1" in
1314
--debug)

softIocApp/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ include $(TOP)/configure/CONFIG
1717
# surprisingly tricky, as we want to support quite a number of different
1818
# configurations of Python interpreter.
1919
PYTHON_LIB := $(shell $(PYTHON) -c \
20-
'from __future__ import print_function; \
21-
from distutils import sysconfig; \
20+
'from distutils import sysconfig; \
2221
print(sysconfig.get_config_var("LIBRARY")[3:-2])')
2322
PYTHON_LIB_DIR := $(shell $(PYTHON) -c \
24-
'from __future__ import print_function; \
25-
from distutils import sysconfig; \
23+
'from distutils import sysconfig; \
2624
print(sysconfig.get_config_var("LIBDIR"))')
2725

2826

0 commit comments

Comments
 (0)