Files
2026-04-14 09:24:55 -04:00

76 lines
2.5 KiB
Tcl

# -*- 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
PortGroup github 1.0
github.setup pytorch vision 0.25.0 v
github.tarball_from archive
revision 0
name py-torchvision
license BSD
maintainers nomaintainer
supported_archs arm64 x86_64
description PyTorch datasets, transforms and models specific to \
computer vision
long_description The torchvision package consists of popular \
datasets, model architectures, and common image \
transformations for computer vision.
checksums rmd160 814c51ed75809e3c92b108d1332cf63a7116c2bb \
sha256 a7ac1b3ab489d71f6e27edfad1e27616e4b8a9b1517e60fce4a950600d3510e8 \
size 14589841
python.versions 310 311 312 313 314
platforms {darwin >= 19}
# Remove torch from build-system requires to avoid transitive
# dependency version checks (same approach as py-pytorch)
patchfiles-append patch-pyproject_toml.diff \
patch-setup_py-c-flags.diff
if {${name} ne ${subport}} {
depends_build-append \
port:py${python.version}-pybind11
depends_lib-append \
port:py${python.version}-numpy \
port:py${python.version}-Pillow \
port:py${python.version}-pytorch
compiler.cxx_standard 2017
compiler.cpath-append \
${python.pkgd}/pybind11/include
# torch's BuildExtension applies -std=c++17 to all files;
# newer clang rejects this for C files, so rename bundled
# giflib C sources to C++ (giflib is valid C++)
post-patch {
foreach f [glob ${worksrcpath}/torchvision/csrc/io/image/cpu/giflib/*.c] {
move ${f} ${f}pp
}
reinplace {s|cpu/giflib/\*\.c|cpu/giflib/*.cpp|} ${worksrcpath}/setup.py
}
set torchvision_switches \
"USE_CUDA=0 \
CCACHE_DISABLE=1"
build.env-append \
{*}${torchvision_switches}
destroot.env-append \
{*}${torchvision_switches}
post-destroot {
set docdir ${prefix}/share/doc/${subport}
xinstall -d ${destroot}${docdir}
xinstall -m 0644 -W ${worksrcpath} LICENSE README.md \
${destroot}${docdir}
}
}