{% set version = "1.56.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: 5189cd56447f9d56fcd7a1966efe5a8efd19843fdfd6bf9a23a9acbc57b5e3f9  # [linux64]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-aarch64-unknown-linux-gnu.tar.gz  # [aarch64]
    sha256: f3e9a9c8af7d17a2fbe0ce561a7dc42f65c5444025783f1f63cd47960a534a9e  # [aarch64]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-powerpc64le-unknown-linux-gnu.tar.gz  # [ppc64le]
    sha256: 0afa4900381dde20c5c3f06b863bbd730007f1ab470ec0a974fc2b846b473661  # [ppc64le]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-s390x-unknown-linux-gnu.tar.gz  # [s390x]
    sha256: 71af866a5c93c01e5ba6db3a58c23ae6b6d3139751af26bf997e10c6a976f4ca  # [s390x]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-x86_64-apple-darwin.tar.gz  # [osx and x86_64]
    sha256: 577faef3f118a4a259e5e61a415b06434081baeceeff7bbf2357456cfc5b8735  # [osx and x86_64]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-aarch64-apple-darwin.tar.gz  # [osx and arm64]
    sha256: 31b7e9c8b4ac3133b1952d1278077fa45250e26758625f972f9b2f4e2426709d  # [osx and arm64]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-i686-pc-windows-msvc.tar.gz  # [win32]
    sha256: 81b6ead9cd59c536a1e8095281ebae614133252601639227fed4b262737db220  # [win32]
    folder: msvc  # [win32]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-i686-pc-windows-gnu.tar.gz  # [win32]
    sha256: bad069ac697d4655be09617cdf8c319753e3806c3d7033526394accb32655c16  # [win32]
    folder: gnu  # [win32]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-x86_64-pc-windows-msvc.tar.gz  # [win64]
    sha256: 7ebee9ae583d0723d945fe89244fbc6f51f8723d318a2be9bcbe1e4ffc33606f  # [win64]
    folder: msvc  # [win64]
  - url: https://static.rust-lang.org/dist/rust-{{ version }}-x86_64-pc-windows-gnu.tar.gz  # [win64]
    sha256: a6b49fd2c03fcd831bc57785b3db30b76a15e412ef528f1a58a40971bf2b326f  # [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
    - pkgw
    - katietz
