# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           ruby 1.0

ruby.branches       3.4 3.3 3.2 3.1
ruby.setup          sass-embedded 1.105.0 gem {} rubygems
categories-append   www
license             MIT
maintainers         nomaintainer
description         Use Dart Sass compiler from Ruby
long_description    A Ruby library that will communicate with the Dart Sass \
                    compiler using the Embedded Sass protocol.
homepage            https://github.com/sass-contrib/sass-embedded-host-ruby

# The source gem builds a native extension whose Rakefile downloads the
# dart-sass binary from GitHub at build time
# (https://trac.macports.org/ticket/74205).
# Since we need a binary anyway, use the precompiled platform gems
# instead so that we do not fetch during the build phase.
supported_archs     x86_64 arm64
universal_variant   no

if {${configure.build_arch} eq "arm64"} {
    set gem_platform    arm64-darwin
    checksums           rmd160  e661cf4728c11e6a92df116e8346ab67b04222a4 \
                        sha256  c9a7bdcf976b03c7a420df25de1ce39255cc8c9776117ea20bcf0fe7cbadee3f \
                        size    4202496
} else {
    set gem_platform    x86_64-darwin
    checksums           rmd160  a30b386832831c838a3bfd3df01602c26386d882 \
                        sha256  4e2d4238f8e286e0b256b63d3713ad27a06542b3079087e54d2c169072fb77fa \
                        size    4421632
}
distname            sass-embedded-${version}-${gem_platform}
worksrcdir          sass-embedded-${version}

if {${name} ne ${subport}} {
    depends_run-append \
                    port:rb${ruby.suffix}-protobuf
}
