kind: manual

sources:
- kind: git
  url: upstream:linux
  track: v4.0
  ref: 39a8804455fb23f09157341d3ba7db6d7ae6ee76

depends:
- filename: build-essential/stage2.bst
  type: build
- build-essential/fhs-dirs.bst

environment:
  PATH: /usr/bin:/bin:/usr/sbin:/sbin:/tools/bin:/tools/sbin

config:
  install-commands:
  - |
    case "%{bst-arch}" in
        armv5l)
            ARCH="arm" ;;
        armv7b|armv7l|armv7lhf)
            ARCH="arm" ;;
        armv8l64|armv8b64)
            ARCH="arm64" ;;
        x86_32)
            ARCH="i386" ;;
        x86_64)
            ARCH="x86_64" ;;
        ppc64)
            ARCH="powerpc" ;;
        *)
            echo "Error: unsupported Morph architecture: %{bst-arch}" >&2
            exit 1
    esac
    ARCH=$ARCH make INSTALL_HDR_PATH=dest headers_install
  - install -d "%{install-root}%{includedir}"
  - cp -r dest/include/* "%{install-root}%{includedir}"
