From 122aa550d2bb8dfe57d5d7202ea9ca2d59a40480 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sat, 1 Dec 2018 08:47:14 +0100 Subject: [PATCH] gitlab-ci: patch gtk-doc to generate valid documentation We generate documentation for pages ([1], [2]), hence, we need to patch gtk-doc [3]. [1] https://networkmanager.pages.freedesktop.org/NetworkManager/NetworkManager/ [2] https://networkmanager.pages.freedesktop.org/NetworkManager/libnm/ [3] https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/2 --- .gitlab-ci.yml | 1 + contrib/scripts/nm-ci-patch-gtkdoc.sh | 40 +++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100755 contrib/scripts/nm-ci-patch-gtkdoc.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 700cb3d35..e5f9f9cfe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,7 @@ stages: - NM_INSTALL="dnf install -y" ./contrib/fedora/REQUIRED_PACKAGES - dnf install -y glibc-langpack-pl - locale -a + - contrib/scripts/nm-ci-patch-gtkdoc.sh || true checkpatch: image: fedora:28 diff --git a/contrib/scripts/nm-ci-patch-gtkdoc.sh b/contrib/scripts/nm-ci-patch-gtkdoc.sh new file mode 100755 index 000000000..e72a0a8f6 --- /dev/null +++ b/contrib/scripts/nm-ci-patch-gtkdoc.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# patch gtk-doc for https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/2 + +cd / + +patch -f -p 1 --fuzz 0 --reject-file=- < ;' + # This could be an opaque data structure, so we output an + # empty declaration. If the structure is actually found that + # will override this. + structsym = m9.group(1).upper() + logging.info('%s typedef: "%s"', structsym, m9.group(2)) + forward_decls[m9.group(2)] = '<%s>\n%s\n%s\n' % ( + structsym, m9.group(2), deprecated, structsym) + ++ bm = re.search(r'^(\S+)(Class|Iface|Interface)\b', m9.group(2)) ++ if bm: ++ objectname = bm.group(1) ++ logging.info('Found object: "%s"', objectname) ++ title = '%s' % objectname ++ + elif re.search(r'^\s*(?:struct|union)\s+_(\w+)\s*;', line): + # Skip private structs/unions. + logging.info('private struct/union') + + elif m10: + # Do a similar thing for normal structs as for typedefs above. + # But we output the declaration as well in this case, so we + # can differentiate it from a typedef. + structsym = m10.group(1).upper() + logging.info('%s:%s', structsym, m10.group(2)) +EOF +