# -*- 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.2.1
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  1b4d1df549d80c4393ada6f6a2f3ea55538c2712 \
                    sha256  72d2fda61b23babe862018729be73c8b0dc12e3e6601f36f6e65d905e249f4db \
                    size    364417 \

python.versions     310 311 312 313 314

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.0 c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8 \
            cc 1.2.41 ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7 \
            cfg-if 1.0.3 2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9 \
            csv 1.3.1 acdc4883a9c96732e4733212c01447ebd805833b7275a73ca3ee080fd77afdaf \
            csv-core 0.1.12 7d02f3b0da4c6504f86e9cd789d8dbafab48c2321be74e9987593de5a894d93d \
            find-msvc-tools 0.1.4 52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127 \
            getrandom 0.3.3 26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4 \
            heck 0.5.0 2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea \
            indoc 2.0.6 f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd \
            itoa 1.0.15 4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c \
            libc 0.2.177 2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976 \
            memchr 2.7.6 f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273 \
            memoffset 0.9.1 488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a \
            num-traits 0.2.19 071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841 \
            once_cell 1.21.3 42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d \
            portable-atomic 1.11.1 f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483 \
            proc-macro2 1.0.101 89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de \
            pyo3 0.26.0 7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383 \
            pyo3-build-config 0.26.0 4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f \
            pyo3-ffi 0.26.0 025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105 \
            pyo3-macros 0.26.0 2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded \
            pyo3-macros-backend 0.26.0 100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf \
            python3-dll-a 0.2.14 d381ef313ae70b4da5f95f8a4de773c6aa5cd28f73adec4b4a31df70b66780d8 \
            quote 1.0.41 ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1 \
            r-efi 5.3.0 69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f \
            ryu 1.0.20 28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f \
            serde 1.0.228 9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e \
            serde_core 1.0.228 41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad \
            serde_derive 1.0.228 d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79 \
            shlex 1.3.0 0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64 \
            smallvec 1.15.1 67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03 \
            syn 2.0.106 ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6 \
            target-lexicon 0.13.3 df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c \
            tinyvec 1.10.0 bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa \
            tinyvec_macros 0.1.1 1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20 \
            unicode-ident 1.0.19 f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d \
            unicode-normalization 0.1.24 5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956 \
            unicode-segmentation 1.12.0 f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493 \
            unindent 0.2.4 7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3 \
            version_check 0.9.5 0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a \
            wasi 0.14.7+wasi-0.2.4 883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c \
            wasip2 1.0.1+wasi-0.2.4 0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7 \
            wit-bindgen 0.46.0 f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59 \
            zerocopy 0.8.27 0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c \
            zerocopy-derive 0.8.27 88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831 \
    }
}
