]>
Commit | Line | Data |
---|---|---|
8a74ce61 AG |
1 | #!/bin/sh -e |
2 | # | |
3 | # Helper script for the build process to apply entitlements | |
4 | ||
237377ac AO |
5 | in_place=: |
6 | if [ "$1" = --install ]; then | |
7 | shift | |
8 | in_place=false | |
9 | fi | |
10 | ||
411ad8dd AO |
11 | DST="$1" |
12 | SRC="$2" | |
13 | ICON="$3" | |
14 | ENTITLEMENT="$4" | |
8a74ce61 | 15 | |
237377ac AO |
16 | if $in_place; then |
17 | trap 'rm "$DST.tmp"' exit | |
4006a27c | 18 | cp -pPf "$SRC" "$DST.tmp" |
237377ac AO |
19 | SRC="$DST.tmp" |
20 | else | |
21 | cd "$MESON_INSTALL_DESTDIR_PREFIX" | |
22 | fi | |
23 | ||
411ad8dd | 24 | if test -n "$ENTITLEMENT"; then |
3983a767 JA |
25 | codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC" |
26 | fi | |
27 | ||
28 | # Add the QEMU icon to the binary on Mac OS | |
29 | Rez -append "$ICON" -o "$SRC" | |
30 | SetFile -a C "$SRC" | |
31 | ||
237377ac | 32 | mv -f "$SRC" "$DST" |
8a74ce61 | 33 | trap '' exit |