[citemplates/rewrite-manifest: 2/3] rewrite manifest to build the module from the current directory



commit cf1fe9289e090e4763414cdadf05471902b3e52f
Author: Abderrahim Kitouni <akitouni gnome org>
Date:   Sun Mar 15 11:17:26 2020 +0100

    rewrite manifest to build the module from the current directory
    
    This allows to run flatpak-builder once to build the app

 flatpak/flatpak_ci_initiative.yml | 60 ++++-----------------------------------
 1 file changed, 5 insertions(+), 55 deletions(-)
---
diff --git a/flatpak/flatpak_ci_initiative.yml b/flatpak/flatpak_ci_initiative.yml
index 82b752a..aafd801 100644
--- a/flatpak/flatpak_ci_initiative.yml
+++ b/flatpak/flatpak_ci_initiative.yml
@@ -5,59 +5,9 @@
   tags:
     - flatpak
   script:
-    - flatpak-builder --user --disable-rofiles-fuse --stop-at=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH}
-    # Make sure to keep this in sync with the Flatpak manifest, all arguments
-    # are passed except the config-args because we build it ourselves
-    - flatpak build flatpak_app meson --prefix=/app ${MESON_ARGS} _build
-    - flatpak build flatpak_app ninja -C _build install
-    - |
-      flatpak build flatpak_app bash -c \
-      'for lang in $(ls /app/share/locale/); do \
-        ll=$(echo ${lang} | egrep -o '^[a-z]+'); \
-        test ${ll} == en && continue; \
-        test -L /app/share/locale/${lang} && continue; \
-        mkdir -p /app/share/runtime/locale/${ll}/share; \
-        mv /app/share/locale/${lang} /app/share/runtime/locale/${ll}/share/; \
-        ln -s ../../share/runtime/locale/${ll}/share/${lang} /app/share/locale; \
-      done'
-    - |
-      flatpak build flatpak_app bash -c \
-      "find /app -type f '(' -perm -111 -o -name '*.so*' ')' -print0 | while read -r -d $'\\0' file; do \
-        read -n4 hdr < \${file} || continue; \
-        if [ \"\$hdr\" != \$(printf \\\\x7fELF) ]; then \
-          continue; \
-        fi; \
-        if objdump -j .gnu_debuglink -s \${file} &> /dev/null; then \
-          continue; \
-        fi; \
-        case \${file} in /app/lib/debug/*) \
-            continue ;; \
-        esac; \
-        debugedit -i --list-file=source-files.part --base-dir=\${PWD} 
--dest-dir=/app/lib/debug/source//${FLATPAK_MODULE} \${file} &> /dev/null; \
-        cat source-files.part >> source-files; \
-        realpath=\$(realpath -s --relative-to=/app \${file}); \
-        debugfile=/app/lib/debug/\${realpath}.debug; \
-        mkdir -p \$(dirname \${debugfile}); \
-        objcopy --only-keep-debug --compress-debug-sections \${file} \${debugfile}; \
-        chmod 644 \${debugfile}; \
-        mode=\$(stat -c 0%a \${file}); \
-        [ -w \${file} ] || chmod +w \${file}; \
-        strip --remove-section=.comment --remove-section=.note --strip-unneeded 
--remove-section=.gnu_debugaltlink \${file}; \
-        objcopy --add-gnu-debuglink \${debugfile} \${file}; \
-        chmod \${mode} \${file}; \
-      done; \
-      sort -zu < source-files | while read -r -d \$'\\0' source; do \
-        dst=/app/lib/debug/source/${FLATPAK_MODULE}/\${source}; \
-        src=\${source}; \
-        if [ -d \${src} ]; then \
-          install -m0755 -d \${dst}; \
-          continue; \
-        fi; \
-        [ -f \${src} ] || continue; \
-        install -m0644 -D \${src} \${dst}; \
-      done"
+    - rewrite-flatpak-manifest ${MANIFEST_PATH} ${FLATPAK_MODULE}
+    - flatpak-builder --user --disable-rofiles-fuse --keep-build-dirs flatpak_app --repo=repo 
${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH}
 
-    - flatpak-builder --user --disable-rofiles-fuse --finish-only --repo=repo 
${BRANCH:+--default-branch=$BRANCH} flatpak_app ${MANIFEST_PATH}
     # Run automatic tests inside the Flatpak env
     - >
       xvfb-run -a -s "-screen 0 1024x768x24"
@@ -67,7 +17,7 @@
       ${TEST_BUILD_ARGS}
       flatpak_app
       dbus-run-session
-      meson test -C _build --no-stdsplit --print-errorlogs ${TEST_RUN_ARGS}
+      meson test -C _flatpak_build --no-stdsplit --print-errorlogs ${TEST_RUN_ARGS}
 
     # Generate a Flatpak bundle
     - flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH}
@@ -79,8 +29,8 @@
     paths:
       - "${BUNDLE}"
       - 'repo.tar'
-      - '_build/meson-logs/meson-log.txt'
-      - '_build/meson-logs/testlog.txt'
+      - '.flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/meson-logs/meson-log.txt'
+      - '.flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/meson-logs/testlog.txt'
     expire_in: 14 days
   cache:
     key: "$CI_JOB_NAME"


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