[gimp/wip/Jehan/docs-tarball] data, devel-docs, gitlab-ci: improve the docs tarball.




commit 3718a307a44d9fd980c9b80c2d37969856974997
Author: Jehan <jehan girinstud io>
Date:   Fri Sep 9 16:37:40 2022 +0200

    data, devel-docs, gitlab-ci: improve the docs tarball.
    
    - Use a relative path for GIMP_LOGO_PATH inside the gi-docgen generated
      HTML, and not an absolute path taken from build dir (otherwise this
      would break, for installed docs, but also for the tarball and the
      developer website!).
    - Also use either gimp-logo.png or gimp-devel-logo.png depending on
      whether we are on a stable or unstable branch.
    - Install these in images/ inside the GIMP docs folder, which
      corresponds to the relative path given to GIMP_LOGO_PATH.
    - The installed root dir will be $datadir/doc/gimp-2.99/, e.g.
      /usr/share/doc/gimp-2.99/
    - Inside this folder, the library references will be in libgimp-3.0/ and
      libgimpui-3.0/ (instead of weird Gimp-3.0/ and GimpUi-3.0/). Note that
      the root dir uses the application version (2.99) whereas the library
      folder use the API versions. These are different in development phase.
    - Archive the gi-docgen installed files, not taken from the build dir,
      to avoid packaging temp files, such as the .toml files. Note that
      `g-ir-docs` files are still taken from the build dir, as we don't
      install them yet.
    - Finally package all this in a directory before archiving in a tar.xz,
      named the same as the directory (e.g. gimp-api-docs-2.99.13/ inside
      gimp-api-docs-2.99.13.tar.xz).

 .gitlab-ci.yml                           | 18 +++++++++++-------
 data/images/meson.build                  |  7 +++++++
 devel-docs/reference/gimp-ui/meson.build |  6 +++---
 devel-docs/reference/gimp/meson.build    |  6 +++---
 4 files changed, 24 insertions(+), 13 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cfc4c85fae..4ee766398b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -189,7 +189,7 @@ deps-debian:
     name: "app-build-${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
     paths:
     - _build
-    #- "${INSTALL_DIR}"
+    - "${INSTALL_DIR}"
   before_script:
     - export PKG_CONFIG_PATH="${INSTALL_PREFIX}/lib/pkgconfig:${INSTALL_PREFIX}/share/pkgconfig"
     - export PKG_CONFIG_PATH="${INSTALL_PREFIX}/lib/`gcc -print-multiarch`/pkgconfig/:$PKG_CONFIG_PATH"
@@ -249,6 +249,7 @@ gimp-meson-debian:
         exit 1;
       fi
     - ninja -C _build dist
+    - ninja -C _build install
 
 gimp-clang-debian:
   rules:
@@ -834,13 +835,16 @@ dev-docs:
     - gimp-docs-*.tar.xz.SHA256SUMS
     - gimp-docs-*.tar.xz.SHA512SUMS
   script:
-    - mv _build/devel-docs/g-ir-docs .
-    - mv _build/devel-docs/reference .
     - GIMP_VER=$(grep GIMP_VERSION _build/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') &&
-      FILENAME="gimp-docs-$GIMP_VER.tar.xz"                                                 &&
-      tar -cJf ${FILENAME} g-ir-docs reference                                              &&
-      sha256sum gimp-docs-*.tar.xz > ${FILENAME}.SHA256SUMS                                 &&
-      sha512sum gimp-docs-*.tar.xz > ${FILENAME}.SHA512SUMS
+      APP_VER=$(echo $GIMP_VER | sed 's/\([0-9]\+\.[0-9]\+\)\..*/\1/')                      &&
+      DIR_NAME=gimp-api-docs-$GIMP_VER                                                      &&
+      mkdir $DIR_NAME                                                                       &&
+      mv "${INSTALL_PREFIX}/share/doc/gimp-$APP_VER" $DIR_NAME/reference                    &&
+      mv _build/devel-docs/g-ir-docs $DIR_NAME/                                             &&
+      TAR_NAME="$DIR_NAME.tar.xz"                                                           &&
+      tar -cJf ${TAR_NAME} $DIR_NAME                                                        &&
+      sha256sum $TAR_NAME > ${TAR_NAME}.SHA256SUMS                                          &&
+      sha512sum $TAR_NAME > ${TAR_NAME}.SHA512SUMS
   needs: ["gimp-meson-debian"]
 
 flatpak-nightly:
diff --git a/data/images/meson.build b/data/images/meson.build
index a570661cf8..75b14a46e0 100644
--- a/data/images/meson.build
+++ b/data/images/meson.build
@@ -10,3 +10,10 @@ install_data(
   images,
   install_dir: gimpdatadir / 'images',
 )
+
+if gi_docgen.found()
+  install_data(
+    stable ? 'gimp-logo.png' : 'gimp-devel-logo.png',
+    install_dir: get_option('datadir') / 'doc' / 'gimp-@0@'.format(gimp_app_version) / 'images',
+  )
+endif
diff --git a/devel-docs/reference/gimp-ui/meson.build b/devel-docs/reference/gimp-ui/meson.build
index dcec4be923..803e74b148 100644
--- a/devel-docs/reference/gimp-ui/meson.build
+++ b/devel-docs/reference/gimp-ui/meson.build
@@ -8,13 +8,13 @@ gimp_ui_doc_toml = configure_file(
   output: '@BASENAME@',
   configuration: {
     'GIMP_VERSION': gimp_version,
-    'GIMP_LOGO': gimp_logo_dir / 'gimp-logo.png',
+    'GIMP_LOGO': '../images/' + (stable ? 'gimp-logo.png' : 'gimp-devel-logo.png'),
   },
 )
 
 gimp_ui_docs = custom_target('gimp-ui-docs',
   input: libgimpui_gir[0],
-  output: 'GimpUi-@0@'.format(gimp_api_version),
+  output: 'libgimpui-@0@'.format(gimp_api_version),
   command: [
     gi_docgen,
     'generate',
@@ -34,5 +34,5 @@ gimp_ui_docs = custom_target('gimp-ui-docs',
   ],
   build_by_default: true,
   install: true,
-  install_dir: get_option('datadir') / 'doc',
+  install_dir: get_option('datadir') / 'doc' / 'gimp-@0@'.format(gimp_app_version),
 )
diff --git a/devel-docs/reference/gimp/meson.build b/devel-docs/reference/gimp/meson.build
index 79b506355e..fc7c6a6f77 100644
--- a/devel-docs/reference/gimp/meson.build
+++ b/devel-docs/reference/gimp/meson.build
@@ -7,13 +7,13 @@ gimp_doc_toml = configure_file(
   output: '@BASENAME@',
   configuration: {
     'GIMP_VERSION': gimp_version,
-    'GIMP_LOGO_PATH': gimp_logo_dir / 'gimp-logo.png',
+    'GIMP_LOGO_PATH': '../images/' + (stable ? 'gimp-logo.png' : 'gimp-devel-logo.png'),
   },
 )
 
 gimp_docs = custom_target('gimp-docs',
   input: libgimp_gir[0],
-  output: 'Gimp-@0@'.format(gimp_api_version),
+  output: 'libgimp-@0@'.format(gimp_api_version),
   command: [
     gi_docgen,
     'generate',
@@ -31,5 +31,5 @@ gimp_docs = custom_target('gimp-docs',
   ],
   build_by_default: true,
   install: true,
-  install_dir: get_option('datadir') / 'doc',
+  install_dir: get_option('datadir') / 'doc' / 'gimp-@0@'.format(gimp_app_version),
 )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]