# -*- 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-dulwich
version             0.24.7
revision            0

categories-append   devel
maintainers         {danchr @danchr} openmaintainer
license             {GPL-2+ Apache-2+}

description         Pure-Python Git Library
long_description    Simple Pure-Python implementation of the Git file \
                    formats and protocols. Dulwich is the place where \
                    Mr. and Mrs. Git live in one of the Monty Python sketches.

homepage            https://www.dulwich.io

checksums           ${distname}${extract.suffix} \
                    rmd160  027a1ec4ba9f395968963d1da9153c6f3b750bda \
                    sha256  f10bffa1395a8dedc3d38ac05164f761ae838a6a18f9a09a966f27dd651850d4 \
                    size    968411

python.versions     310 311 312 313 314

set dulwich_darwin_min_ver 11

if {${name} ne ${subport}} {
    patchfiles      patch-archflags.diff

    depends_lib-append \
                    port:py${python.version}-urllib3

    if {${python.version} < 311} {
        depends_lib-append \
                    port:py${python.version}-typing_extensions
    }

    if {${os.platform} eq "darwin" && ${os.major} < ${dulwich_darwin_min_ver}} {
        build.env-append \
                    PURE=1
    } else {
        PortGroup   rust 1.0

        depends_build-append \
                    port:py${python.version}-setuptools-rust

        # sudo cargo update
        # 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 \
            autocfg 1.5.0 c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8 \
            heck 0.5.0 2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea \
            indoc 2.0.6 f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd \
            libc 0.2.177 2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976 \
            memchr 2.7.6 f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273 \
            memoffset 0.9.1 488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a \
            once_cell 1.21.3 42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d \
            portable-atomic 1.11.1 f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483 \
            proc-macro2 1.0.101 89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de \
            pyo3 0.27.0 fa8e48c12afdeb26aa4be4e5c49fb5e11c3efa0878db783a960eea2b9ac6dd19 \
            pyo3-build-config 0.27.0 bc1989dbf2b60852e0782c7487ebf0b4c7f43161ffe820849b56cf05f945cee1 \
            pyo3-ffi 0.27.0 c808286da7500385148930152e54fb6883452033085bf1f857d85d4e82ca905c \
            pyo3-macros 0.27.0 83a0543c16be0d86cf0dbf2e2b636ece9fd38f20406bb43c255e0bc368095f92 \
            pyo3-macros-backend 0.27.0 2a00da2ce064dcd582448ea24a5a26fa9527e0483103019b741ebcbe632dcd29 \
            quote 1.0.41 ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1 \
            syn 2.0.107 2a26dbd934e5451d21ef060c018dae56fc073894c5a7896f882928a76e6d081b \
            target-lexicon 0.13.3 df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c \
            unicode-ident 1.0.19 f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d \
            unindent 0.2.4 7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3
    }
}
