diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index e2a151b4adc..f4a9d2ef0fa 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -788,8 +788,6 @@ run_test_suite() { ############################################### # SAGE_INST_LOCAL. It might make more sense to run the tests before, but the # spkg-check scripts were written before use of DESTDIR installs, and so # fail in many cases. This might be good to change later. - -if [ "$SAGE_CHECK" = "yes" -o "$SAGE_CHECK" = "warn" ]; then if [ -f spkg-check ]; then echo "Running the test suite for $PKG_NAME..." time ./spkg-check @@ -807,11 +805,13 @@ if [ "$SAGE_CHECK" = "yes" -o "$SAGE_CHECK" = "warn" ]; then TEST_SUITE_RESULT="passed" echo "Passed the test suite for $PKG_NAME." fi + elif [ -f spkg-check.in ]; then + echo "The test suite for $PKG_NAME requires the temporary build directory." + exit 1 else echo "Package $PKG_NAME has no test suite." TEST_SUITE_RESULT="not available" fi -fi } ################################################# run_test_suite write_installation_record() { #################################### @@ -889,17 +889,21 @@ if [ $INSTALL = 1 ]; then extract_the_package prepare_for_installation actually_build_and_install -else - cd "$SAGE_BUILD_DIR/$PKG_NAME" || exit $? fi if [ $POST_INSTALL = 1 ]; then + cd "$SAGE_BUILD_DIR/$PKG_NAME" || exit $? unload_destdir install_scripts post_install fi -run_test_suite +if [ "$SAGE_CHECK" = "yes" -o "$SAGE_CHECK" = "warn" ]; then + if ! cd "$SAGE_BUILD_DIR/$PKG_NAME" 2>/dev/null; then + cd "$PKG_SCRIPTS" || exit $? + fi + run_test_suite +fi if [ $POST_INSTALL = 1 ]; then write_installation_record diff --git a/build/make/Makefile.in b/build/make/Makefile.in index aac7a9164a2..47621d2bdc9 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -614,6 +614,11 @@ $(1)-$(4)-no-deps: $(1)-no-deps: $(1)-$(4)-no-deps +$(1)-$(4)-check: + $(PLUS)@sage-logger -p 'PATH=$$(SAGE_SRC)/bin:$$($(4))/bin:$$$$PATH $$(SAGE_SPKG) --check-only $(1)-$(2) $$($(4))' '$$(SAGE_LOGS)/$(1)-$(2).log' + +$(1)-check: $(1)-$(4)-check + $(1)-$(4)-uninstall: if [ -d '$$($(4))' ]; then \ sage-spkg-uninstall $(if $(filter $(1),$(TOOLCHAIN_DEPS)),--keep-files) \ @@ -760,22 +765,7 @@ $(1)-$(4)-no-deps: $(1)-no-deps: $(1)-$(4)-no-deps $(1)-$(4)-check: - $(PLUS)@if [ -x $$(SAGE_ROOT)/build/pkgs/$(1)/spkg-check ]; then \ - cd '$$(SAGE_ROOT)/build/pkgs/$(1)' && \ - . '$$(SAGE_ROOT)/src/bin/sage-src-env-config' && \ - . '$$(SAGE_ROOT)/src/bin/sage-env-config' && \ - . '$$(SAGE_ROOT)/src/bin/sage-env' && \ - . '$$(SAGE_ROOT)/build/bin/sage-build-env-config' && \ - . '$$(SAGE_ROOT)/build/bin/sage-build-env' && \ - PKG_BASE="$(1)" \ - PKG_VER="$(2)" \ - PKG_NAME="$(1)-$(2)" \ - SAGE_SPKG_WHEELS=$$($(4))/var/lib/sage/wheels \ - SAGE_SPKG_SCRIPTS=$$($(4))/var/lib/sage/scripts \ - SAGE_INST_LOCAL=$$($(4)) \ - SAGE_CHECK=$$(SAGE_CHECK_$(1)) \ - sage-logger -p '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-check' '$$(SAGE_LOGS)/$(1)-$(2).log'; \ - fi + $(PLUS)@sage-logger -p 'PATH=$$(SAGE_SRC)/bin:$$($(4))/bin:$$$$PATH $$(SAGE_SPKG) --check-only $(1)-$(2) $$($(4))' '$$(SAGE_LOGS)/$(1)-$(2).log' $(1)-check: $(1)-$(4)-check