[gimp] build: separate debug symbols from binaries in the Windows installer.



commit c5b05b6e03e5cc33ef5572eafc2b9a5f674337d8
Author: Jehan <jehan girinstud io>
Date:   Tue May 18 17:21:35 2021 +0200

    build: separate debug symbols from binaries in the Windows installer.
    
    The shell script was given to me by ender. This is an additional step he
    runs after building.

 .gitlab-ci.yml                               |  4 ++++
 build/windows/gitlab-ci/split-debug-msys2.sh | 22 ++++++++++++++++++++++
 2 files changed, 26 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3209e88304..a513a8da75 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -278,6 +278,8 @@ gimp-win64-native:
   script:
     - C:\msys64\usr\bin\pacman --noconfirm -Syyuu
     - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/build-gimp-msys2.sh"
+    - cd _install-w64
+    - C:\msys64\usr\bin\bash -lc "bash -x ../build/windows/gitlab-ci/split-debug-msys2.sh"
   artifacts:
     name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
     when: always
@@ -332,6 +334,8 @@ gimp-win32-native:
   script:
     - C:\msys64\usr\bin\pacman --noconfirm -Syyuu
     - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/build-gimp-msys2.sh"
+    - cd _install-w32
+    - C:\msys64\usr\bin\bash -lc "bash -x ../build/windows/gitlab-ci/split-debug-msys2.sh"
   artifacts:
     name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
     when: always
diff --git a/build/windows/gitlab-ci/split-debug-msys2.sh b/build/windows/gitlab-ci/split-debug-msys2.sh
new file mode 100755
index 0000000000..3721b6931c
--- /dev/null
+++ b/build/windows/gitlab-ci/split-debug-msys2.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+if [ -z "$1" ]
+then
+       find . \( -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' \) -type f -exec objcopy -v 
--only-keep-debug '{}' '{}'.debug \;
+       find . \( -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' \) -type f -exec objcopy -v 
--add-gnu-debuglink='{}'.debug '{}' --strip-unneeded \;
+       find . -iname '*.debug' -exec "$0" {} +
+else
+       while [ -n "$1" ]
+       do
+               FP="$1"
+               NAME="${FP##*/}"
+               DIR="${FP%/*}"
+               echo "$FP -> $DIR/.debug"
+               if [ ! -d "$DIR/.debug" ]
+               then
+                       mkdir "$DIR/.debug"
+               fi
+               mv "$FP" "$DIR/.debug"
+               shift
+       done
+fi


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