diff --git a/CHANGES.txt b/CHANGES.txt index 0e16c1c2f7..b969bdfc62 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -15,10 +15,18 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From Joseph Brill: - Added error handling when creating MS VC detection debug log file specified by SCONS_MSCOMMON_DEBUG + + From Alex James: + - On Darwin, PermissionErrors are now handled while trying to access + /etc/paths.d. This may occur if SCons is invoked in a sandboxed + environment (such as Nix). From Dillan Mills: - Fix support for short options (`-x`). + From Keith F Prussing: + - Added support for tracking beamer themes in the LaTeX scanner. + From Mats Wichmann: - PackageVariable now does what the documentation always said it does if the variable is used on the command line with one of the enabling @@ -61,11 +69,6 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER a while loop to pull test info from a list of tests and then delete the test, structure the test data as a list of tuples and iterate it. - From Alex James: - - On Darwin, PermissionErrors are now handled while trying to access - /etc/paths.d. This may occur if SCons is invoked in a sandboxed - environment (such as Nix). - RELEASE 4.8.1 - Tue, 03 Sep 2024 17:22:20 -0700 diff --git a/RELEASE.txt b/RELEASE.txt index 76ae1d54a9..4abe25391c 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -33,6 +33,7 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY keyword arguments to Builder calls (or manually, through the undocumented Override method), were modified not to "leak" on item deletion. The item will now not be deleted from the base environment. +- Added support for tracking beamer themes in the LaTeX scanner. FIXES ----- diff --git a/SCons/Scanner/LaTeX.py b/SCons/Scanner/LaTeX.py index 4412aee64a..93c2752ca1 100644 --- a/SCons/Scanner/LaTeX.py +++ b/SCons/Scanner/LaTeX.py @@ -169,6 +169,11 @@ class LaTeX(ScannerBase): 'addsectionbib': 'BIBINPUTS', 'makeindex': 'INDEXSTYLE', 'usepackage': 'TEXINPUTS', + 'usetheme': 'TEXINPUTS', + 'usecolortheme': 'TEXINPUTS', + 'usefonttheme': 'TEXINPUTS', + 'useinnertheme': 'TEXINPUTS', + 'useoutertheme': 'TEXINPUTS', 'lstinputlisting': 'TEXINPUTS'} env_variables = SCons.Util.unique(list(keyword_paths.values())) two_arg_commands = ['import', 'subimport', @@ -193,6 +198,7 @@ def __init__(self, name, suffixes, graphics_extensions, *args, **kwargs) -> None | addglobalbib | addsectionbib | usepackage + | use(?:|color|font|inner|outer)theme(?:\s*\[[^\]]+\])? ) \s*{([^}]*)} # first arg (?: \s*{([^}]*)} )? # maybe another arg @@ -362,6 +368,9 @@ def scan(self, node, subdir: str='.'): if inc_type in self.two_arg_commands: inc_subdir = os.path.join(subdir, include[1]) inc_list = include[2].split(',') + elif re.match('use(|color|font|inner|outer)theme', inc_type): + inc_list = [re.sub('use', 'beamer', inc_type) + _ + '.sty' for _ in + include[1].split(',')] else: inc_list = include[1].split(',') for inc in inc_list: @@ -411,7 +420,7 @@ def scan_recurse(self, node, path=()): if n is None: # Do not bother with 'usepackage' warnings, as they most # likely refer to system-level files - if inc_type != 'usepackage': + if inc_type != 'usepackage' or re.match("use(|color|font|inner|outer)theme", inc_type): SCons.Warnings.warn( SCons.Warnings.DependencyWarning, "No dependency generated for file: %s " diff --git a/SCons/Scanner/LaTeXTests.py b/SCons/Scanner/LaTeXTests.py index ae3ae6659c..a3f0263475 100644 --- a/SCons/Scanner/LaTeXTests.py +++ b/SCons/Scanner/LaTeXTests.py @@ -63,6 +63,18 @@ \only<2>{\includegraphics{inc7.png}} """) +test.write('test5.latex',r""" +\usetheme{scons} +""") +test.write('beamerthemescons.sty',r""" +\usecolortheme[option]{scons} +\usefonttheme{scons} +\useinnertheme{scons} +\useoutertheme{scons} +""") +for theme in ('color', 'font', 'inner', 'outer'): + test.write('beamer' + theme + 'themescons.sty', "\n") + test.subdir('subdir') test.write('inc1.tex',"\n") @@ -167,6 +179,16 @@ def runTest(self) -> None: files = ['inc1.tex', 'inc2.tex', 'inc5.xyz', 'inc7.png'] deps_match(self, deps, files) +class LaTeXScannerTestCase5(unittest.TestCase): + def runTest(self) -> None: + env = DummyEnvironment(TEXINPUTS=[test.workpath("subdir")],LATEXSUFFIXES = [".tex", ".ltx", ".latex"]) + s = SCons.Scanner.LaTeX.LaTeXScanner() + path = s.path(env) + deps = s(env.File('test5.latex'), env, path) + files = ['beamer' + _ + 'themescons.sty' for _ in + ('color', 'font', 'inner', 'outer', '')] + deps_match(self, deps, files) + if __name__ == "__main__": unittest.main()