# -*- 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.108.1 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  16f76f729be284735b9fa22750300be4d78c7deb \
                        sha256  4061b44a8b63c3ce4a1d4abb48930761c9baa83162ca0c6822ed3966c9ef8fb7 \
                        size    4229632
} else {
    set gem_platform    x86_64-darwin
    checksums           rmd160  07f37b46628c3b4ede377db5800998a960869b81 \
                        sha256  315e0ac7e856b31ee44371045f69414bad82aad1bd37c2b9a83c5e52dbbb4dca \
                        size    4456448
}
distname            sass-embedded-${version}-${gem_platform}
worksrcdir          sass-embedded-${version}

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