{% set version = "1.54.0" %}

package:
  name: 'rust-suite'
  version: {{ version }}

source:
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-x86_64-unknown-linux-gnu.tar.gz  # [linux64]
    sha256: 350354495b1d4b6dd2ec7cf96aa9bc61d031951cf667a31e8cf401dc508639e6  # [linux64]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-aarch64-unknown-linux-gnu.tar.gz  # [aarch64]
    sha256: 33a50c5366a57aaab43c1c19e4a49ab7d8ffcd99a72925c315fb1f9389139e6f  # [aarch64]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-powerpc64le-unknown-linux-gnu.tar.gz  # [ppc64le]
    sha256: 67cadf7ac5bd2e3d5fb4baede69846059f17c4e099f771329b266d08b875ed71  # [ppc64le]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-s390x-unknown-linux-gnu.tar.gz  # [s390x]
    sha256: f95e8b6b84d6685c95f048d81db241af759cd6ffa717dbe95e2dbee7f3c3a827  # [s390x]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-x86_64-apple-darwin.tar.gz  # [osx]
    sha256: 5eb27a4f5f7a4699bc70cf1848e340ddd74e151488bfcb26853fd584958e3d33  # [osx]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-i686-pc-windows-msvc.tar.gz  # [win32]
    sha256: c86166d7c27e8e81e7a93d6b83729e611cee068bf51145720f3c0f714bba9eae  # [win32]
    folder: msvc  # [win32]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-i686-pc-windows-gnu.tar.gz  # [win32]
    sha256: c0d631dd73b1fd4d9ea792092688ed53b43e6ed30713fdd9106ec784e5db6254  # [win32]
    folder: gnu  # [win32]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-x86_64-pc-windows-msvc.tar.gz  # [win64]
    sha256: 1c01182f8d9ef1295eacf58e5b7ba2e3183d768b91f7f650a7421808779068a0  # [win64]
    folder: msvc  # [win64]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-x86_64-pc-windows-gnu.tar.gz  # [win64]
    sha256: f8b9b2befdf71626c44957c3467aa00e300696e579a8c6d368cb739adc8776e3  # [win64]
    folder: gnu  # [win64]

build:
  number: 0
  # the distributed binaries are already relocatable
  binary_relocation: False
  runpath_whitelist:
    - $ORIGIN/../lib
  missing_dso_whitelist:
    - /usr/lib/libresolv.9.dylib
    - /usr/lib/libc++.1.dylib
    - /usr/lib/libc++abi.dylib
    - /usr/lib/libiconv.2.dylib
    - /usr/lib/libcurl.4.dylib
    - /usr/lib/libxar.1.dylib
    - $RPATH/libLLVM-12-rust-1.54.0-stable.so
    # Since 1.32.0 macOS also needs:
    - /System/Library/Frameworks/Python.framework/Versions/2.7/Python
    - /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols
    - /usr/lib/libcompression.dylib
    - /usr/lib/libedit.3.dylib
    - /usr/lib/libform.5.4.dylib
    - /usr/lib/libncurses.5.4.dylib
    - /usr/lib/libpanel.5.4.dylib
    - /usr/lib/libxml2.2.dylib
    # Fixed via install_name_tool now (just declaring it here meant the thing using -
    # lib/rustlib/x86_64-apple-darwin/lib/python2.7/site-packages/lldb/lldb-argdumper - was
    # still unable to find it at runtime).
    # - $RPATH/libLLVM.dylib

    - '**/ld-linux-x86-64.so.2'
    - '**/libc.so.6'
    - '**/libdl.so.2'
    - '**/ld64.so.*'
    - '**/libgcc_s.so.1'
    - '**/libm.so.6'
    - '**/libpthread.so.0'
    - '**/librt.so.1'
    - '**/libgcc_s.so.1'
    - '**/libz.so.1'
    # Since 1.32.0 linux also needs:
    - '**/libstdc++.so.6'

outputs:
  - name: rust
    script: install-msvc.sh  # [win]
    script: install-unix.sh  # [not win]
    requirements:
      build:
        - {{ compiler('c') }}    # [osx]
        - posix  # [win]


  - name: rust-gnu  # [win]
    script: install-gnu.sh  # [win]
    requirements:  # [win]
      build:  # [win]
        - posix  # [win]

about:
  home: https://www.rust-lang.org
  license: MIT
  summary: |
    Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.
    This package provides the compiler (rustc) and the documentation utilities rustdoc.
  dev_url: https://doc.rust-lang.org/std/
  doc_url: https://www.rust-lang.org/en-US/documentation.html

extra:
  recipe-maintainers:
    - abhi18av
    - dlaehnemann
    - johanneskoester
    - mingwandroid
    - pkgw
