gnu: python-freetype-py: Update to 2.5.1.

* gnu/packages/python-xyz.scm (python-freetype-py): Update to 2.5.1. Use
G-expressions.
[source]: Swritch to git-fetch providing tests.
[build-system]: Use pyproject.
[arugmetns] <tests?>: Run tests.
<test-flags>: Run only tests for the main module.
<phases>: Rework 'embed-library-refrence into 'patch-lib-paths; add
'set-version.
[native-inputs]: Remove unzip; add python-pytest and python-setuptools.

Change-Id: Ic1d38a74a4c192b86dd20bde32b07d1293344097
This commit is contained in:
Sharlatan Hellseher 2025-08-16 23:58:17 +01:00
parent a4de7d0f32
commit fdc6700f24
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -33124,33 +33124,42 @@ Foundation maintained libraries.")
(define-public python-freetype-py (define-public python-freetype-py
(package (package
(name "python-freetype-py") (name "python-freetype-py")
(version "2.3.0") (version "2.5.1")
(source (source
(origin (origin
(method url-fetch) (method git-fetch) ;no tests in PyPI archive
(uri (pypi-uri "freetype-py" version ".zip")) (uri (git-reference
(url "https://github.com/rougier/freetype-py")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256 (sha256
(base32 "1l55wzy21jmdayjna29ahzxrf2fp68580978rs6kap1a4zilrdpr")))) (base32 "0cls0469zfqzwpq6k4pxa9vrczsqabqk4qh7444xybcyq9qgs1lp"))))
(build-system python-build-system) (build-system pyproject-build-system)
(native-inputs
(list python-setuptools-scm
unzip))
(inputs (list freetype))
(arguments (arguments
`(#:phases (list
;; Note: the pypi archive does not contain tests, but running the check #:test-flags #~(list "tests")
;; phase will at least test whether the module loads correctly. #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-before 'build 'embed-library-reference (add-after 'unpack 'patch-lib-paths
(lambda* (#:key inputs #:allow-other-keys) (lambda _
(substitute* "freetype/raw.py" (substitute* "freetype/raw.py"
(("^(filename = ).*" _ >) (("ctypes.util.find_library\\('freetype'\\)")
(string-append > "\"" (search-input-file inputs "/lib/libfreetype.so") (format #f "'~a/~a'" #$(this-package-input "freetype")
"\"\n")))))))) "lib/libfreetype.so")))))
(add-before 'build 'set-version
(lambda _
(setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version))))))
(native-inputs
(list python-pytest
python-setuptools
python-setuptools-scm))
(inputs
(list freetype))
(home-page "https://github.com/rougier/freetype-py") (home-page "https://github.com/rougier/freetype-py")
(synopsis "Freetype python bindings") (synopsis "Freetype python bindings")
(description "Freetype Python provides bindings for the FreeType (description
library. Only the high-level API is bound.") "Freetype Python provides bindings for the FreeType library. Only the
high-level API is bound.")
(license license:bsd-3))) (license license:bsd-3)))
(define-public python-frozendict (define-public python-frozendict