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

Commit af2e1fb

Browse files
author
Matthias Koeppe
committed
Merge #31362
2 parents c15435e + 61f6ba6 commit af2e1fb

File tree

15 files changed

+551
-29
lines changed

15 files changed

+551
-29
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ all: base-toolchain
1515
build: base-toolchain
1616
$(MAKE) all-build
1717

18+
build-local: base-toolchain
19+
$(MAKE) all-build-local
20+
21+
build-venv: base-toolchain
22+
$(MAKE) all-build-venv
23+
1824
start: base-toolchain
1925
$(MAKE) build-start
2026

build/make/Makefile.in

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,27 @@ GCC_DEP = @SAGE_GCC_DEP@
8686

8787
@SAGE_PACKAGE_DEPENDENCIES@
8888

89+
# Installation trees for all packages, in the format:
90+
#
91+
# - for a non-Python package:
92+
#
93+
# trees_<pkgname1> = SAGE_LOCAL
94+
#
95+
# - for a Python package:
96+
#
97+
# trees_<pkgname2> = SAGE_VENV
98+
99+
@SAGE_PACKAGE_TREES@
100+
89101
# All standard/optional/experimental installed packages (triggers the auto-update)
90-
OPTIONAL_INSTALLED_PACKAGES = @SAGE_OPTIONAL_INSTALLED_PACKAGES@
91-
OPTIONAL_INSTALLED_PACKAGE_INSTS = \
92-
$(foreach pkgname,$(OPTIONAL_INSTALLED_PACKAGES),$(inst_$(pkgname)))
102+
INSTALLED_PACKAGES = @SAGE_OPTIONAL_INSTALLED_PACKAGES@
103+
INSTALLED_PACKAGE_INSTS = \
104+
$(foreach pkgname,$(INSTALLED_PACKAGES),$(inst_$(pkgname)))
93105

94106
# All previously installed standard/optional/experimental packages that are to be uninstalled
95107
OPTIONAL_CLEANED_PACKAGES = @SAGE_OPTIONAL_CLEANED_PACKAGES@
96-
OPTIONAL_CLEANED_PACKAGES_CLEANS = $(OPTIONAL_CLEANED_PACKAGES:%=%-clean)
108+
CLEANED_PACKAGES = $(OPTIONAL_CLEANED_PACKAGES)
109+
CLEANED_PACKAGES_CLEANS = $(CLEANED_PACKAGES:%=%-clean)
97110

98111
# All packages which should be downloaded
99112
SDIST_PACKAGES = @SAGE_SDIST_PACKAGES@
@@ -141,6 +154,18 @@ $(INST)/.dummy:
141154
touch $@
142155

143156

157+
# Filtered by installation tree
158+
$(foreach tree,SAGE_LOCAL SAGE_VENV, \
159+
$(eval $(tree)_INSTALLED_PACKAGE_INSTS = \
160+
$(foreach pkgname,$(INSTALLED_PACKAGES), \
161+
$(if $(findstring $(tree),$(trees_$(pkgname))), \
162+
$(inst_$(pkgname))))) \
163+
$(eval $(tree)_CLEANED_PACKAGE_CLEANS = \
164+
$(foreach pkgname,$(INSTALLED_PACKAGES), \
165+
$(if $(findstring $(tree),$(trees_$(pkgname))), \
166+
$(inst_$(pkgname))))))
167+
168+
144169
###############################################################################
145170

146171
# Silent rules
@@ -206,8 +231,19 @@ base-toolchain: _clean-broken-gcc base
206231
# All targets except for the base packages
207232
all-sage: \
208233
sagelib \
209-
$(OPTIONAL_INSTALLED_PACKAGE_INSTS) \
210-
$(OPTIONAL_CLEANED_PACKAGES_CLEANS)
234+
$(INSTALLED_PACKAGE_INSTS) \
235+
$(CLEANED_PACKAGES_CLEANS)
236+
237+
# Same but filtered by installation trees:
238+
all-build-local: toolchain-deps
239+
+$(MAKE_REC) all-sage-local
240+
241+
all-sage-local: $(SAGE_LOCAL_INSTALLED_PACKAGE_INSTS) $(SAGE_LOCAL_CLEANED_PACKAGES_CLEANS)
242+
243+
all-build-venv: toolchain-deps
244+
+$(MAKE_REC) all-sage-venv
245+
246+
all-sage-venv: $(SAGE_VENV_INSTALLED_PACKAGE_INSTS) $(SAGE_VENV_CLEANED_PACKAGES_CLEANS)
211247

212248
# Download all packages which should be inside an sdist tarball (the -B
213249
# option to make forces all targets to be built unconditionally)

build/pkgs/pynac/install-requires.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sagemath-standard

build/pkgs/sagelib/src/LICENSE.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../src/LICENSE.txt

build/pkgs/sagelib/src/README.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
=================================================================
2+
Sage: Open Source Mathematics Software: Standard Python Library
3+
=================================================================
4+
5+
About SageMath
6+
--------------
7+
8+
"Creating a Viable Open Source Alternative to
9+
Magma, Maple, Mathematica, and MATLAB"
10+
11+
Copyright (C) 2005-2020 The Sage Development Team
12+
13+
https://www.sagemath.org
14+
15+
SageMath fully supports all major Linux distributions, recent versions of macOS, and Windows (using Cygwin or Windows Subsystem for Linux).
16+
17+
The traditional and recommended way to install SageMath is from source via Sage-the-distribution (https://www.sagemath.org/download-source.html). Sage-the-distribution first builds a large number of open source packages from source (unless it finds suitable versions installed in the system) and then installs the Sage Library (sagelib, implemented in Python and Cython).
18+
19+
20+
About this experimental pip-installable source distribution
21+
-----------------------------------------------------------
22+
23+
This pip-installable source distribution `sagemath-standard` is an experimental distribution of the Sage Library. Use at your own risk.
24+
25+
Building `sagemath-standard` has a large number of system packages as prerequisites. See https://doc.sagemath.org/html/en/installation/source.html#linux-recommended-installation
26+
for partial lists for various systems.
27+
28+
A modularization effort is in progress with the goal of making it possible to install parts of the Sage Library with fewer prerequisites. https://trac.sagemath.org/ticket/29705

build/pkgs/sagelib/src/VERSION.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../package-version.txt

build/pkgs/sagelib/src/setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../src/setup.cfg

build/pkgs/sagelib/src/setup.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
import time
88
from distutils import log
9-
from distutils.core import setup
9+
from setuptools import setup
1010

1111
# Work around a Cython problem in Python 3.8.x on macOS
1212
# https://github.com/cython/cython/issues/3262
@@ -87,14 +87,8 @@
8787
### Distutils
8888
#########################################################
8989

90-
code = setup(name = 'sage',
91-
version = SAGE_VERSION,
92-
description = 'Sage: Open Source Mathematics Software',
93-
license = 'GNU Public License (GPL)',
94-
author = 'William Stein et al.',
95-
author_email= 'https://groups.google.com/group/sage-support',
96-
url = 'https://www.sagemath.org',
97-
packages = python_packages,
90+
code = setup(
91+
packages = python_packages,
9892
package_data = {
9993
'sage.libs.gap': ['sage.gaprc'],
10094
'sage.interfaces': ['sage-maxima.lisp'],

m4/sage_spkg_collect.m4

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ SAGE_DUMMY_PACKAGES=''
113113
# List of all packages that should be downloaded
114114
SAGE_SDIST_PACKAGES=''
115115
116-
# Generate package version and dependency lists
116+
# Generate package version/dependency/tree lists
117117
SAGE_PACKAGE_VERSIONS=""
118118
SAGE_PACKAGE_DEPENDENCIES=""
119+
SAGE_PACKAGE_TREES=""
119120
# Lists of packages categorized according to their build rules
120121
SAGE_NORMAL_PACKAGES=''
121122
SAGE_PIP_PACKAGES=''
@@ -144,6 +145,19 @@ for DIR in $SAGE_ROOT/build/pkgs/*; do
144145
145146
in_sdist=no
146147
148+
dnl Write out information about the installation tree, using the name of the tree prefix
149+
dnl variable (SAGE_LOCAL or SAGE_VENV). The makefile variable of SPKG is called "trees_SPKG",
150+
dnl note plural, for possible future extension in which an SPKG would be installed into several
151+
dnl trees. For example, if we decide to create a separate tree for a venv with the
152+
dnl Jupyter notebook, then packages such as jupyter_core would have to be installed into
153+
dnl two trees.
154+
SPKG_TREE_VAR=SAGE_LOCAL
155+
if test -f "$DIR/requirements.txt" -o -f "$DIR/install-requires.txt"; then
156+
dnl A Python package
157+
SPKG_TREE_VAR=SAGE_VENV
158+
fi
159+
SAGE_PACKAGE_TREES="${SAGE_PACKAGE_TREES}$(printf '\ntrees_')${SPKG_NAME} = ${SPKG_TREE_VAR}"
160+
147161
uninstall_message=""
148162
# Check consistency of 'DIR/type' file
149163
case "$SPKG_TYPE" in
@@ -310,6 +324,7 @@ done
310324
311325
AC_SUBST([SAGE_PACKAGE_VERSIONS])
312326
AC_SUBST([SAGE_PACKAGE_DEPENDENCIES])
327+
AC_SUBST([SAGE_PACKAGE_TREES])
313328
AC_SUBST([SAGE_NORMAL_PACKAGES])
314329
AC_SUBST([SAGE_PIP_PACKAGES])
315330
AC_SUBST([SAGE_SCRIPT_PACKAGES])

0 commit comments

Comments
 (0)