graphics/py-simplejpeg: New port: Simple package for fast JPEG encoding and decoding

This commit is contained in:
Yuri Victorovich 2024-09-17 08:14:12 -07:00
parent ffb6223129
commit fd8eef851a
6 changed files with 91 additions and 0 deletions

View file

@ -991,6 +991,7 @@
SUBDIR += py-s2
SUBDIR += py-scikit-image
SUBDIR += py-seqdiag
SUBDIR += py-simplejpeg
SUBDIR += py-sorl-thumbnail
SUBDIR += py-spectra
SUBDIR += py-sqlalchemy-imageattach

View file

@ -0,0 +1,32 @@
PORTNAME= simplejpeg
DISTVERSION= 1.7.6
CATEGORIES= graphics python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= yuri@FreeBSD.org
COMMENT= Simple package for fast JPEG encoding and decoding
WWW= https://gitlab.com/jfolz/simplejpeg
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= ${PY_SETUPTOOLS} \
cmake:devel/cmake-core \
${PYTHON_PKGNAMEPREFIX}cython3>0:lang/cython3@${PY_FLAVOR} \
${PYNUMPY} \
${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
USES= python
USE_PYTHON= pep517 autoplist pytest
TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
TEST_WRKSRC= ${WRKSRC}/test
post-extract: # force cythonization because pre-cythonized _jpeg.c fails to complile
@${RM} ${WRKSRC}/simplejpeg/_jpeg.c
post-install:
@${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/simplejpeg/_jpeg${PYTHON_EXT_SUFFIX}.so
.include <bsd.port.mk>

View file

@ -0,0 +1,3 @@
TIMESTAMP = 1726565663
SHA256 (simplejpeg-1.7.6.tar.gz) = 89ea4784eaa09edd11b0caded9c40326c4872ba9232ff1705d5b732492e7aca8
SIZE (simplejpeg-1.7.6.tar.gz) = 5793293

View file

@ -0,0 +1,16 @@
--- pyproject.toml.orig 2024-09-17 16:08:16 UTC
+++ pyproject.toml
@@ -29,11 +29,10 @@ requires = [
[build-system]
requires = [
- "setuptools>=74.1.1",
+ "setuptools",
"wheel",
- "cmake>=3.6.3",
"cython~=3.0.0",
- "numpy>=2.0.0",
+ "numpy",
]
build-backend = "setuptools.build_meta"

View file

@ -0,0 +1,37 @@
--- setup.py.orig 2024-09-17 09:48:31 UTC
+++ setup.py
@@ -8,7 +8,6 @@ import subprocess
import sysconfig
import subprocess
-from cmake import CMAKE_BIN_DIR
from setuptools import setup
from setuptools import find_packages
from setuptools import Extension
@@ -82,7 +81,7 @@ def make_type():
def make_type():
- if OS in ('linux', 'darwin'):
+ if OS in ('linux', 'darwin', 'freebsd'):
return 'Unix Makefiles'
elif OS == 'windows':
return 'NMake Makefiles'
@@ -152,7 +151,7 @@ class cmake_build_ext(build_ext):
os.chdir(build_dir)
config = 'Debug' if self.debug else 'Release'
env = dict(os.environ, **(env or {}))
- cmake = pt.join(CMAKE_BIN_DIR, 'cmake')
+ cmake = 'cmake'
subprocess.check_call([
cmake,
'-G' + make_type(), '-Wno-dev',
@@ -172,7 +171,7 @@ def _staticlib():
def _staticlib():
- if OS in ('linux', 'darwin'):
+ if OS in ('linux', 'darwin', 'freebsd'):
return 'libturbojpeg.a'
elif OS == 'windows':
return 'turbojpeg-static.lib'

View file

@ -0,0 +1,2 @@
simplejpeg is a simple package based on recent versions of libturbojpeg for fast
JPEG encoding and decoding.