File: install

package info (click to toggle)
junixsocket 2.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 4,196 kB
  • sloc: java: 23,164; ansic: 5,256; xml: 3,353; sh: 1,314; makefile: 27
file content (43 lines) | stat: -rwxr-xr-x 1,097 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
#
# Installs optional Xcode helper components for crossclang
#
# You should run this as root, i.e.,: sudo ./install
#

cd "$(dirname $0)"
pwd=$(pwd)

developerPath=$(xcode-select -p)
if [[ -z "$developerPath" ]]; then
    echo "Error: Could not resolve XCode Developer path" >&2
    exit 1
fi
sdksPath="$developerPath/Platforms/MacOSX.platform/Developer/SDKs"
if [[ ! -d "$sdksPath" ]]; then
    echo "Error: Could not find SDKs path: $sdksPath" >&2
    exit 1
fi
toolchainsPath="/Library/Developer/Toolchains"
echo "Toolchains path: $toolchainsPath"
if [[ ! -d "$toolchainsPath" ]]; then
    mkdir -pv "$toolchainsPath"
fi

for toolchain in $(ls -1 | grep '\.xctoolchain$'); do
    echo Installing "$toolchain" ... 
    ( cd "$toolchainsPath" ; ln -sf "$pwd/$toolchain" )
done
echo

echo "SDKs path: $sdksPath"
for sdk in $(ls -1 | grep '\.sdk$'); do
    echo Installing "$sdk" ... 
    ( cd "$sdksPath" ; ln -sf "$pwd/$sdk" )
done

if [ $? -eq 0 ]; then
    echo Done. Now please restart XCode and run \"Clean Build Folder\".
else
    echo There were errors. Try running with sudo.
fi