| 
									
										
										
										
											2021-01-20 23:44:34 +01:00
										 |  |  | #!/bin/sh -e
 | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # Helper script for the build process to apply entitlements | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-25 09:06:14 +09:00
										 |  |  | in_place=: | 
					
						
							|  |  |  | if [ "$1" = --install ]; then | 
					
						
							|  |  |  |   shift | 
					
						
							|  |  |  |   in_place=false | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-09 10:25:33 +09:00
										 |  |  | DST="$1" | 
					
						
							|  |  |  | SRC="$2" | 
					
						
							|  |  |  | ICON="$3" | 
					
						
							|  |  |  | ENTITLEMENT="$4" | 
					
						
							| 
									
										
										
										
											2021-01-20 23:44:34 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-25 09:06:14 +09:00
										 |  |  | if $in_place; then | 
					
						
							|  |  |  |   trap 'rm "$DST.tmp"' exit | 
					
						
							| 
									
										
										
										
											2021-11-30 12:30:12 -05:00
										 |  |  |   cp -pPf "$SRC" "$DST.tmp" | 
					
						
							| 
									
										
										
										
											2021-02-25 09:06:14 +09:00
										 |  |  |   SRC="$DST.tmp" | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   cd "$MESON_INSTALL_DESTDIR_PREFIX" | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-09 10:25:33 +09:00
										 |  |  | if test -n "$ENTITLEMENT"; then | 
					
						
							| 
									
										
										
										
											2021-07-05 15:53:28 -04:00
										 |  |  |   codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC" | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Add the QEMU icon to the binary on Mac OS | 
					
						
							|  |  |  | Rez -append "$ICON" -o "$SRC" | 
					
						
							|  |  |  | SetFile -a C "$SRC" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-25 09:06:14 +09:00
										 |  |  | mv -f "$SRC" "$DST" | 
					
						
							| 
									
										
										
										
											2021-01-20 23:44:34 +01:00
										 |  |  | trap '' exit |