2021-01-21 01:44:34 +03:00
|
|
|
#!/bin/sh -e
|
|
|
|
#
|
|
|
|
# Helper script for the build process to apply entitlements
|
|
|
|
|
2021-02-25 03:06:14 +03:00
|
|
|
in_place=:
|
|
|
|
if [ "$1" = --install ]; then
|
|
|
|
shift
|
|
|
|
in_place=false
|
|
|
|
fi
|
|
|
|
|
2021-01-21 01:44:34 +03:00
|
|
|
SRC="$1"
|
|
|
|
DST="$2"
|
|
|
|
ENTITLEMENT="$3"
|
|
|
|
|
2021-02-25 03:06:14 +03:00
|
|
|
if $in_place; then
|
|
|
|
trap 'rm "$DST.tmp"' exit
|
|
|
|
cp -af "$SRC" "$DST.tmp"
|
|
|
|
SRC="$DST.tmp"
|
|
|
|
else
|
|
|
|
cd "$MESON_INSTALL_DESTDIR_PREFIX"
|
|
|
|
fi
|
|
|
|
|
|
|
|
codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC"
|
|
|
|
mv -f "$SRC" "$DST"
|
2021-01-21 01:44:34 +03:00
|
|
|
trap '' exit
|