| 1 |
# TeXLive::TLConfig.pm - module exporting configuration values |
| 2 |
# Copyright 2007-2025 Norbert Preining |
| 3 |
# This file is licensed under the GNU General Public License version 2 |
| 4 |
# or any later version. |
| 5 |
|
| 6 |
use strict; use warnings; |
| 7 |
package TeXLive::TLConfig; |
| 8 |
|
| 9 |
my $svnrev = '$Revision: 73776 $'; |
| 10 |
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown"; |
| 11 |
sub module_revision { return $_modulerevision; } |
| 12 |
|
| 13 |
BEGIN { |
| 14 |
use Exporter (); |
| 15 |
use vars qw( @ISA @EXPORT_OK @EXPORT ); |
| 16 |
@ISA = qw(Exporter); |
| 17 |
@EXPORT_OK = qw( |
| 18 |
$ReleaseYear |
| 19 |
@MetaCategories |
| 20 |
@NormalCategories |
| 21 |
@Categories |
| 22 |
$MetaCategoriesRegexp |
| 23 |
$CategoriesRegexp |
| 24 |
$DefaultCategory |
| 25 |
@AcceptedFallbackDownloaders |
| 26 |
%FallbackDownloaderProgram |
| 27 |
%FallbackDownloaderArgs |
| 28 |
$DefaultCompressorFormat |
| 29 |
$CompressorExtRegexp |
| 30 |
%Compressors |
| 31 |
$InfraLocation |
| 32 |
$DatabaseName |
| 33 |
$DatabaseLocation |
| 34 |
$PackageBackupDir |
| 35 |
$BlockSize |
| 36 |
$Archive |
| 37 |
$TeXLiveServerURL |
| 38 |
$TeXLiveServerURLRegexp |
| 39 |
$TeXLiveServerPath |
| 40 |
$TeXLiveURL |
| 41 |
@CriticalPackagesList |
| 42 |
$CriticalPackagesRegexp |
| 43 |
@InstallExtraRequiredPackages |
| 44 |
$WindowsMainMenuName |
| 45 |
$RelocPrefix |
| 46 |
$RelocTree |
| 47 |
%TLPDBOptions |
| 48 |
%TLPDBSettings |
| 49 |
%TLPDBConfigs |
| 50 |
$NetworkTimeout |
| 51 |
$MaxLWPErrors |
| 52 |
$MaxLWPReinitCount |
| 53 |
$PartialEngineSupport |
| 54 |
$F_OK $F_WARNING $F_ERROR $F_NOPOSTACTION |
| 55 |
$ChecksumLength |
| 56 |
$ChecksumProgram |
| 57 |
$ChecksumExtension |
| 58 |
); |
| 59 |
@EXPORT = @EXPORT_OK; |
| 60 |
} |
| 61 |
|
| 62 |
# the year of our release, will be used in the location of the |
| 63 |
# network packages, and in menu names, and other places. |
| 64 |
our $ReleaseYear = 2025; |
| 65 |
|
| 66 |
# users can upgrade from this year to the current year; might be the |
| 67 |
# same as the release year, or any number of releases earlier. |
| 68 |
# Generally not tested, but should be. |
| 69 |
our $MinRelease = 2016; |
| 70 |
|
| 71 |
# Meta Categories do not ship files, but only call for other packages. |
| 72 |
our @MetaCategories = qw/Collection Scheme/; |
| 73 |
our $MetaCategoriesRegexp = '(Collection|Scheme)'; |
| 74 |
# |
| 75 |
# Normal Categories contain actial files and do not depend on other things. |
| 76 |
our @NormalCategories = qw/Package TLCore ConTeXt/; |
| 77 |
# |
| 78 |
# list of all Categories |
| 79 |
our @Categories = (@MetaCategories, @NormalCategories); |
| 80 |
|
| 81 |
# repeat, as a regexp. |
| 82 |
our $CategoriesRegexp = '(Collection|Scheme|Package|TLCore|ConTeXt)'; |
| 83 |
|
| 84 |
our $DefaultCategory = "Package"; |
| 85 |
|
| 86 |
# location of various infra files (texlive.tlpdb, .tlpobj etc) |
| 87 |
# relative to a root (e.g., the Master/, or the installation path) |
| 88 |
our $InfraLocation = "tlpkg"; |
| 89 |
our $DatabaseName = "texlive.tlpdb"; |
| 90 |
our $DatabaseLocation = "$InfraLocation/$DatabaseName"; |
| 91 |
|
| 92 |
# location of backups in default autobackup setting (under tlpkg) |
| 93 |
our $PackageBackupDir = "$InfraLocation/backups"; |
| 94 |
|
| 95 |
# for computing disk usage; this is most common. |
| 96 |
our $BlockSize = 4096; |
| 97 |
|
| 98 |
# timeout for network connections (wget, LWP) in seconds |
| 99 |
our $NetworkTimeout = 30; |
| 100 |
# number of errors during an LWP session until it is marked as disabled |
| 101 |
our $MaxLWPErrors = 5; |
| 102 |
# max number of times we reenable LWP after it was disabled |
| 103 |
our $MaxLWPReinitCount = 10; |
| 104 |
|
| 105 |
our $Archive = "archive"; |
| 106 |
our $TeXLiveServerURL = "https://mirror.ctan.org"; |
| 107 |
our $TeXLiveServerURLRegexp = 'https?://mirror\.ctan\.org'; |
| 108 |
# from 2009 on we try to put them all into tlnet directly without any |
| 109 |
# release year since we hope that we can switch over to 2010 on the fly |
| 110 |
# our $TeXLiveServerPath = "systems/texlive/tlnet/$ReleaseYear"; |
| 111 |
our $TeXLiveServerPath = "systems/texlive/tlnet"; |
| 112 |
our $TeXLiveURL = "$TeXLiveServerURL/$TeXLiveServerPath"; |
| 113 |
|
| 114 |
# Relocatable packages. |
| 115 |
our $RelocTree = "texmf-dist"; |
| 116 |
our $RelocPrefix = "RELOC"; |
| 117 |
|
| 118 |
our @CriticalPackagesList = qw/texlive.infra/; |
| 119 |
our $CriticalPackagesRegexp = '^(texlive\.infra)'; |
| 120 |
if ($^O =~ /^MSWin/i) { |
| 121 |
push (@CriticalPackagesList, "tlperl.windows"); |
| 122 |
$CriticalPackagesRegexp = '^(texlive\.infra|tlperl\.windows$)'; |
| 123 |
} |
| 124 |
|
| 125 |
|
| 126 |
# Extra package that are required for installation and installed |
| 127 |
# during the first run of the installer. |
| 128 |
# texlive-scripts are necessary for mktexlsr, updmap, fmtutil, ... |
| 129 |
# the installation cannot continue without those |
| 130 |
our @InstallExtraRequiredPackages = qw/texlive-scripts kpathsea hyphen-base/; |
| 131 |
if ($^O =~ /^MSWin/i) { |
| 132 |
push @InstallExtraRequiredPackages, "luatex"; |
| 133 |
} |
| 134 |
|
| 135 |
# |
| 136 |
our @AcceptedFallbackDownloaders = qw/curl wget/; |
| 137 |
our %FallbackDownloaderProgram = ( 'wget' => 'wget', 'curl' => 'curl'); |
| 138 |
our %FallbackDownloaderArgs = ( |
| 139 |
'curl' => ['--user-agent', 'texlive/curl', |
| 140 |
'--retry', '4', '--retry-delay', '4', |
| 141 |
'--connect-timeout', "$NetworkTimeout", |
| 142 |
'--fail', '--location', '--silent', '--output'], |
| 143 |
'wget' => ['--user-agent=texlive/wget', '--tries=4', |
| 144 |
"--timeout=$NetworkTimeout", '-q', '-O'], |
| 145 |
); |
| 146 |
# the way we package things on the web |
| 147 |
our $DefaultCompressorFormat = "xz"; |
| 148 |
# priority defines which compressor is selected for backups/rollback containers |
| 149 |
# less is better |
| 150 |
our %Compressors = ( |
| 151 |
"lz4" => { |
| 152 |
"decompress_args" => ["-dcf"], |
| 153 |
"compress_args" => ["-zfmq"], |
| 154 |
"extension" => "lz4", |
| 155 |
"priority" => 10, |
| 156 |
}, |
| 157 |
"gzip" => { |
| 158 |
"decompress_args" => ["-dcf"], |
| 159 |
"compress_args" => ["-f"], |
| 160 |
"extension" => "gz", |
| 161 |
"priority" => 20, |
| 162 |
}, |
| 163 |
"xz" => { |
| 164 |
"decompress_args" => ["-dcf"], |
| 165 |
"compress_args" => ["-zf"], |
| 166 |
"extension" => "xz", |
| 167 |
"priority" => 30, |
| 168 |
}, |
| 169 |
); |
| 170 |
our $CompressorExtRegexp = "(" |
| 171 |
. join("|", map { $Compressors{$_}{'extension'} } keys %Compressors) |
| 172 |
. ")"; |
| 173 |
|
| 174 |
# archive (not user) settings. |
| 175 |
# these can be overridden by putting them into 00texlive.config.tlpsrc |
| 176 |
# in the format |
| 177 |
# depend key/value |
| 178 |
our %TLPDBConfigs = ( |
| 179 |
"container_split_src_files" => 1, |
| 180 |
"container_split_doc_files" => 1, |
| 181 |
"container_format" => $DefaultCompressorFormat, |
| 182 |
"minrelease" => $MinRelease, |
| 183 |
"release" => $ReleaseYear, |
| 184 |
"frozen" => 0, |
| 185 |
); |
| 186 |
|
| 187 |
# definition of the option strings and their value types |
| 188 |
# possible types are: |
| 189 |
# - u: url |
| 190 |
# - b: boolean, saved as 0/1 |
| 191 |
# - p: path (local path) |
| 192 |
# - n: natural number |
| 193 |
# it allows n:[a]..[b] |
| 194 |
# if a is empty start at -infty |
| 195 |
# if b is empty end at +infty |
| 196 |
# so "n:.." is equivalent to "n" |
| 197 |
|
| 198 |
# $TLPDBOptions{"option"}->[0] --> type |
| 199 |
# ->[1] --> default value |
| 200 |
# ->[2] --> tlmgr name |
| 201 |
# ->[3] --> tlmgr description |
| 202 |
# the "option" is the value in the TLPDB |
| 203 |
|
| 204 |
our %TLPDBOptions = ( |
| 205 |
"autobackup" => |
| 206 |
[ "n:-1..", 1, "autobackup", |
| 207 |
"Number of backups to keep" ], |
| 208 |
"backupdir" => |
| 209 |
[ "p", $PackageBackupDir, "backupdir", |
| 210 |
"Directory for backups" ], |
| 211 |
"create_formats" => |
| 212 |
[ "b", 1, "formats", |
| 213 |
"Generate formats at installation or update" ], |
| 214 |
"desktop_integration" => |
| 215 |
[ "b", 1, "desktop_integration", |
| 216 |
"Create Start menu shortcuts (Windows)" ], |
| 217 |
"file_assocs" => |
| 218 |
[ "n:0..2", 1, "fileassocs", |
| 219 |
"Change file associations (Windows)" ], |
| 220 |
"generate_updmap" => |
| 221 |
[ "b", 0, "generate_updmap", |
| 222 |
"Run tlmgr generate updmap after maps have changed" ], |
| 223 |
"install_docfiles" => |
| 224 |
[ "b", 1, "docfiles", |
| 225 |
"Install documentation files" ], |
| 226 |
"install_srcfiles" => |
| 227 |
[ "b", 1, "srcfiles", |
| 228 |
"Install source files" ], |
| 229 |
"location" => |
| 230 |
[ "u", "__MASTER__", "repository", |
| 231 |
"Default package repository" ], |
| 232 |
"post_code" => |
| 233 |
[ "b", 1, "postcode", |
| 234 |
"Run postinst code blobs" ], |
| 235 |
"sys_bin" => |
| 236 |
[ "p", "/usr/local/bin", "sys_bin", |
| 237 |
"Destination for symlinks for binaries" ], |
| 238 |
"sys_info" => |
| 239 |
[ "p", "/usr/local/share/info", "sys_info", |
| 240 |
"Destination for symlinks for info docs" ], |
| 241 |
"sys_man" => |
| 242 |
[ "p", "/usr/local/share/man", "sys_man", |
| 243 |
"Destination for symlinks for man pages" ], |
| 244 |
"w32_multi_user" => |
| 245 |
[ "b", 1, "multiuser", |
| 246 |
"Install for all users (Windows)" ], |
| 247 |
); |
| 248 |
|
| 249 |
|
| 250 |
our %TLPDBSettings = ( |
| 251 |
"platform" => [ "s", "Main platform for this computer" ], |
| 252 |
"available_architectures" => [ "l","All available/installed architectures" ], |
| 253 |
"usertree" => [ "b", "This tree acts as user tree" ] |
| 254 |
); |
| 255 |
|
| 256 |
our $WindowsMainMenuName = "TeX Live $ReleaseYear"; |
| 257 |
|
| 258 |
# Comma-separated list of engines which do not exist on all platforms. |
| 259 |
our $PartialEngineSupport = "luametatex,luajithbtex,luajittex,mfluajit"; |
| 260 |
|
| 261 |
# Flags for error handling across the scripts and modules |
| 262 |
# all fine |
| 263 |
our $F_OK = 0; |
| 264 |
# |
| 265 |
# some warnings, but we still try to run post actions |
| 266 |
our $F_WARNING = 1; |
| 267 |
# |
| 268 |
# error, terminating |
| 269 |
our $F_ERROR = 2; |
| 270 |
# |
| 271 |
# all fine, but no need to run post actions |
| 272 |
our $F_NOPOSTACTION = 4; |
| 273 |
|
| 274 |
# The length of a checksum generated by tlchecksum and contained in |
| 275 |
# texlive.tlpdb.checksum. Needs to be in agreement with the hash |
| 276 |
# method used in TLCrypto::tlchecksum and TLCrypto::tldigest |
| 277 |
our $ChecksumLength = 128; |
| 278 |
|
| 279 |
# The program generating the checksum for the file given as first |
| 280 |
# argument |
| 281 |
our $ChecksumProgram = "sha512sum"; |
| 282 |
|
| 283 |
# The extension of the checksum file |
| 284 |
our $ChecksumExtension = "sha512"; |
| 285 |
|
| 286 |
1; |
| 287 |
|
| 288 |
|
| 289 |
=head1 NAME |
| 290 |
|
| 291 |
C<TeXLive::TLConfig> -- TeX Live configuration parameters |
| 292 |
|
| 293 |
=head1 SYNOPSIS |
| 294 |
|
| 295 |
use TeXLive::TLConfig; |
| 296 |
|
| 297 |
=head1 DESCRIPTION |
| 298 |
|
| 299 |
The L<TeXLive::TLConfig> module contains definitions of variables |
| 300 |
configuring all of TeX Live. |
| 301 |
|
| 302 |
=head2 EXPORTED VARIABLES |
| 303 |
|
| 304 |
All of the following variables are pulled into the callers namespace, |
| 305 |
i.e., are declared with C<EXPORT> (and C<EXPORT_OK>). |
| 306 |
|
| 307 |
=over 4 |
| 308 |
|
| 309 |
=item C<@TeXLive::TLConfig::MetaCategories> |
| 310 |
|
| 311 |
The list of meta categories, i.e., those categories whose packages only |
| 312 |
depend on other packages, but don't ship any files. Currently |
| 313 |
C<Collection> and <Scheme>. |
| 314 |
|
| 315 |
=item C<@TeXLive::TLConfig::NormalCategories> |
| 316 |
|
| 317 |
The list of normal categories, i.e., those categories whose packages do |
| 318 |
ship files. Currently C<TLCore>, C<Package>, C<ConTeXt>. |
| 319 |
|
| 320 |
=item C<@TeXLive::TLConfig::Categories> |
| 321 |
|
| 322 |
The list of all categories, i.e., the union of the above. |
| 323 |
|
| 324 |
=item C<$TeXLive::TLConfig::CategoriesRegexp> |
| 325 |
|
| 326 |
A regexp matching any category. |
| 327 |
|
| 328 |
=item C<$TeXLive::TLConfig::DefaultCategory> |
| 329 |
|
| 330 |
The default category used when creating new packages. |
| 331 |
|
| 332 |
=item C<$TeXLive::TLConfig::InfraLocation> |
| 333 |
|
| 334 |
The subdirectory with various infrastructure files (C<texlive.tlpdb>, |
| 335 |
tlpobj files, ...) relative to the root of the installation; currently |
| 336 |
C<tlpkg>. |
| 337 |
|
| 338 |
=item C<$TeXLive::TLConfig::DatabaseName> |
| 339 |
|
| 340 |
The name of our so-called database file: C<texlive.tlpdb>. It's just a |
| 341 |
plain text file, not any kind of relational or other database. |
| 342 |
|
| 343 |
=item C<$TeXLive::TLConfig::DatabaseLocation> |
| 344 |
|
| 345 |
Concatenation of C<InfraLocation> "/" C<DatabaseName>, i.e., |
| 346 |
C<tlpkg/texlive.tlpdb>. |
| 347 |
|
| 348 |
=item C<$TeXLive::TLConfig::BlockSize> |
| 349 |
|
| 350 |
The assumed block size, currently 4k. |
| 351 |
|
| 352 |
=item C<$TeXLive::TLConfig::Archive> |
| 353 |
=item C<$TeXLive::TLConfig::TeXLiveURL> |
| 354 |
|
| 355 |
These values specify where to find packages. |
| 356 |
|
| 357 |
=item C<$TeXLive::TLConfig::TeXLiveServerURL> |
| 358 |
=item C<$TeXLive::TLConfig::TeXLiveServerURLRegexp> |
| 359 |
=item C<$TeXLive::TLConfig::TeXLiveServerPath> |
| 360 |
|
| 361 |
C<TeXLiveURL> is concatenated from these values, with a string between. |
| 362 |
The defaults are respectively, C<https://mirror.ctan.org> and |
| 363 |
C<systems/texlive/tlnet/>. |
| 364 |
|
| 365 |
=item C<@TeXLive::TLConfig::CriticalPackagesList> |
| 366 |
=item C<@TeXLive::TLConfig::CriticalPackagesRegexp> |
| 367 |
|
| 368 |
A list of all those packages which we do not update regularly since they |
| 369 |
are too central, currently texlive.infra and (for Windows) tlperl.windows. |
| 370 |
|
| 371 |
=item C<@TeXLive::TLConfig::InstallExtraRequiredPackages> |
| 372 |
|
| 373 |
A list of packages that are required in addition to those from |
| 374 |
C<@CriticalPackagesList> for the installer to be able to conclude |
| 375 |
installation. |
| 376 |
|
| 377 |
=item C<$TeXLive::TLConfig::RelocTree> |
| 378 |
|
| 379 |
The texmf-tree name that can be relocated, defaults to C<texmf-dist>. |
| 380 |
|
| 381 |
=item C<$TeXLive::TLConfig::RelocPrefix> |
| 382 |
|
| 383 |
The string that replaces the C<RelocTree> in the tlpdb if a package is |
| 384 |
relocated, defaults to C<RELOC>". |
| 385 |
|
| 386 |
=back |
| 387 |
|
| 388 |
=head1 SEE ALSO |
| 389 |
|
| 390 |
All the other TeX Live modules and scripts, especially C<tlmgr> and |
| 391 |
C<install-tl>, and the documentation in the repository: |
| 392 |
C<Master/tlpkg/doc/>. |
| 393 |
|
| 394 |
=head1 AUTHORS AND COPYRIGHT |
| 395 |
|
| 396 |
This script and its documentation were written for the TeX Live |
| 397 |
distribution (L<https://tug.org/texlive>) and both are licensed under the |
| 398 |
GNU General Public License Version 2 or later. |
| 399 |
|
| 400 |
=cut |
| 401 |
|
| 402 |
### Local Variables: |
| 403 |
### perl-indent-level: 2 |
| 404 |
### tab-width: 2 |
| 405 |
### indent-tabs-mode: nil |
| 406 |
### End: |
| 407 |
# vim:set tabstop=2 expandtab: # |