graphics/py-dj52-sorl-thumbnail: New port

The sorl-thumbnail package provides an easy way to generate image
thumbnails.

Some of its features:
- Storage support
- Pluggable Engine support for Pillow, GraphicsMagick, ImageMagick and Wand
- Pluggable Key Value Store support (cached db and redis)
- Pluggable Backend support
- Admin integration with possibility to delete
- Dummy generation (placeholders)
- Flexible, simple syntax, generates no html
- ImageField for model that deletes thumbnails
- CSS style cropping options
- Back smart cropping, and remove borders from the images when cropping
- Margin calculation for vertical positioning
- Alternative resolutions versions of a thumbnail

This is a Django 5.2.X specific clone.
This commit is contained in:
Kai Knoblich 2025-10-24 16:24:02 +02:00
parent 7c9b7e8add
commit 36c3388835
5 changed files with 93 additions and 0 deletions

View File

@ -921,6 +921,7 @@
SUBDIR += py-contextily
SUBDIR += py-descartes
SUBDIR += py-diplib
SUBDIR += py-dj52-sorl-thumbnail
SUBDIR += py-django-easy-thumbnails
SUBDIR += py-djvulibre
SUBDIR += py-exifread

View File

@ -0,0 +1,62 @@
PORTNAME= sorl-thumbnail
DISTVERSION= 12.11.0
CATEGORIES= graphics python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}dj52-
DISTNAME= sorl_thumbnail-${DISTVERSION}
MAINTAINER= kai@FreeBSD.org
COMMENT= Sorl-thumbnail provides an easy way to generate image thumbnails
WWW= https://github.com/jazzband/sorl-thumbnail
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= ${PY_SETUPTOOLS} \
${PYTHON_PKGNAMEPREFIX}setuptools-scm>=8:devel/py-setuptools-scm@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}wheel>:devel/py-wheel@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}django52>=4.2:www/py-django52@${PY_FLAVOR}
USES= python:3.10+
USE_PYTHON= autoplist concurrent pep517
CONFLICTS_INSTALL= ${PYTHON_PKGNAMEPREFIX}*${PORTNAME}
NO_ARCH= yes
PORTDOCS= *
OPTIONS_DEFINE= DOCS
OPTIONS_DEFAULT= PILLOW
OPTIONS_SINGLE= IMAGELIB
OPTIONS_GROUP= CACHING
# An PGMAGICK option would still be possible as well, but the ports tree does
# not yet have a py-pgmagick port.
OPTIONS_SINGLE_IMAGELIB= GRAPHICSMAGICK IMAGEMAGICK PILLOW WAND
OPTIONS_GROUP_CACHING= REDIS
GRAPHICSMAGICK_DESC= Use GraphicsMagick for image processing (faster)
IMAGEMAGICK_DESC= Use ImageMagick for image processing
PILLOW_DESC= Use internal image processing
REDIS_DESC= Use REDIS as Key Value Store
WAND_DESC= Use Wand with ImageMagick
DOCS_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx>=0,1:textproc/py-sphinx@${PY_FLAVOR}
GRAPHICSMAGICK_RUN_DEPENDS= ${LOCALBASE}/bin/gm:graphics/GraphicsMagick
IMAGEMAGICK_USES= magick:6,run
PILLOW_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pillow>0:graphics/py-pillow@${PY_FLAVOR}
REDIS_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}redis>0:databases/py-redis@${PY_FLAVOR}
WAND_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}Wand>0:graphics/py-wand@${PY_FLAVOR}
post-build-DOCS-on:
${SETENV} PYTHONPATH=${WRKSRC} ${LOCALBASE}/bin/sphinx-build-${PYTHON_VER} \
-d ${WRKDIR} -b html ${WRKSRC}/docs ${WRKSRC}/build/sphinx/html
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
(cd ${WRKSRC}/build/sphinx/html && \
${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} \
"! -name .buildinfo -and ! -name objects.inv")
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1755414298
SHA256 (sorl_thumbnail-12.11.0.tar.gz) = 191b89c27ecb40b5c2a35549d557d17c4841c6aff439b2e17b938b91eea463b3
SIZE (sorl_thumbnail-12.11.0.tar.gz) = 667102

View File

@ -0,0 +1,11 @@
Relax version requirements.
--- pyproject.toml.orig 2025-08-20 12:07:03 UTC
+++ pyproject.toml
@@ -1,5 +1,5 @@
[build-system]
-requires = ["setuptools>=64", "setuptools_scm>=8"]
+requires = ["setuptools", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"
[project]

View File

@ -0,0 +1,16 @@
The sorl-thumbnail package provides an easy way to generate image
thumbnails.
Some of its features:
- Storage support
- Pluggable Engine support for Pillow, GraphicsMagick, ImageMagick and Wand
- Pluggable Key Value Store support (cached db and redis)
- Pluggable Backend support
- Admin integration with possibility to delete
- Dummy generation (placeholders)
- Flexible, simple syntax, generates no html
- ImageField for model that deletes thumbnails
- CSS style cropping options
- Back smart cropping, and remove borders from the images when cropping
- Margin calculation for vertical positioning
- Alternative resolutions versions of a thumbnail