File: cross-compile

package info (click to toggle)
hub 2.14.2~ds1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,376 kB
  • sloc: sh: 1,049; ruby: 857; makefile: 89
file content (32 lines) | stat: -rwxr-xr-x 820 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/env bash
# Usage: script/cross-compile <version>
#
# Packages the project over a matrix of supported OS and architectures and
# prints the asset filenames and labels suitable for upload.
set -e

version="${1?}"

echo '
  darwin   amd64    macOS
  freebsd  386      FreeBSD 32-bit
  freebsd  amd64    FreeBSD 64-bit
  linux    386      Linux 32-bit
  linux    amd64    Linux 64-bit
  linux    arm      Linux ARM 32-bit
  linux    arm64    Linux ARM 64-bit
  windows  386      Windows 32-bit
  windows  amd64    Windows 64-bit
' | {
  while read os arch label; do
    [ -n "$os" ] || continue

    label="hub ${version} for ${label}"
    if ! file="$(script/package "$os" "$arch" "$version")"; then
      echo "packaging $label failed" >&2
      continue
    fi

    printf "%s\t%s\n" "$file" "$label"
  done
}