# -*- 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           github 1.0
PortGroup           meson 1.0

github.setup        simd-everywhere simde 0.8.2 v
revision            0
categories          devel
license             MIT
maintainers         @jasonliu-- openmaintainer

description         Library that implements SIMD instruction sets for \
                    systems which don't natively support them
long_description    SIMDe (SIMD everywhere) is a header-only library \
                    that provides fast, portable implementations of \
                    SIMD (Single Instruction, Multiple Data) \
                    intrinsics on hardware which doesn't natively \
                    them, such as calling Intel SSE or AVX functions \
                    on an ARM processor, or calling ARM Neon functions \
                    on an Intel processor. \
                    \n \
                    \nThis makes porting code to other architectures \
                    much easier in some key ways. First, instead of \
                    forcing you to rewrite everything for each \
                    architecture, SIMDe lets you get a port up and \
                    running almost effortlessly. Second, SIMDe makes \
                    it easier to write code targeting ISA extensions \
                    you don't have access to, without needing to \
                    resort to using an emulator.

checksums           rmd160  b6645947b9abe375b46417049a6798d2b4c89bbc \
                    sha256  ed2a3268658f2f2a9b5367628a85ccd4cf9516460ed8604eed369653d49b25fb \
                    size    7468969
github.tarball_from archive

# https://github.com/simd-everywhere/simde/pull/1318
patchfiles          patch-test.h.diff
# https://github.com/simd-everywhere/simde/pull/1319
patchfiles-append   patch-sse2.h.diff

# https://github.com/simd-everywhere/simde/issues/1313
# Usage of built-ins here requires C23 and support for those in libm,
# which is there for our systems of interest.
# Update this patch, once upstream commits a better fix.
patchfiles-append   patch-simde-math.h.diff

compiler.blacklist-append   {clang < 1001} *gcc-4.*
compiler.c_standard         1999
compiler.openmp_version     2.5

pre-configure {
    if {![variant_isset tests]} {
        configure.args-append   -Dtests=false
    }
}

variant tests description "Build unit tests" {
    post-destroot {
        set destroot_share ${destroot}${prefix}/share/${name}
        if {![file exists $destroot_share]} {
            file mkdir $destroot_share
        }
        copy ${build.dir}/test $destroot_share/
    }
}

default_variants    +tests
