Skip to content
This repository was archived by the owner on Dec 27, 2023. It is now read-only.

Commit 9b7998f

Browse files
committed
Fix runltp-ng installation inside LTP buildsystem
Added runltp-ng.d folder to the PYTHONPATH inside runltp-ng script. Introduced BASE_DIR inside Makefile because ${prefix} is breaking installation on build systems. Signed-off-by: Andrea Cervesato <[email protected]> Reviewed-by: Petr Vorel <[email protected]> Tested-by: Petr Vorel <[email protected]>
1 parent d46aedc commit 9b7998f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ top_srcdir ?= ../..
77

88
include $(top_srcdir)/include/mk/env_pre.mk
99

10-
INSTALL_DIR := $(prefix)/runltp-ng.d
10+
BASE_DIR := $(abspath $(DESTDIR)/$(prefix))
11+
INSTALL_DIR := $(BASE_DIR)/runltp-ng.d
1112

1213
install:
1314
mkdir -p $(INSTALL_DIR)/ltp
1415

1516
install -m 00644 $(top_srcdir)/tools/runltp-ng/ltp/*.py $(INSTALL_DIR)/ltp
16-
install -m 00775 $(top_srcdir)/tools/runltp-ng/runltp-ng $(INSTALL_DIR)/runltp-ng
17+
install -m 00775 $(top_srcdir)/tools/runltp-ng/runltp-ng $(BASE_DIR)/runltp-ng
1718

1819
include $(top_srcdir)/include/mk/generic_leaf_target.mk

runltp-ng

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import sys
1313

1414
# include ltp library
1515
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
16+
sys.path.insert(0, os.path.abspath(os.path.join(
17+
os.path.dirname(__file__),
18+
"runltp-ng.d")
19+
))
1620

1721
if __name__ == "__main__":
1822
import ltp.main

0 commit comments

Comments
 (0)