20
20
# platform, or the dependency on them is satisfied by an existing
21
21
# system package.
22
22
#
23
- # - SAGE_STANDARD_PACKAGES - lists the names of all packages that have
24
- # the "standard" type. All "standard" packages are installed by
25
- # default (if they are listed in SAGE_DUMMY_PACKAGES "installed" in
26
- # this case is a no-op).
23
+ # - SAGE_OPTIONAL_INSTALLED_PACKAGES - lists the names of packages with the
24
+ # "standard", "optional", or "experimental" type that should be installed.
27
25
#
28
- # - SAGE_OPTIONAL_PACKAGES - lists the names of packages with the
29
- # "optional" type that should be installed .
26
+ # - SAGE_OPTIONAL_UNINSTALLED_PACKAGES - lists the names of packages with the
27
+ # "standard", " optional", or "experimental" type that should be uninstalled .
30
28
#
31
29
# - SAGE_SDIST_PACKAGES - lists the names of all packages whose sources
32
30
# need to be downloaded to be included in the source distribution.
@@ -107,13 +105,10 @@ SAGE_BUILT_PACKAGES=''
107
105
# underlying system.
108
106
SAGE_DUMMY_PACKAGES=''
109
107
110
- # Standard packages
111
- SAGE_STANDARD_PACKAGES=''
112
-
113
- # List of currently installed and to-be-installed optional packages - filled in SAGE_SPKG_ENABLE
114
- #SAGE_OPTIONAL_INSTALLED_PACKAGES
115
- # List of optional packages to be uninstalled - filled in SAGE_SPKG_ENABLE
116
- #SAGE_OPTIONAL_CLEANED_PACKAGES
108
+ # List of currently installed and to-be-installed standard/optional/experimental packages
109
+ SAGE_OPTIONAL_INSTALLED_PACKAGES=''
110
+ # List of optional packages to be uninstalled
111
+ SAGE_OPTIONAL_UNINSTALLED_PACKAGES=''
117
112
118
113
# List of all packages that should be downloaded
119
114
SAGE_SDIST_PACKAGES=''
@@ -170,25 +165,30 @@ for DIR in $SAGE_ROOT/build/pkgs/*; do
170
165
message="came preinstalled with the SageMath tarball"
171
166
;;
172
167
standard)
173
- SAGE_STANDARD_PACKAGES="${SAGE_STANDARD_PACKAGES} \\$(printf '\n ')${SPKG_NAME}"
174
- in_sdist=yes
175
- message="will be installed as an SPKG"
168
+ AS_VAR_IF ( [ SAGE_ENABLE_] ${SPKG_NAME} , [ yes] , [
169
+ message="$SPKG_TYPE, will be installed as an SPKG"
170
+ ] , [
171
+ message="$SPKG_TYPE, but disabled using configure option"
172
+ ] )
176
173
;;
177
174
optional|experimental)
178
175
AS_VAR_IF ( [ SAGE_ENABLE_] ${SPKG_NAME} , [ yes] , [
179
176
message="$SPKG_TYPE, will be installed as an SPKG"
180
177
] , [
181
178
message="$SPKG_TYPE, use \"$srcdir/configure --enable-$SPKG_NAME\" to install"
182
179
] )
183
- uninstall_message=", use \"$srcdir/configure --disable-$SPKG_NAME\" to uninstall"
184
180
;;
185
181
*)
186
182
AC_MSG_ERROR ( [ The content of "$SPKG_TYPE_FILE" must be 'base', 'standard', 'optional', or 'experimental'] )
187
183
;;
188
184
esac
189
185
190
186
case "$SPKG_TYPE" in
187
+ standard)
188
+ in_sdist=yes
189
+ ;;
191
190
optional|experimental)
191
+ uninstall_message=", use \"$srcdir/configure --disable-$SPKG_NAME\" to uninstall"
192
192
stampfile=""
193
193
for f in "$SAGE_SPKG_INST/$SPKG_NAME"-*; do
194
194
AS_IF ( [ test -r "$f"] , [
@@ -229,7 +229,7 @@ for DIR in $SAGE_ROOT/build/pkgs/*; do
229
229
] , [ message="not required on your platform; SPKG will not be installed"
230
230
] )
231
231
] , [
232
- dnl We won't use the system package.
232
+ dnl We will not use the system package.
233
233
SAGE_BUILT_PACKAGES="${SAGE_BUILT_PACKAGES} \\$(printf '\n ')${SPKG_NAME}"
234
234
AS_VAR_SET_IF ( [ sage_use_system] , [
235
235
AS_VAR_COPY ( [ reason] , [ sage_use_system] )
@@ -239,9 +239,6 @@ for DIR in $SAGE_ROOT/build/pkgs/*; do
239
239
] ,
240
240
[ installed] , [ message="already installed as an SPKG$uninstall_message" ] ,
241
241
[ message="$reason; $message" ] )
242
- ] , [
243
- # Package does not use spkg-configure.m4 yet
244
- message="does not support check for system package; $message"
245
242
] )
246
243
] )
247
244
@@ -296,6 +293,22 @@ for DIR in $SAGE_ROOT/build/pkgs/*; do
296
293
SAGE_SDIST_PACKAGES="${SAGE_SDIST_PACKAGES} \\$(printf '\n ')${SPKG_NAME}"
297
294
fi
298
295
296
+ # Determine whether package is enabled
297
+ AS_VAR_SET ( [ is_installed] , [ no] )
298
+ for f in "$SAGE_SPKG_INST/${SPKG_NAME}"-*; do
299
+ AS_IF ( [ test -r "$f"] ,
300
+ [ AS_VAR_SET ( [ is_installed] , [ yes] ) ] )
301
+ done
302
+
303
+ AS_VAR_IF ( [ SAGE_ENABLE_${SPKG_NAME}}] , [ if_installed] ,
304
+ [ AS_VAR_SET ( [ SAGE_ENABLE_${SPKG_NAME}] , $is_installed ) ] )
305
+ AS_VAR_COPY ( [ want_spkg] , [ SAGE_ENABLE_${SPKG_NAME}] )
306
+
307
+ spkg_line=" \\$(printf '\n ')$SPKG_NAME"
308
+ AS_CASE ( [ $is_installed-$want_spkg] ,
309
+ [ *-yes] , [ AS_VAR_APPEND ( SAGE_OPTIONAL_INSTALLED_PACKAGES , "$spkg_line" ) ] ,
310
+ [ yes-no] , [ AS_VAR_APPEND ( SAGE_OPTIONAL_UNINSTALLED_PACKAGES , "$spkg_line" ) ] )
311
+
299
312
# Determine package dependencies
300
313
#
301
314
DEP_FILE="$DIR/dependencies"
@@ -340,9 +353,8 @@ AC_SUBST([SAGE_PIP_PACKAGES])
340
353
AC_SUBST ( [ SAGE_SCRIPT_PACKAGES] )
341
354
AC_SUBST ( [ SAGE_BUILT_PACKAGES] )
342
355
AC_SUBST ( [ SAGE_DUMMY_PACKAGES] )
343
- AC_SUBST ( [ SAGE_STANDARD_PACKAGES] )
344
356
AC_SUBST ( [ SAGE_OPTIONAL_INSTALLED_PACKAGES] )
345
- AC_SUBST ( [ SAGE_OPTIONAL_CLEANED_PACKAGES ] )
357
+ AC_SUBST ( [ SAGE_OPTIONAL_UNINSTALLED_PACKAGES ] )
346
358
AC_SUBST ( [ SAGE_SDIST_PACKAGES] )
347
359
] )
348
360
0 commit comments