Skip to content

Commit

Permalink
Trac #29793: script packages should cd into the SPKG directory
Browse files Browse the repository at this point in the history
This simplifies several `spkg-install` scripts and make script packages
a bit more similar to normal packages.

This is a step towards #29386 (Install script packages via `sage-spkg`).

URL: https://trac.sagemath.org/29793
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Michael Orlitzky
  • Loading branch information
Release Manager committed Jun 26, 2020
2 parents 9eace0d + 72346ef commit ac3f40b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build/make/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -574,15 +574,15 @@ endif
# $(3): package dependencies
define SCRIPT_PACKAGE_templ
$$(INST)/$(1)-$(2): $(3)
$(AM_V_at)cd '$$(SAGE_ROOT)' && \
$(AM_V_at)cd '$$(SAGE_ROOT)/build/pkgs/$(1)' && \
. '$$(SAGE_ROOT)/src/bin/sage-env' && . '$$(SAGE_ROOT)/build/bin/sage-build-env-config' && \
sage-logger -p '$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-install' '$$(SAGE_LOGS)/$(1).log'
touch "$$@"

$(1): $$(INST)/$(1)-$(2)

$(1)-clean:
-$(AM_V_at)cd '$$(SAGE_ROOT)' && \
-$(AM_V_at)cd '$$(SAGE_ROOT)/build/pkgs/$(1)' && \
. '$$(SAGE_ROOT)/src/bin/sage-env' && . '$$(SAGE_ROOT)/build/bin/sage-build-env-config' && \
'$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-uninstall'
-rm -f "$$(INST)/$(1)-$(2)"
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/sage_conf/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ if [ $? -ne 0 ]; then
echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?"
exit 1
fi
cd $SAGE_ROOT/build/pkgs/sage_conf/src && sdh_pip_install .
cd src && sdh_pip_install .
2 changes: 1 addition & 1 deletion build/pkgs/texlive/spkg-install
Original file line number Diff line number Diff line change
@@ -1 +1 @@
exec sage-python23 build/pkgs/texlive/spkg-install.py
exec sage-python23 spkg-install.py
5 changes: 3 additions & 2 deletions src/doc/en/developer/packaging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ A script package has a single install script named ``spkg-install``.
It needs to be an executable shell script; it is not subject to the templating
described in the previous section.

Sage runs ``spkg-install`` from the ``$SAGE_ROOT`` directory in the environment
obtained by sourcing the files ``src/bin/sage-env`` and ``build/bin/sage-build-env-config``.
Sage runs ``spkg-install`` from the directory ``$SAGE_ROOT/build/pkgs/<package>``
in the environment obtained by sourcing the files ``src/bin/sage-env`` and
``build/bin/sage-build-env-config``.

.. _section-sdh-helpers:

Expand Down

0 comments on commit ac3f40b

Please sign in to comment.