# -*- 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           python 1.0

name                py-jellyfish
version             1.3.0
revision            0

license             BSD
maintainers         nomaintainer

description         A library for doing approximate and phonetic matching \
                    of strings.
long_description    {*}${description}

homepage            https://github.com/jamesturk/jellyfish

checksums           ${distname}${extract.suffix} \
                    rmd160  f739477f2569bf10bc96bb8c14e1a7f260706ead \
                    sha256  fd77ba8e1c9835d2c56b11bde6765380cbcac333037974c4ba4b60092c383212 \
                    size    362154

python.versions     311 312 313 314 315

set cryptography_darwin_min_ver 11

if {${name} ne ${subport}} {
    # Legacy systems support
    # https://github.com/jamesturk/jellyfish/issues/219
    if {${os.platform} eq "darwin" && ${os.major} < ${cryptography_darwin_min_ver}} {
        version         0.10.0
        revision        0
        checksums       ${distname}${extract.suffix} \
                        rmd160  135c8cb64f7201993257eb00543f8113b96e8aef \
                        sha256  c58d221cca1b91fe9afe8cf30a721904054533add4482075c9980c809f7d05bd \
                        size    125949
        depends_build-append \
                    port:py${python.version}-setuptools
        depends_test-append \
                    port:py${python.version}-pytest
        pre-test {
            test.env    PYTHONPATH=[glob -nocomplain ${worksrcpath}/build/lib*]
        }
        test.run        yes
        test.cmd        py.test-${python.branch}
        test.target     ${worksrcpath}/build/lib*/jellyfish/test.py
        # Keeps its own block for destroot to avoid accidental breakage:
        post-destroot {
            set docdir ${prefix}/share/doc/${subport}
            xinstall -d ${destroot}${docdir}
            xinstall -m 0644 -W ${worksrcpath} LICENSE README.md \
                ${destroot}${docdir}
        }
    } else {
        PortGroup       cargo_fetch 1.0

        python.pep517_backend   maturin

        test.run        yes
        test.env-append PYTHONPATH=${destroot}${python.pkgd}

        post-destroot {
            set docdir ${prefix}/share/doc/${subport}
            xinstall -d ${destroot}${docdir}
            xinstall -m 0644 -W ${worksrcpath} LICENSE README.md \
                ${destroot}${docdir}
        }

        # egrep -e '^(name|version|checksum) = ' Cargo.lock | perl -pe 's/^(?:name|version|checksum) = "(.+)"/$1/' | tr '\n' ' ' | perl -pe 's|([0-9a-f]{64})|\1 \\\n|g' | pbcopy
        cargo.crates \
            ahash 0.8.12 5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75 \
            autocfg 1.5.1 f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53 \
            cfg-if 1.0.5 4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600 \
            csv 1.4.0 52cd9d68cf7efc6ddfaaee42e7288d3a99d613d4b50f76ce9827ae0c6e14f938 \
            csv-core 0.1.13 704a3c26996a80471189265814dbc2c257598b96b8a7feae2d31ace646bb9782 \
            getrandom 0.3.4 899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd \
            heck 0.5.0 2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea \
            itoa 1.0.18 8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682 \
            libc 0.2.190 ce5d3ddc6d3fa000eb1536d85e147bfe31aacaba692ed6a876f95cb7c855be78 \
            memchr 2.8.3 cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98 \
            num-traits 0.2.19 071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841 \
            once_cell 1.21.4 9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50 \
            portable-atomic 1.15.0 05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85 \
            proc-macro2 1.0.107 985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9 \
            pyo3 0.30.1 229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4 \
            pyo3-build-config 0.30.1 70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700 \
            pyo3-ffi 0.30.1 5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4 \
            pyo3-macros 0.30.1 c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60 \
            pyo3-macros-backend 0.30.1 38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b \
            quote 1.0.47 1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001 \
            r-efi 5.3.0 69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f \
            ryu 1.0.23 9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f \
            serde_core 1.0.229 67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48 \
            serde_derive 1.0.229 e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348 \
            smallvec 1.16.3 5b3dc8af474f516a851ff4bd12db780f948b9250ad37211e4eec0bccea54e01b \
            syn 2.0.119 872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297 \
            syn 3.0.9 d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b \
            target-lexicon 0.13.5 adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca \
            tinyvec 1.13.3 fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee \
            unicode-ident 1.0.27 a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563 \
            unicode-normalization 0.1.25 5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8 \
            unicode-segmentation 1.13.3 c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8 \
            version_check 0.9.5 0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a \
            wasip2 1.0.4+wasi-0.2.12 b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487 \
            wit-bindgen 0.57.1 1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e \
            zerocopy 0.8.63 e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8 \
            zerocopy-derive 0.8.63 863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f \
    }
}
