|
191 | 191 | # build/bin/sage-site. See #29111; but OTOH #34627. |
192 | 192 |
|
193 | 193 | build_sage() { |
194 | | - ( cd "$SAGE_ROOT" && make sagelib-no-deps ) || exit $? |
| 194 | + # Checking for the editable meson-build directory |
| 195 | + if [ -f "build/build.ninja" ]; then |
| 196 | + echo "Building Sage with ninja..." |
| 197 | + ( cd "$SAGE_ROOT" && ninja -C build ) || exit $? |
| 198 | + else |
| 199 | + #Handling non-editable installs or other non-standard setups here. |
| 200 | + echo "Error: 'sage -b' is for editable meson-based developer builds." >&2 |
| 201 | + echo "Please use 'make' or 'meson' directly for other builds." >&2 |
| 202 | + exit 1 |
| 203 | + fi |
195 | 204 | } |
196 | 205 |
|
197 | | -# Check for '-i' etc. before sourcing sage-env: running "make" |
198 | | -# should be run outside of the Sage shell. |
199 | 206 | case "$1" in |
200 | | - -i|-f|-p) |
201 | | - # Delegate further option handling to the non-installed sage-site script. |
202 | | - # (These options become unavailable if the directory $SAGE_ROOT is removed.) |
203 | | - if [ -d "$SAGE_ROOT" ]; then |
204 | | - exec "$SAGE_ROOT/build/bin/sage-site" "$@" |
205 | | - # fallthrough if there is no sage-site script |
206 | | - fi |
207 | | - echo >&2 "Error: unknown option: $1" |
208 | | - exit 1 |
209 | | - ;; |
| 207 | + |
210 | 208 | -b) |
211 | 209 | build_sage |
212 | 210 | exit 0 |
213 | 211 | ;; |
214 | 212 | -br|--br) |
| 213 | + echo "Warning: 'sage -br' is deprecated." >&2 |
| 214 | + echo "In an editable install, just run './sage' to use the latest built code." >&2 |
215 | 215 | build_sage |
216 | | - shift; set -- -r "$@" # delegate to handling of "-r" below, after sourcing sage-env |
217 | | - ;; |
218 | | - -bn|--build-and-notebook) |
219 | | - build_sage |
220 | | - shift; set -- -n "$@" # delegate to handling of "-n" below, after sourcing sage-env |
221 | | - ;; |
222 | | - -ba) |
223 | | - ( cd "$SAGE_ROOT" && make sagelib-clean ) |
224 | | - build_sage |
225 | | - exit 0 |
226 | | - ;; |
227 | | - -bt*) |
228 | | - build_sage |
229 | | - switch_without_b=-${1#-b} |
230 | | - shift; set -- $switch_without_b "$@" # delegate to handling of "-t...." below, after sourcing sage-env |
| 216 | + shift; set -- -r "$@" |
231 | 217 | ;; |
232 | 218 | esac |
233 | 219 |
|
|
0 commit comments