Skip to content

Commit

Permalink
_build.sh: add CW_PKG_FLATTEN option [ci skip]
Browse files Browse the repository at this point in the history
Use a solution that doesn't need `find -execdir`, because that is not
supported by busybox (alpine):
```
find: unrecognized: -execdir
BusyBox v1.36.1 (2023-07-27 17:12:24 UTC) multi-call binary.
```
https://github.com/curl/curl-for-win/actions/runs/6827484086/job/18569701123#step:3:5661

Also useful for trurl CI job:
curl/trurl#249
  • Loading branch information
vszakats committed Nov 10, 2023
1 parent 38bbf85 commit 0e5c54d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions _build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ set -o xtrace -o errexit -o nounset; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o p
# CW_PKG_NODELETE
# Leave the unified package tree on the disk. Default: 0
#
# CW_PKG_FLATTEN
# Flatten unified package dir layout for executables. Default: 0
#
# SIGN_CODE_GPG_PASS, SIGN_CODE_KEY_PASS: for code signing
# SIGN_PKG_KEY_ID, SIGN_PKG_GPG_PASS, SIGN_PKG_KEY_PASS: for package signing
# DEPLOY_GPG_PASS, DEPLOY_KEY_PASS: for publishing results
Expand Down Expand Up @@ -1626,3 +1629,24 @@ rm -f "${SIGN_CODE_KEY}"

# Upload/deploy binaries
. ./_ul.sh

# Leave "flat" layout for curl tool if requested
if [ "${CW_PKG_FLATTEN:-}" = '1' ]; then
find \
curl-*-*-*/bin \
curl-*-*-*/lib -type f \( \
-name 'curl*' -o \
-name 'trurl*' -o \
-name 'libcurl*.dll' -o \
-name 'libcurl*.dylib' -o \
-name 'libcurl.so*' \) \
| sort | while read -r f; do
mv "${f}" "$(dirname "${f}")/.."
done
find .
if [ "${_OS}" = 'mac' ]; then
find curl-*-*-* -name 'trurl' -exec install_name_tool -change \
'@executable_path/../lib/libcurl.4.dylib' \
'@executable_path/libcurl.4.dylib' '{}' \;
fi
fi

0 comments on commit 0e5c54d

Please sign in to comment.