distributable:
  url: https://github.com/FuelLabs/sway/archive/refs/tags/{{version.tag}}.tar.gz
  strip-components: 1

versions:
  github: FuelLabs/sway

provides:
  - bin/forc

dependencies:
  zlib.net: ^1
  openssl.org: ^1.1

build:
  dependencies:
    rust-lang.org: ^1.78 # stdsimd changes
    rust-lang.org/cargo: ^0
    # needed to build openssl module
    perl.org: '*'
    gnu.org/make: '*'
  script: cargo install --locked --path forc --root {{prefix}}

test:
  script:
    - forc new pkgx_test
    - cd pkgx_test
    - cat $FIXTURE >src/main.sw
    - forc test
  fixture: |
    script;

    #[test]
    fn test_meaning_of_life() {
        assert(6 * 7 == 42);
    }

    fn main() {
        ()
    }
