Changeset 07f151f in rtems-docs


Ignore:
Timestamp:
11/10/22 04:32:44 (5 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
5
Children:
031cb12
Parents:
30e5832
Message:

waf: Backport from main build fixes

Closes #4752

Location:
common
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • common/conf.py

    r30e5832 r07f151f  
    1 import version as rtems_version
     1import datetime
    22
    33extensions = [
     
    1313]
    1414
     15bibtex_bibfiles = ['../common/refs.bib']
     16
    1517extlinks = {'release_path': ('https://ftp.rtems.org/pub/rtems/releases', None) }
    1618
     
    2931# General information about the project.
    3032project = u'RTEMS Documentation Project'
    31 copyright = u'1988, 2020 RTEMS Project and contributors'
     33copyright = u'1988, ' + str(datetime.datetime.now().year) + ' RTEMS Project and contributors'
    3234
    3335# The version info for the project you're documenting, acts as replacement for
     
    3638#
    3739# The short X.Y version.
    38 version = rtems_version.version()
     40#version = rtems_version.version()
    3941
    4042# The full version, including alpha/beta/rc tags.
    41 release = rtems_version.string()
    42 
    43 major = rtems_version.major()
    44 minor = rtems_version.minor()
    45 revision = rtems_version.revision()
     43#release = rtems_version.string()
    4644
    4745# The language for content autogenerated by Sphinx. Refer to documentation
     
    7573# The name of the Pygments (syntax highlighting) style to use.
    7674pygments_style = 'sphinx'
     75
     76# http://www.sphinx-doc.org/en/master/usage/configuration.html#confval-numfig
     77numfig = True
    7778
    7879# A list of ignored prefixes for module index sorting.
  • common/latex.py

    r30e5832 r07f151f  
    44
    55import os
    6 import platform
    76import re
    87
     
    8382    uname = os.uname()
    8483    if uname[0] == 'Linux':
    85         distro = platform.dist()
     84        try:
     85            from distro import linux_distribution
     86        except:
     87            from platform import linux_distribution
     88        distro = linux_distribution()
    8689        name = '%s/%s' % (uname[0], distro[0])
    8790        version = distro[1]
  • common/rtemsdomain.py

    r30e5832 r07f151f  
    88from sphinx.util.nodes import make_refnode
    99from sphinx.util.docfields import Field, TypedField
     10
     11import version as rtems_version
    1012
    1113"""
     
    3133
    3234role_url = {
    33         "trac":                         ("Trac",                                "https://devel.rtems.org"),
    34         "devel":                        ("Developer Site",              "https://devel.rtems.org"),
    35         "www":                          ("RTEMS Home",                  "https://www.rtems.org/"),
    36         "buildbot":                     ("Buildbot Instance",   "https://buildbot.rtems.org/"),
    37         "builder":                      ("Builder Site",                "https://builder.rtems.org/"),
    38         "docs":                         ("Documentation Site",  "https://docs.rtems.org/"),
    39         "lists":                        ("Mailing Lists",               "https://lists.rtems.org/"),
    40         "git":                          ("Git Repositories",    "https://git.rtems.org/"),
    41         "ftp":                          ("FTP File Server",     "https://ftp.rtems.org/"),
    42         "review":                       ("Gerrit Code Review",  "https://review.rtems.org/"),
    43         "bugs":                         ("Bugs Database",               "https://devel.rtems.org/wiki/Bugs/"),
    44         "gsoc":                         ("Google Summer of Code", "https://devel.rtems.org/wiki/GSoC/"),
    45         "socis":                        ("ESA SOCIS",                   "https://devel.rtems.org/wiki/SOCIS/")
     35        "trac":         ("Trac",                        "https://devel.rtems.org"),
     36        "devel":        ("Developer Site",              "https://devel.rtems.org"),
     37        "www":          ("RTEMS Home",                  "https://www.rtems.org/"),
     38        "buildbot":     ("Buildbot Instance",           "https://buildbot.rtems.org/"),
     39        "builder":      ("Builder Site",                "https://builder.rtems.org/"),
     40        "docs":         ("Documentation Site",          "https://docs.rtems.org/"),
     41        "lists":        ("Mailing Lists",               "https://lists.rtems.org/"),
     42        "git":          ("Git Repositories",            "https://git.rtems.org/"),
     43        "ftp":          ("FTP File Server",             "https://ftp.rtems.org/"),
     44        "review":       ("Gerrit Code Review",          "https://review.rtems.org/"),
     45        "bugs":         ("Bugs Database",               "https://devel.rtems.org/wiki/Bugs/"),
     46        "gsoc":         ("Google Summer of Code",       "https://devel.rtems.org/wiki/GSoC/"),
     47        "socis":        ("ESA SOCIS",                   "https://devel.rtems.org/wiki/SOCIS/")
    4648}
    4749
    4850
    4951role_list = {
    50         "announce":     ("Announce Mailing List",                       "https://lists.rtems.org/mailman/listinfo/announce/"),
    51         "bugs":         ("Bugs Mailing List",                           "https://lists.rtems.org/mailman/listinfo/bugs/"),
    52         "devel":        ("Developers Mailing List",                     "https://lists.rtems.org/mailman/listinfo/devel/"),
    53         "build":        ("Build Logs",                                  "https://lists.rtems.org/mailman/listinfo/build"),
    54         "users":        ("Users Mailing List",                          "https://lists.rtems.org/mailman/listinfo/users/"),
     52        "announce":     ("Announce Mailing List",               "https://lists.rtems.org/mailman/listinfo/announce/"),
     53        "bugs":         ("Bugs Mailing List",                   "https://lists.rtems.org/mailman/listinfo/bugs/"),
     54        "devel":        ("Developers Mailing List",             "https://lists.rtems.org/mailman/listinfo/devel/"),
     55        "build":        ("Build Logs",                          "https://lists.rtems.org/mailman/listinfo/build"),
     56        "users":        ("Users Mailing List",                  "https://lists.rtems.org/mailman/listinfo/users/"),
    5557        "vc":           ("Version Control Mailing List",        "https://lists.rtems.org/mailman/listinfo/vc/"),
    5658}
     
    120122
    121123
     124def rtems_replace(app, docname, source):
     125        dump = False
     126        line = source[0]
     127        for key in app.config.replacements:
     128                line = line.replace(key, app.config.replacements[key])
     129        source[0] = line
     130
     131replacements = {
     132}
    122133
    123134def setup(app):
     135        app.add_config_value('rtems_major', str(app.config.overrides['rtems_major']), True)
     136        app.add_config_value('rtems_minor', str(app.config.overrides['rtems_minor']), True)
     137        app.add_config_value('rtems_revision', str(app.config.overrides['rtems_revision']), True)
     138        major = str(app.config.overrides['rtems_major'])
     139        minor = str(app.config.overrides['rtems_minor'])
     140        revision = str(app.config.overrides['rtems_revision'])
     141        if revision.isdigit():
     142                majminrev = major + '.' + minor + '.' + revision
     143        else:
     144                majminrev = major + '.' + revision
     145        replacements["@rtems-version@"] = str(app.config.overrides['version'])
     146        replacements["@rtems-ver-major@"] = major
     147        replacements["@rtems-ver-minor@"] = minor
     148        replacements["@rtems-ver-revision@"] = revision
     149        replacements["@rtems-ver-majminrev@"] = majminrev
     150        app.add_config_value('replacements', replacements, True)
     151        app.connect('source-read', rtems_replace)
    124152        app.add_domain(RTEMSDomain)
    125153        return {'version': "1.0", 'parallel_read_safe': True}
  • common/version.py

    r30e5832 r07f151f  
    112112def get(ctx, rtems_major_version):
    113113    global _version
     114    global _major
     115    global _minor
     116    global _revision
    114117    global _date
    115118    global _released
     
    185188
    186189def revision():
    187     return revision
     190    return _revision
    188191
    189192def date():
  • common/waf.py

    r30e5832 r07f151f  
    182182        rst_node = bld.srcnode.make_node('testbuild/contents.rst')
    183183        rst_node.parent.mkdir()
    184         rst_node.write('.. COMMENT test sphinx\n')
     184        rst_node.write('.. COMMENT test sphinx' + os.linesep)
     185        bib_node = bld.srcnode.make_node('testbuild/refs.bib')
     186        bib_node.write(os.linesep)
     187        conf_node = bld.srcnode.make_node('testbuild/conf.py')
     188        conf_node.write(os.linesep.join(["master_doc='contents'",
     189                                         "bibtex_bibfiles = ['refs.bib']"]))
    185190        bld(rule = bld.kw['rule'], source = rst_node)
    186191
     
    188193    try:
    189194        ctx.run_build(fragment = 'xx',
    190                       rule = "${BIN_SPHINX_BUILD} -b html -D extensions=%s -C . out" % (extension),
     195                      rule = "${BIN_SPHINX_BUILD} -b html -D extensions=%s -c . . out" % (extension),
    191196                      build_fun = run_sphinx,
    192197                      env = ctx.env)
     
    267272        ctx.env.BUILD_PDF = 'yes'
    268273
    269     ctx.envBUILD_SINGLEHTML = 'no'
     274    ctx.env.BUILD_SINGLEHTML = 'no'
    270275    if ctx.options.singlehtml:
    271276        check_inliner = not ctx.env.BIN_INLINER
     
    277282                          "(https://github.com/remy/inliner)")
    278283
    279     ctx.envBUILD_PLANTUML = 'no'
     284    ctx.env.BUILD_PLANTUML = 'no'
    280285    if ctx.options.plantuml:
    281286        check_plantuml = not ctx.env.BIN_PUML
     
    287292                          "(https://www.npmjs.com/package/node-plantuml)")
    288293
    289     ctx.envBUILD_DITAA = 'no'
     294    ctx.env.BUILD_DITAA = 'no'
    290295    if ctx.options.ditaa:
    291296        #
     
    336341                                                               ctx.path.name))
    337342    )
     343    env_latex = ctx.env.derive()
     344    env_latex.TEXINPUTS = output_dir + ':'
    338345    ctx(
    339346        features     = 'tex',
     
    341348        type         = ctx.env.LATEX_CMD,
    342349        source       = "%s/%s.tex" % (buildtype, ctx.path.name),
    343         prompt       = 0
     350        prompt       = 0,
     351        env          = env_latex
    344352    )
    345353    ctx.install_files('${PREFIX}',
Note: See TracChangeset for help on using the changeset viewer.