File: sysroot.bash

package info (click to toggle)
cmake 4.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 152,336 kB
  • sloc: ansic: 403,896; cpp: 303,920; sh: 4,105; python: 3,583; yacc: 3,106; lex: 1,279; f90: 538; asm: 471; lisp: 375; cs: 270; java: 266; fortran: 239; objc: 215; perl: 213; xml: 198; makefile: 111; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (53 lines) | stat: -rwxr-xr-x 1,426 bytes parent folder | download | duplicates (2)
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
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash

set -e

arch="$1"
readonly arch

case "$arch" in
    x86_64)
        tarball="sysroot-x86_64-pc-solaris2.10-sunos5.10-1.tar.xz"
        sha256sum="bea632b3ae755f89a1c0e64775437a9b29001a3fc3a3c2c6247b921776059231"
        ;;
    sparc64)
        tarball="sysroot-sparc64-sun-solaris2.10-sunos5.10-1.tar.xz"
        sha256sum="fd60cc1be951ae314ff2b4246ac055c8e5b21c39b4cd41b23ebcec709451d90f"
        ;;
    *)
        echo >&2 "Unknown architecture: $arch"
        exit 1
        ;;
esac
# To build externally, provide a Solaris sysroot tarball:
#   --build-arg SYSROOT_URL=...
#   --build-arg SYSROOT_SHA256SUM=...
# The tarball must contain one of:
#   sysroot/x86_64-pc-solaris2.10/{lib,usr/lib,usr/include}
#   sysroot/sparc64-sun-solaris2.10/{lib,usr/lib,usr/include}
# The content may be retrieved from a real Solaris host.
if test -n "$SYSROOT_URL"; then
    url="$SYSROOT_URL"
    if test -n "$SYSROOT_SHA256SUM"; then
        sha256sum="$SYSROOT_SHA256SUM"
    else
        sha256sum=""
    fi
    tarball=$(basename "$url")
else
    # This URL is only visible inside of Kitware's network.
    url="https://cmake.org/files/dependencies/internal/sunos/$tarball"
fi
readonly url
readonly tarball
readonly sha256sum

cd /tmp

curl -OL "$url"
if test -n "$sha256sum"; then
    echo "$sha256sum  $tarball" > sysroot.sha256sum
    sha256sum --check sysroot.sha256sum
fi

tar xf "$tarball" -C /opt/cross