diff options
-rw-r--r-- | documentation/conf.py | 25 | ||||
-rw-r--r-- | documentation/poky.yaml | 89 | ||||
-rw-r--r-- | documentation/sphinx/yocto-vars.py | 38 |
3 files changed, 152 insertions, 0 deletions
diff --git a/documentation/conf.py b/documentation/conf.py index dd20e44a1a..5519acb87a 100644 --- a/documentation/conf.py +++ b/documentation/conf.py | |||
@@ -26,10 +26,15 @@ author = 'The Linux Foundation' | |||
26 | 26 | ||
27 | # -- General configuration --------------------------------------------------- | 27 | # -- General configuration --------------------------------------------------- |
28 | 28 | ||
29 | # to load local extension from the folder 'sphinx' | ||
30 | sys.path.insert(0, os.path.abspath('sphinx')) | ||
31 | |||
29 | # Add any Sphinx extension module names here, as strings. They can be | 32 | # Add any Sphinx extension module names here, as strings. They can be |
30 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | 33 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
31 | # ones. | 34 | # ones. |
32 | extensions = [ | 35 | extensions = [ |
36 | 'sphinx.ext.extlinks', | ||
37 | 'yocto-vars' | ||
33 | ] | 38 | ] |
34 | 39 | ||
35 | # Add any paths that contain templates here, relative to this directory. | 40 | # Add any paths that contain templates here, relative to this directory. |
@@ -44,6 +49,26 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | |||
44 | # set it ourselves. | 49 | # set it ourselves. |
45 | master_doc = 'index' | 50 | master_doc = 'index' |
46 | 51 | ||
52 | # create substitution for project configuration variables | ||
53 | rst_prolog = """ | ||
54 | .. |project_name| replace:: %s | ||
55 | .. |copyright| replace:: %s | ||
56 | .. |author| replace:: %s | ||
57 | """ % (project, copyright, author) | ||
58 | |||
59 | # external links and substitutions | ||
60 | extlinks = { | ||
61 | 'yocto_home': ('https://yoctoproject.org%s', None), | ||
62 | 'yocto_wiki': ('https://wiki.yoctoproject.org%s', None), | ||
63 | 'yocto_dl': ('https://downloads.yoctoproject.org%s', None), | ||
64 | 'yocto_lists': ('https://lists.yoctoproject.org%s', None), | ||
65 | 'yocto_bugs': ('https://bugzilla.yoctoproject.org%s', None), | ||
66 | 'yocto_ab': ('https://autobuilder.yoctoproject.org%s', None), | ||
67 | 'yocto_git': ('https://git.yoctoproject.org%s', None), | ||
68 | 'oe_home': ('https://www.openembedded.org%s', None), | ||
69 | 'oe_lists': ('https://lists.openembedded.org%s', None), | ||
70 | } | ||
71 | |||
47 | # -- Options for HTML output ------------------------------------------------- | 72 | # -- Options for HTML output ------------------------------------------------- |
48 | 73 | ||
49 | # The theme to use for HTML and HTML Help pages. See the documentation for | 74 | # The theme to use for HTML and HTML Help pages. See the documentation for |
diff --git a/documentation/poky.yaml b/documentation/poky.yaml new file mode 100644 index 0000000000..7d544b41aa --- /dev/null +++ b/documentation/poky.yaml | |||
@@ -0,0 +1,89 @@ | |||
1 | DISTRO : "3.1" | ||
2 | DISTRO_COMPRESSED : "31" | ||
3 | DISTRO_NAME_NO_CAP : "dunfell" | ||
4 | DISTRO_NAME : "Dunfell" | ||
5 | DISTRO_NAME_NO_CAP_MINUS_ONE : "zeus" | ||
6 | DISTRO_NAME_MINUS_ONE : "Zeus" | ||
7 | YOCTO_DOC_VERSION : "3.1" | ||
8 | YOCTO_DOC_VERSION_MINUS_ONE : "3.0.2" | ||
9 | DISTRO_REL_TAG : "yocto-3.1" | ||
10 | METAINTELVERSION : "12.0" | ||
11 | REL_MONTH_YEAR : "April 2020" | ||
12 | META_INTEL_REL_TAG : "&METAINTELVERSION;-&DISTRO_NAME_NO_CAP;-&YOCTO_DOC_VERSION;" | ||
13 | POKYVERSION : "23.0.0" | ||
14 | POKYVERSION_COMPRESSED : "2300" | ||
15 | YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;" | ||
16 | COPYRIGHT_YEAR : "2010-2020" | ||
17 | ORGNAME : "The Yocto Project" | ||
18 | ORGEMAIL : "docs@lists.yoctoproject.org" | ||
19 | YOCTO_DL_URL : "http://downloads.yoctoproject.org" | ||
20 | YOCTO_HOME_URL : "http://www.yoctoproject.org" | ||
21 | YOCTO_LISTS_URL : "http://lists.yoctoproject.org" | ||
22 | YOCTO_BUGZILLA_URL : "http://bugzilla.yoctoproject.org" | ||
23 | YOCTO_WIKI_URL : "https://wiki.yoctoproject.org" | ||
24 | YOCTO_AB_URL : "http://autobuilder.yoctoproject.org" | ||
25 | YOCTO_GIT_URL : "http://git.yoctoproject.org" | ||
26 | YOCTO_ADTREPO_URL : "http://adtrepo.yoctoproject.org" | ||
27 | OE_HOME_URL : "http://www.openembedded.org" | ||
28 | OE_LISTS_URL : "http://lists.openembedded.org/mailman" | ||
29 | OE_DOCS_URL : "http://docs.openembedded.org" | ||
30 | OH_HOME_URL : "http://o-hand.com" | ||
31 | BITBAKE_HOME_URL : "http://developer.berlios.de/projects/bitbake/" | ||
32 | YOCTO_DOCS_URL : "&YOCTO_HOME_URL;/docs" | ||
33 | YOCTO_SOURCES_URL : "&YOCTO_HOME_URL;/sources/" | ||
34 | YOCTO_AB_PORT_URL : "https://autobuilder.yocto.io/" | ||
35 | YOCTO_AB_NIGHTLY_URL : "&YOCTO_AB_PORT_URL;/pub/nightly/" | ||
36 | YOCTO_POKY_URL : "&YOCTO_DL_URL;/releases/poky/" | ||
37 | YOCTO_RELEASE_DL_URL : "&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;" | ||
38 | YOCTO_TOOLCHAIN_DL_URL : "&YOCTO_RELEASE_DL_URL;/toolchain/" | ||
39 | YOCTO_ADTINSTALLER_DL_URL : "&YOCTO_RELEASE_DL_URL;/adt-installer" | ||
40 | YOCTO_POKY_DL_URL : "&YOCTO_RELEASE_DL_URL;/&YOCTO_POKY;.tar.bz2" | ||
41 | YOCTO_MACHINES_DL_URL : "&YOCTO_RELEASE_DL_URL;/machines" | ||
42 | YOCTO_QEMU_DL_URL : "&YOCTO_MACHINES_DL_URL;/qemu" | ||
43 | YOCTO_PYTHON-i686_DL_URL : "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-i686.tar.bz2" | ||
44 | YOCTO_PYTHON-x86_64_DL_URL : "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-x86_64.tar.bz2" | ||
45 | YOCTO_DOCS_QS_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/yocto-project-qs/yocto-project-qs.html" | ||
46 | YOCTO_DOCS_ADT_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/adt-manual/adt-manual.html" | ||
47 | YOCTO_DOCS_REF_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/ref-manual/ref-manual.html" | ||
48 | YOCTO_DOCS_BSP_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/bsp-guide/bsp-guide.html" | ||
49 | YOCTO_DOCS_DEV_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/dev-manual/dev-manual.html" | ||
50 | YOCTO_DOCS_KERNEL_DEV_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/kernel-dev/kernel-dev.html" | ||
51 | YOCTO_DOCS_PROF_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/profile-manual/profile-manual.html" | ||
52 | YOCTO_DOCS_MM_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/mega-manual/mega-manual.html" | ||
53 | YOCTO_DOCS_BB_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/bitbake-user-manual/bitbake-user-manual.html" | ||
54 | YOCTO_DOCS_TOAST_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/toaster-manual/toaster-manual.html" | ||
55 | YOCTO_DOCS_SDK_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/sdk-manual/sdk-manual.html" | ||
56 | YOCTO_DOCS_OM_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/overview-manual/overview-manual.html" | ||
57 | YOCTO_DOCS_BRIEF_URL : "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/brief-yoctoprojectqs/brief-yoctoprojectqs.html" | ||
58 | YOCTO_ADTPATH_DIR : "/opt/poky/&DISTRO;" | ||
59 | YOCTO_POKY_TARBALL : "&YOCTO_POKY;.tar.bz2" | ||
60 | OE_INIT_PATH : "&YOCTO_POKY;/oe-init-build-env" | ||
61 | OE_INIT_FILE : "oe-init-build-env" | ||
62 | UBUNTU_HOST_PACKAGES_ESSENTIAL : "gawk wget git-core diffstat unzip texinfo gcc-multilib \ | ||
63 | build-essential chrpath socat cpio python3 python3-pip python3-pexpect \ | ||
64 | xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \ | ||
65 | pylint3 xterm python3-subunit mesa-common-dev" | ||
66 | FEDORA_HOST_PACKAGES_ESSENTIAL : "gawk make wget tar bzip2 gzip python3 unzip perl patch \ | ||
67 | diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \ | ||
68 | ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-bignum socat \ | ||
69 | python3-pexpect findutils which file cpio python python3-pip xz python3-GitPython \ | ||
70 | python3-jinja2 SDL-devel xterm rpcgen mesa-libGL-devel" | ||
71 | OPENSUSE_HOST_PACKAGES_ESSENTIAL : "python gcc gcc-c++ git chrpath make wget python-xml \ | ||
72 | diffstat makeinfo python-curses patch socat python3 python3-curses tar python3-pip \ | ||
73 | python3-pexpect xz which python3-Jinja2 Mesa-libEGL1 libSDL-devel xterm rpcgen Mesa-dri-devel | ||
74 | $ sudo pip3 install GitPython" | ||
75 | CENTOS7_HOST_PACKAGES_ESSENTIAL : "-y epel-release | ||
76 | $ sudo yum makecache | ||
77 | $ sudo yum install gawk make wget tar bzip2 gzip python3 unzip perl patch \ | ||
78 | diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat \ | ||
79 | perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python36-pip xz \ | ||
80 | which SDL-devel xterm mesa-libGL-devel | ||
81 | $ sudo pip3 install GitPython jinja2" | ||
82 | CENTOS8_HOST_PACKAGES_ESSENTIAL : "-y epel-release | ||
83 | $ sudo dnf config-manager --set-enabled PowerTools | ||
84 | $ sudo dnf makecache | ||
85 | $ sudo dnf install gawk make wget tar bzip2 gzip python3 unzip perl patch \ | ||
86 | diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath ccache \ | ||
87 | socat perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python3-pip \ | ||
88 | python3-GitPython python3-jinja2 python3-pexpect xz which SDL-devel xterm \ | ||
89 | rpcgen mesa-libGL-devel" | ||
diff --git a/documentation/sphinx/yocto-vars.py b/documentation/sphinx/yocto-vars.py new file mode 100644 index 0000000000..5689472991 --- /dev/null +++ b/documentation/sphinx/yocto-vars.py | |||
@@ -0,0 +1,38 @@ | |||
1 | #!/usr/bin/env python | ||
2 | import re | ||
3 | import yaml | ||
4 | |||
5 | import sphinx | ||
6 | from sphinx.application import Sphinx | ||
7 | |||
8 | __version__ = '1.0' | ||
9 | |||
10 | # Variables substitutions. Uses {VAR} subst using variables defined in poky.yaml | ||
11 | # Each .rst file is processed after source-read event (subst_vars_replace runs once per file) | ||
12 | subst_vars = {} | ||
13 | |||
14 | def subst_vars_replace(app: Sphinx, docname, source): | ||
15 | result = source[0] | ||
16 | for k in subst_vars: | ||
17 | result = result.replace("&"+k+";", subst_vars[k]) | ||
18 | source[0] = result | ||
19 | |||
20 | PATTERN = re.compile(r'&(.*?);') | ||
21 | def expand(val, src): | ||
22 | return PATTERN.sub(lambda m: expand(src.get(m.group(1), ''), src), val) | ||
23 | |||
24 | def setup(app: Sphinx): | ||
25 | #FIXME: if poky.yaml changes, files are not reprocessed. | ||
26 | with open("poky.yaml") as file: | ||
27 | subst_vars.update(yaml.load(file, Loader=yaml.FullLoader)) | ||
28 | |||
29 | for k in subst_vars: | ||
30 | subst_vars[k] = expand(subst_vars[k], subst_vars) | ||
31 | |||
32 | app.connect('source-read', subst_vars_replace) | ||
33 | |||
34 | return dict( | ||
35 | version = __version__, | ||
36 | parallel_read_safe = True, | ||
37 | parallel_write_safe = True | ||
38 | ) | ||